• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SWTUtil类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.eclipse.jdt.internal.ui.util.SWTUtil的典型用法代码示例。如果您正苦于以下问题:Java SWTUtil类的具体用法?Java SWTUtil怎么用?Java SWTUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SWTUtil类属于org.eclipse.jdt.internal.ui.util包,在下文中一共展示了SWTUtil类的31个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createSuperTypeCombo

点赞 3

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private void createSuperTypeCombo(Composite parent) {
	final Label label= new Label(parent, SWT.NONE);
	label.setText(RefactoringMessages.PullUpInputPage1_Select_destination);
	label.setLayoutData(new GridData());

	fSuperTypesCombo= new Combo(parent, SWT.READ_ONLY);
	SWTUtil.setDefaultVisibleItemCount(fSuperTypesCombo);
	if (fCandidateTypes.length > 0) {
		for (int i= 0; i < fCandidateTypes.length; i++) {
			final String comboLabel= fCandidateTypes[i].getFullyQualifiedName('.');
			fSuperTypesCombo.add(comboLabel);
		}
		fSuperTypesCombo.select(fCandidateTypes.length - 1);
		fSuperTypesCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	}
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:17,
代码来源:PullUpMemberPage.java

示例2: createEditButton

点赞 3

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private Button createEditButton(Composite buttonComposite) {
	Button button= new Button(buttonComposite, SWT.PUSH);
	button.setText(RefactoringMessages.ChangeParametersControl_buttons_edit);
	button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	SWTUtil.setButtonDimensionHint(button);
	button.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			try {
				ParameterInfo[] selected= getSelectedElements();
				Assert.isTrue(selected.length == 1);
				ParameterInfo parameterInfo= selected[0];
				ParameterEditDialog dialog= new ParameterEditDialog(getShell(), parameterInfo, fMode.canChangeTypes(), fMode.canChangeDefault(), fTypeContext);
				dialog.open();
				fListener.parameterChanged(parameterInfo);
				fTableViewer.update(parameterInfo, PROPERTIES);
			} finally {
				fTableViewer.getControl().setFocus();
			}
		}
	});
	return button;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:24,
代码来源:ChangeParametersControl.java

示例3: createButtonComposite

点赞 3

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private void createButtonComposite(final Composite superComposite) {
	final Composite buttonComposite= new Composite(superComposite, SWT.NONE);
	buttonComposite.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
	final GridLayout layout= new GridLayout(2, false);
	layout.marginWidth= 0;
	buttonComposite.setLayout(layout);

	fSelectionLabel= new Label(buttonComposite, SWT.LEFT | SWT.WRAP | SWT.HORIZONTAL);
	GridData data= new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false);
	data.widthHint= convertWidthInCharsToPixels(32);
	fSelectionLabel.setLayoutData(data);

	final Button button= new Button(buttonComposite, SWT.PUSH);
	button.setText(RefactoringMessages.PullUpInputPage2_Select);
	button.setLayoutData(new GridData());
	SWTUtil.setButtonDimensionHint(button);
	button.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(final SelectionEvent e) {
			checkPulledUp();
			updateSelectionLabel();
		}
	});
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:26,
代码来源:PullUpMethodPage.java

示例4: createEnclosingTypeControls

点赞 3

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
/**
 * Creates the controls for the enclosing type name field. Expects a <code>GridLayout</code> with at
 * least 4 columns.
 *
 * @param composite the parent composite
 * @param nColumns number of columns to span
 */
protected void createEnclosingTypeControls(Composite composite, int nColumns) {
	// #6891
	Composite tabGroup= new Composite(composite, SWT.NONE);
	GridLayout layout= new GridLayout();
	layout.marginWidth= 0;
	layout.marginHeight= 0;
		tabGroup.setLayout(layout);

	fEnclosingTypeSelection.doFillIntoGrid(tabGroup, 1);

	Text text= fEnclosingTypeDialogField.getTextControl(composite);
	SWTUtil.setAccessibilityText(text, NewWizardMessages.NewTypeWizardPage_enclosing_field_description);

	GridData gd= new GridData(GridData.FILL_HORIZONTAL);
	gd.widthHint= getMaxFieldWidth();
	gd.horizontalSpan= 2;
	text.setLayoutData(gd);

	Button button= fEnclosingTypeDialogField.getChangeControl(composite);
	gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gd.widthHint = SWTUtil.getButtonWidthHint(button);
	button.setLayoutData(gd);
	ControlContentAssistHelper.createTextContentAssistant(text, fEnclosingTypeCompletionProcessor);
	TextFieldNavigationHandler.install(text);
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:33,
代码来源:NewTypeWizardPage.java

示例5: setEqualButtonSizes

点赞 3

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
/**
 * Makes the size of all buttons equal.
 */
protected void setEqualButtonSizes() {
	int width= SWTUtil.getButtonWidthHint(fManifestFileBrowseButton);
	int width2= SWTUtil.getButtonWidthHint(fNewManifestFileBrowseButton);
	width= Math.max(width, width2);

	width2= SWTUtil.getButtonWidthHint(fSealedPackagesDetailsButton);
	width= Math.max(width, width2);

	width2= SWTUtil.getButtonWidthHint(fUnSealedPackagesDetailsButton);
	width= Math.max(width, width2);

	width2= SWTUtil.getButtonWidthHint(fMainClassBrowseButton);
	width= Math.max(width, width2);

	setSize(fManifestFileBrowseButton, width, SWT.DEFAULT);
	setSize(fNewManifestFileBrowseButton, width, SWT.DEFAULT);
	setSize(fSealedPackagesDetailsButton, width, SWT.DEFAULT);
	setSize(fUnSealedPackagesDetailsButton, width, SWT.DEFAULT);
	setSize(fMainClassBrowseButton, width, SWT.DEFAULT);
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:24,
代码来源:JarManifestWizardPage.java

示例6: createLaunchConfigSelectionGroup

点赞 3

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private void createLaunchConfigSelectionGroup(Composite parent) {
	fLaunchConfigurationCombo= new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
	SWTUtil.setDefaultVisibleItemCount(fLaunchConfigurationCombo);
	fLaunchConfigurationCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

	fLauchConfigurationModel.addAll(Arrays.asList(getLaunchConfigurations()));
	String[] names= new String[fLauchConfigurationModel.size()];
	for (int i= 0, size= fLauchConfigurationModel.size(); i < size; i++) {
		LaunchConfigurationElement element= fLauchConfigurationModel.get(i);
		names[i]= element.getLaunchConfigurationName();
	}
	fLaunchConfigurationCombo.setItems(names);

	fLaunchConfigurationCombo.addListener(SWT.Selection, this);
	fLaunchConfigurationCombo.addListener(SWT.Modify, this);
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:17,
代码来源:FatJarPackageWizardPage.java

示例7: handleFinishedDropMove

点赞 3

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private void handleFinishedDropMove(DragSourceEvent event) {
	MultiStatus status= new MultiStatus(
		JavaPlugin.getPluginId(),
		IJavaStatusConstants.INTERNAL_ERROR,
		JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_resource,
		null);
	List<IResource> resources= convertSelection();
	for (Iterator<IResource> iter= resources.iterator(); iter.hasNext();) {
		IResource resource= iter.next();
		try {
			resource.delete(true, null);
		} catch (CoreException e) {
			status.add(e.getStatus());
		}
	}
	int childrenCount= status.getChildren().length;
	if (childrenCount > 0) {
		Shell parent= SWTUtil.getShell(event.widget);
		ErrorDialog error= new ErrorDialog(parent,
				JavaUIMessages.ResourceTransferDragAdapter_moving_resource,
				childrenCount == 1 ? JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_singular : Messages.format(
						JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_plural, String.valueOf(childrenCount)), status, IStatus.ERROR);
		error.open();
	}
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:26,
代码来源:ResourceTransferDragAdapter.java

示例8: newComboControl

点赞 3

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
protected Combo newComboControl(Composite composite, Key key, String[] values, String[] valueLabels) {
	ControlData data= new ControlData(key, values);

	Combo comboBox= new Combo(composite, SWT.READ_ONLY);
	comboBox.setItems(valueLabels);
	comboBox.setData(data);
	comboBox.addSelectionListener(getSelectionListener());
	comboBox.setFont(JFaceResources.getDialogFont());
	SWTUtil.setDefaultVisibleItemCount(comboBox);

	makeScrollableCompositeAware(comboBox);

	updateCombo(comboBox);

	fComboBoxes.add(comboBox);
	return comboBox;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:18,
代码来源:OptionsConfigurationBlock.java

示例9: doFillIntoGrid

点赞 3

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
@Override
public Control[] doFillIntoGrid(Composite parent, int nColumns) {
	assertEnoughColumns(nColumns);

	Button button= getSelectionButton(parent);
	GridData gd= new GridData();
	gd.horizontalSpan= nColumns;
	gd.horizontalAlignment= GridData.FILL;
	if (fButtonStyle == SWT.PUSH) {
		gd.widthHint = SWTUtil.getButtonWidthHint(button);
	}

	button.setLayoutData(gd);

	return new Control[] { button };
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:17,
代码来源:SelectionButtonDialogField.java

示例10: createMemberTable

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private void createMemberTable(final Composite parent) {
	Composite composite = new Composite(parent, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	GridLayout layout = new GridLayout(1, false);
	layout.marginWidth= 0;
	layout.marginHeight= 0;
	composite.setLayout(layout);
	
	final Table table= new Table(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.CHECK);
	table.setLinesVisible(true);
	GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
	table.setLayoutData(gridData);

	final GridData gd= new GridData(GridData.FILL_BOTH);
	gd.heightHint= SWTUtil.getTableHeightHint(table, 6);
	composite.setLayoutData(gd);

	fTableViewer= new CheckboxTableViewer(table);
	fTableViewer.setUseHashlookup(true);
	fTableViewer.setContentProvider(new ArrayContentProvider());
	fTableViewer.setLabelProvider(fLabelProvider);
	fTableViewer.addCheckStateListener(new ICheckStateListener() {

		public void checkStateChanged(final CheckStateChangedEvent event) {
			updateWizardPage(null, true);
		}
	});

	setTableInput();
}
 

开发者ID:ponder-lab,
项目名称:Constants-to-Enum-Eclipse-Plugin,
代码行数:31,
代码来源:ConvertToEnumTypePage.java

示例11: gridDataForButton

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private static GridData gridDataForButton(Button button, int span) {
  GridData gd = new GridData();
  gd.horizontalAlignment = GridData.FILL;
  gd.grabExcessHorizontalSpace = false;
  gd.horizontalSpan = span;
  gd.widthHint = SWTUtil.getButtonWidthHint(button);
  return gd;
}
 

开发者ID:gwt-plugins,
项目名称:gwt-eclipse-plugin,
代码行数:9,
代码来源:ModuleSelectionDialogButtonField.java

示例12: createButton

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private Button createButton(Composite buttonComposite, String text, final boolean up) {
	Button button= new Button(buttonComposite, SWT.PUSH);
	button.setText(text);
	button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	SWTUtil.setButtonDimensionHint(button);
	button.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			ISelection savedSelection= fTableViewer.getSelection();
			if (savedSelection == null)
				return;
			ParameterInfo[] selection= getSelectedElements();
			if (selection.length == 0)
				return;

			if (up) {
				moveUp(selection);
			} else {
				moveDown(selection);
			}
			fTableViewer.refresh();
			fTableViewer.setSelection(savedSelection);
			fListener.parameterListChanged();
			fTableViewer.getControl().setFocus();
		}
	});
	return button;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:29,
代码来源:ChangeParametersControl.java

示例13: createDialogArea

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	getShell().setText(fShellTitle);

	Composite composite = (Composite)super.createDialogArea(parent);
	Composite innerComposite = new Composite(composite, SWT.NONE);
	innerComposite.setLayoutData(new GridData());
	GridLayout gl= new GridLayout();
	gl.numColumns= 2;
	innerComposite.setLayout(gl);

	Label label= new Label(innerComposite, SWT.NONE);
	label.setText(fLabelText);
	label.setLayoutData(new GridData());

	final Combo combo= new Combo(innerComposite, SWT.READ_ONLY);
	SWTUtil.setDefaultVisibleItemCount(combo);
	for (int i = 0; i < fAllowedStrings.length; i++) {
		combo.add(fAllowedStrings[i]);
	}
	combo.select(fInitialSelectionIndex);
	fSelection= combo.getItem(combo.getSelectionIndex());
	GridData gd= new GridData();
	gd.widthHint= convertWidthInCharsToPixels(getMaxStringLength());
	combo.setLayoutData(gd);
	combo.addSelectionListener(new SelectionAdapter(){
		@Override
		public void widgetSelected(SelectionEvent e) {
			fSelection= combo.getItem(combo.getSelectionIndex());
		}
	});
	applyDialogFont(composite);
	return composite;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:35,
代码来源:ComboSelectionDialog.java

示例14: createSuperTypeList

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
/**
 * Creates the super type list.
 *
 * @param parent
 *            the parent control
 * @throws JavaModelException
 */
protected void createSuperTypeList(final Composite parent) throws JavaModelException {
	createSpacer(parent);

	final Label label= new Label(parent, SWT.NONE);
	label.setText(RefactoringMessages.ExtractSupertypeMemberPage_types_list_caption);
	GridData data= new GridData();
	data.horizontalSpan= 2;
	label.setLayoutData(data);

	final Composite composite= new Composite(parent, SWT.NONE);
	final GridLayout layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginWidth= 0;
	layout.marginHeight= 0;
	composite.setLayout(layout);
	data= new GridData(GridData.FILL_BOTH);
	data.horizontalSpan= 2;
	composite.setLayoutData(data);

	fTableViewer= new TableViewer(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	data= new GridData(GridData.FILL_BOTH);
	data.heightHint= SWTUtil.getTableHeightHint(fTableViewer.getTable(), 3);
	fTableViewer.getTable().setLayoutData(data);
	fTableViewer.setLabelProvider(createLabelProvider());
	fTableViewer.setContentProvider(new ArrayContentProvider());
	fTableViewer.setComparator(new JavaElementComparator());
	fTypesToExtract.add(getDeclaringType());
	fTableViewer.setInput(fTypesToExtract.toArray());

	createButtonComposite(composite);
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:39,
代码来源:ExtractSupertypeMemberPage.java

示例15: createTable

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private Control createTable(Composite parent) {
	Composite c= new Composite(parent, SWT.NONE);
	GridLayout gl= new GridLayout();
	gl.numColumns= 2;
	gl.marginWidth= 0;
	gl.marginHeight= 0;
	c.setLayout(gl);


	fTable= new Table(c, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION | SWT.BORDER);
	fTable.setFont(parent.getFont());

	GridData tableGD= new GridData(GridData.FILL_BOTH);
	tableGD.heightHint= SWTUtil.getTableHeightHint(fTable, ROW_COUNT);
	//tableGD.widthHint= 40;
	fTable.setLayoutData(tableGD);

	fTable.setLinesVisible(true);

	TableLayout layout= new TableLayout();
	fTable.setLayout(layout);
	fTable.setHeaderVisible(true);

	ColumnLayoutData[] columnLayoutData= new ColumnLayoutData[SIZE];
	columnLayoutData[STATE_PROP]= new ColumnPixelData(18, false, true);
	columnLayoutData[KEY_PROP]= new ColumnWeightData(40, true);
	columnLayoutData[VAL_PROP]= new ColumnWeightData(40, true);

	for (int i= 0; i < fgTitles.length; i++) {
		TableColumn tc= new TableColumn(fTable, SWT.NONE, i);
		tc.setText(fgTitles[i]);
		layout.addColumnData(columnLayoutData[i]);
		tc.setResizable(columnLayoutData[i].resizable);
	}

	createButtonComposite(c);
	return c;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:39,
代码来源:ExternalizeWizardPage.java

示例16: createTaskButton

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private Button createTaskButton(Composite parent, String label, SelectionAdapter adapter) {
	Button button= new Button(parent, SWT.PUSH);
	button.setText(label);
	button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	SWTUtil.setButtonDimensionHint(button);
	button.addSelectionListener(adapter);
	return button;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:9,
代码来源:ExternalizeWizardPage.java

示例17: createAddButton

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private Button createAddButton(Composite buttonComposite) {
	Button button= new Button(buttonComposite, SWT.PUSH);
	button.setText(RefactoringMessages.ChangeExceptionsControl_buttons_add);
	button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	SWTUtil.setButtonDimensionHint(button);
	button.setEnabled(true);
	button.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			doAddException();
		}
	});
	return button;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:15,
代码来源:ChangeExceptionsControl.java

示例18: createContents

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
public Composite createContents(Composite parent) {
	Composite result= new Composite(parent, SWT.NONE);
	result.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	result.setLayout(new GridLayout(1, false));

	Text text= new Text(result, SWT.MULTI | SWT.BORDER | SWT.READ_ONLY);
	SWTUtil.fixReadonlyTextBackground(text);
	text.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
	text.setText(Messages.format(FixMessages.CleanUpRegistry_ErrorTabPage_description, fException.getLocalizedMessage()));

	return result;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:13,
代码来源:CleanUpRegistry.java

示例19: createDescriptionFileGroup

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
protected void createDescriptionFileGroup(Composite parent) {
	// destination specification group
	fDescriptionFileGroup= new Composite(parent, SWT.NONE);
	GridLayout layout= new GridLayout();
	layout.numColumns= 3;
	fDescriptionFileGroup.setLayout(layout);
	fDescriptionFileGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));

	fDescriptionFileLabel= new Label(fDescriptionFileGroup, SWT.NONE);
	fDescriptionFileLabel.setText(JarPackagerMessages.JarOptionsPage_descriptionFile_label);

	// destination name entry field
	fDescriptionFileText= new Text(fDescriptionFileGroup, SWT.SINGLE | SWT.BORDER);
	fDescriptionFileText.addListener(SWT.Modify, new UntypedListener());
	GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
	data.widthHint= convertWidthInCharsToPixels(40);
	fDescriptionFileText.setLayoutData(data);

	// destination browse button
	fDescriptionFileBrowseButton= new Button(fDescriptionFileGroup, SWT.PUSH);
	fDescriptionFileBrowseButton.setText(JarPackagerMessages.JarOptionsPage_browseButton_text);
	fDescriptionFileBrowseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	SWTUtil.setButtonDimensionHint(fDescriptionFileBrowseButton);
	fDescriptionFileBrowseButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			handleDescriptionFileBrowseButtonPressed();
		}
	});
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:31,
代码来源:JarOptionsPage.java

示例20: createBasicOptionsGroup

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private void createBasicOptionsGroup(Composite composite) {

		fTitleButton= createButton(composite, SWT.CHECK, JavadocExportMessages.JavadocStandardWizardPage_titlebutton_label, createGridData(1));
		fTitleText= createText(composite, SWT.SINGLE | SWT.BORDER, null, createGridData(GridData.FILL_HORIZONTAL, 3, 0));
		SWTUtil.setAccessibilityText(fTitleText, JavadocExportMessages.JavadocStandardWizardPage_titlebutton_description);

		String text= fStore.getTitle();
		if (!text.equals("")) { //$NON-NLS-1$
			fTitleText.setText(text);
			fTitleButton.setSelection(true);
		} else
			fTitleText.setEnabled(false);

		fBasicOptionsGroup= new Group(composite, SWT.SHADOW_ETCHED_IN);
		fBasicOptionsGroup.setLayout(createGridLayout(1));
		fBasicOptionsGroup.setLayoutData(createGridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL, 2, 0));
		fBasicOptionsGroup.setText(JavadocExportMessages.JavadocStandardWizardPage_basicgroup_label);

		new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_usebutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.USE, true);
		new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_hierarchybutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.NOTREE, false);
		new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_navigartorbutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.NONAVBAR, false);

		fIndexCheck= new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_indexbutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.NOINDEX, false);

		fSeperatedIndexCheck= new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_seperateindexbutton_label, createGridData(GridData.GRAB_HORIZONTAL, 1,
				LayoutUtil.getIndent()), fStore.SPLITINDEX, true);
		fSeperatedIndexCheck.getButton().setEnabled(fIndexCheck.getButton().getSelection());

		fIndexCheck.getButton().addSelectionListener(new ToggleSelectionAdapter(new Control[] { fSeperatedIndexCheck.getButton()}));
		fTitleButton.addSelectionListener(new ToggleSelectionAdapter(new Control[] { fTitleText }));

	}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:33,
代码来源:JavadocStandardWizardPage.java

示例21: createCombo

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
protected Combo createCombo(Composite composite, int style, String message, GridData gd) {
	Combo combo= new Combo(composite, style);
	SWTUtil.setDefaultVisibleItemCount(combo);
	if (message != null)
		combo.setText(message);
	combo.setLayoutData(gd);
	return combo;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:9,
代码来源:JavadocWizardPage.java

示例22: createJavadocCommandSet

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
protected void createJavadocCommandSet(Composite composite) {

		final int numColumns= 2;

		GridLayout layout= createGridLayout(numColumns);
		layout.marginHeight= 0;
		layout.marginWidth= 0;
		Composite group = new Composite(composite, SWT.NONE);
		group.setLayoutData(createGridData(GridData.FILL_HORIZONTAL, 6, 0));
		group.setLayout(layout);

		createLabel(group, SWT.NONE, JavadocExportMessages.JavadocTreeWizardPage_javadoccommand_label, createGridData(GridData.HORIZONTAL_ALIGN_BEGINNING, numColumns, 0));
		fJavadocCommandText= createCombo(group, SWT.NONE, null, createGridData(GridData.FILL_HORIZONTAL, numColumns - 1, 0));

		fJavadocCommandText.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				doValidation(JAVADOCSTATUS);
			}
		});

		final Button javadocCommandBrowserButton= createButton(group, SWT.PUSH, JavadocExportMessages.JavadocTreeWizardPage_javadoccommand_button_label, createGridData(GridData.HORIZONTAL_ALIGN_FILL, 1, 0));
		SWTUtil.setButtonDimensionHint(javadocCommandBrowserButton);

		javadocCommandBrowserButton.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent event) {
				browseForJavadocCommand();
			}
		});
	}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:31,
代码来源:JavadocTreeWizardPage.java

示例23: createInputGroup

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
protected void createInputGroup(Composite composite) {

		createLabel(composite, SWT.NONE, JavadocExportMessages.JavadocTreeWizardPage_checkboxtreeandlistgroup_label, createGridData(6));
		Composite c= new Composite(composite, SWT.NONE);
		GridLayout layout= new GridLayout();
		layout.numColumns= 1;
		layout.makeColumnsEqualWidth= true;
		layout.marginWidth= 0;
		layout.marginHeight= 0;
		c.setLayout(layout);
		c.setLayoutData(createGridData(GridData.FILL_BOTH, 6, 0));

		ITreeContentProvider treeContentProvider= new JavadocProjectContentProvider();
		ITreeContentProvider listContentProvider= new JavadocMemberContentProvider();
		fInputGroup= new CheckboxTreeAndListGroup(c, this, treeContentProvider, new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT), listContentProvider, new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT), SWT.NONE, convertWidthInCharsToPixels(60), convertHeightInCharsToPixels(7));

		fInputGroup.addCheckStateListener(new ICheckStateListener() {
			public void checkStateChanged(CheckStateChangedEvent e) {
				doValidation(TREESTATUS);
			}
		});
		fInputGroup.setTreeComparator(new JavaElementComparator());

		SWTUtil.setAccessibilityText(fInputGroup.getTree(), JavadocExportMessages.JavadocTreeWizardPage_tree_accessibility_message);
		SWTUtil.setAccessibilityText(fInputGroup.getTable(), JavadocExportMessages.JavadocTreeWizardPage_table_accessibility_message);

		IJavaElement[] elements= fStore.getInitialElements();
		setTreeChecked(elements);
		if (elements.length > 0) {
			fInputGroup.setTreeSelection(new StructuredSelection(elements[0].getJavaProject()));
		}

		fInputGroup.aboutToOpen();
	}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:35,
代码来源:JavadocTreeWizardPage.java

示例24: createAntScriptGroup

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private void createAntScriptGroup(Composite parent) {
	Composite composite= new Composite(parent, SWT.NONE);
	GridData layoutData= new GridData(SWT.FILL, SWT.TOP, true, false);
	composite.setLayoutData(layoutData);
	GridLayout layout= new GridLayout(3, false);
	composite.setLayout(layout);

	fAntScriptSaveCheckbox= new Button(composite, SWT.CHECK | SWT.LEFT);
	fAntScriptSaveCheckbox.setText(FatJarPackagerMessages.FatJarPackageWizardPage_saveAntScript_text);
	fAntScriptSaveCheckbox.addListener(SWT.Selection, this);
	GridData data= new GridData(SWT.BEGINNING);
	data.horizontalSpan= 3;
	fAntScriptSaveCheckbox.setLayoutData(data);

	// ant script name entry field
	fAntScriptLabel= createLabel(composite, FatJarPackagerMessages.FatJarPackageWizardPage_antScriptLocation_text, false);

	fAntScriptNamesCombo= new Combo(composite, SWT.SINGLE | SWT.BORDER);
	SWTUtil.setDefaultVisibleItemCount(fAntScriptNamesCombo);
	fAntScriptNamesCombo.addListener(SWT.Modify, this);
	fAntScriptNamesCombo.addListener(SWT.Selection, this);
	data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
	data.widthHint= SIZING_TEXT_FIELD_WIDTH;
	data.horizontalSpan= 1;
	fAntScriptNamesCombo.setLayoutData(data);

	// ant script browse button
	fAntScriptBrowseButton= new Button(composite, SWT.PUSH);
	fAntScriptBrowseButton.setText(FatJarPackagerMessages.FatJarPackageWizardPage_antScriptLocationBrowse_text);
	fAntScriptBrowseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	SWTUtil.setButtonDimensionHint(fAntScriptBrowseButton);
	fAntScriptBrowseButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			handleAntScriptBrowseButtonPressed();
		}
	});
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:39,
代码来源:FatJarPackageWizardPage.java

示例25: addSuperClassConstructorChoices

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
Composite addSuperClassConstructorChoices(Composite composite) {
	Label label= new Label(composite, SWT.NONE);
	label.setText(ActionMessages.GenerateConstructorUsingFieldsSelectionDialog_sort_constructor_choices_label);
	GridData gd= new GridData(GridData.FILL_HORIZONTAL);
	label.setLayoutData(gd);

	BindingLabelProvider provider= new BindingLabelProvider();
	final Combo combo= new Combo(composite, SWT.READ_ONLY);
	SWTUtil.setDefaultVisibleItemCount(combo);
	for (int i= 0; i < fSuperConstructors.length; i++) {
		combo.add(provider.getText(fSuperConstructors[i]));
	}

	// TODO: Can we be a little more intelligent about guessing the super() ?
	combo.setText(combo.getItem(0));
	combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	combo.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(SelectionEvent e) {
			fSuperIndex= combo.getSelectionIndex();
			// Disable omit super checkbox unless default constructor
			fOmitSuperButton.setEnabled(getSuperConstructorChoice().getParameterTypes().length == 0);
			updateOKStatus();
		}
	});

	return composite;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:30,
代码来源:GenerateConstructorUsingFieldsSelectionDialog.java

示例26: addOrderEntryChoices

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private Composite addOrderEntryChoices(Composite buttonComposite) {
	Label enterLabel= new Label(buttonComposite, SWT.NONE);
	enterLabel.setText(ActionMessages.SourceActionDialog_enterAt_label);
	if (!fEnableInsertPosition)
		enterLabel.setEnabled(false);
	GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	enterLabel.setLayoutData(gd);

	final Combo enterCombo= new Combo(buttonComposite, SWT.READ_ONLY);
	SWTUtil.setDefaultVisibleItemCount(enterCombo);
	if (!fEnableInsertPosition)
		enterCombo.setEnabled(false);
	fillWithPossibleInsertPositions(enterCombo);

	gd= new GridData(GridData.FILL_BOTH);
	gd.widthHint= convertWidthInCharsToPixels(fWidth);
	enterCombo.setLayoutData(gd);
	enterCombo.addSelectionListener(new SelectionAdapter(){
		@Override
		public void widgetSelected(SelectionEvent e) {
			int index= enterCombo.getSelectionIndex();
			// Add persistence only if first or last method: http://bugs.eclipse.org/bugs/show_bug.cgi?id=38400
			setInsertPosition(index);
			fHasUserChangedPositionIndex= true;
		}
	});

	return buttonComposite;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:30,
代码来源:SourceActionDialog.java

示例27: doCreateTreeViewer

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
@Override
protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
	FilteredTree tree= new FilteredTreeWithFilter(parent, style, fInitialFilter, fIsDeepFiltering);
	tree.setLayoutData(new GridData(GridData.FILL_BOTH));

	applyDialogFont(tree);

	TreeViewer viewer= tree.getViewer();
	SWTUtil.setAccessibilityText(viewer.getControl(), Strings.removeMnemonicIndicator(getMessage()));
	return viewer;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:12,
代码来源:FilteredElementTreeSelectionDialog.java

示例28: createContents

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
public void createContents(int numColumns, Composite parent) {

            fPageBook= new PageBook(parent, SWT.NONE);
            fPageBook.setLayoutData(createGridData(numColumns, GridData.FILL_BOTH, SWT.DEFAULT));

            fJavaElementComponent.createContents(numColumns, fPageBook);
            fSyntaxComponent.createContents(numColumns, fPageBook);

            fSwitchCombo= new Combo(parent, SWT.READ_ONLY);
    		SWTUtil.setDefaultVisibleItemCount(fSwitchCombo);
            final GridData gd= createGridData(numColumns, GridData.HORIZONTAL_ALIGN_END, SWT.DEFAULT);
            fSwitchCombo.setLayoutData(gd);
            fSwitchCombo.setItems(fItems);
        }
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:15,
代码来源:WhiteSpaceTabPage.java

示例29: createButton

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private static Button createButton(Composite composite, String text, final int style) {
	final Button button= new Button(composite, SWT.PUSH);
	button.setFont(composite.getFont());
	button.setText(text);

	final GridData gd= new GridData(style);
	gd.widthHint= SWTUtil.getButtonWidthHint(button);
	button.setLayoutData(gd);
	return button;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:11,
代码来源:ProfileConfigurationBlock.java

示例30: createProfileCombo

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
private static Combo createProfileCombo(Composite composite, int span, int widthHint) {
	final GridData gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.horizontalSpan = span;
	gd.widthHint= widthHint;

	final Combo combo= new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY );
	combo.setFont(composite.getFont());
	SWTUtil.setDefaultVisibleItemCount(combo);
	combo.setLayoutData(gd);
	return combo;
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:12,
代码来源:ProfileConfigurationBlock.java

示例31: ComboPreference

点赞 2

import org.eclipse.jdt.internal.ui.util.SWTUtil; //导入依赖的package包/类
/**
 * Create a new ComboPreference.
 * @param composite The composite on which the SWT widgets are added.
 * @param numColumns The number of columns in the composite's GridLayout.
 * @param preferences The map to store the values.
 * @param key The key to store the values.
 * @param values An array of n elements indicating the values to store for each selection.
 * @param text The label text for this Preference.
 * @param items An array of n elements indicating the text to be written in the combo box.
 */
public ComboPreference(Composite composite, int numColumns,
						  Map<String, String> preferences, String key,
						  String [] values, String text, String [] items) {
    super(preferences, key);
    if (values == null || items == null || text == null)
        throw new IllegalArgumentException(FormatterMessages.ModifyDialogTabPage_error_msg_values_items_text_unassigned);
	fValues= values;
	fItems= items;
	createLabel(numColumns - 1, composite, text);
	fCombo= new Combo(composite, SWT.SINGLE | SWT.READ_ONLY);
	fCombo.setFont(composite.getFont());
	SWTUtil.setDefaultVisibleItemCount(fCombo);
	fCombo.setItems(items);

	int max= 0;
	for (int i= 0; i < items.length; i++)
	    if (items[i].length() > max) max= items[i].length();

	fCombo.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_FILL, fCombo.computeSize(SWT.DEFAULT, SWT.DEFAULT).x));

	updateWidget();

	fCombo.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			comboSelected(((Combo)e.widget).getSelectionIndex());
		}
	});
}
 

开发者ID:trylimits,
项目名称:Eclipse-Postfix-Code-Completion,
代码行数:40,
代码来源:ModifyDialogTabPage.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)