org.eclipse.jdt.internal.ui.util.SWTUtil Java Examples

The following examples show how to use org.eclipse.jdt.internal.ui.util.SWTUtil. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PullUpMemberPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
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));
	}
}
 
Example #2
Source File: FixedFatJarExportPage.java    From sarl with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example #3
Source File: SelectionButtonDialogField.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@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 };
}
 
Example #4
Source File: OptionsConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
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;
}
 
Example #5
Source File: ResourceTransferDragAdapter.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
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();
	}
}
 
Example #6
Source File: FatJarPackageWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
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);
}
 
Example #7
Source File: JarManifestWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #8
Source File: PullUpMethodPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
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();
		}
	});
}
 
Example #9
Source File: ChangeParametersControl.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
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;
}
 
Example #10
Source File: GenerateConstructorUsingFieldsSelectionDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #11
Source File: ModuleSelectionDialogButtonField.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #12
Source File: OutputLocationDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
	Composite composite= (Composite)super.createDialogArea(parent);

	int widthHint= convertWidthInCharsToPixels(70);
	int indent= convertWidthInCharsToPixels(4);

	Composite inner= new Composite(composite, SWT.NONE);
	GridLayout layout= new GridLayout();
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	layout.numColumns= 2;
	inner.setLayout(layout);

	fUseDefault.doFillIntoGrid(inner, 2);
	fUseSpecific.doFillIntoGrid(inner, 2);

	Text textControl= fContainerDialogField.getTextControl(inner);
	GridData textData= new GridData();
	textData.widthHint= widthHint;
	textData.grabExcessHorizontalSpace= true;
	textData.horizontalIndent= indent;
	textControl.setLayoutData(textData);

	Button buttonControl= fContainerDialogField.getChangeControl(inner);
	GridData buttonData= new GridData();
	buttonData.widthHint= SWTUtil.getButtonWidthHint(buttonControl);
	buttonControl.setLayoutData(buttonData);

	applyDialogFont(composite);
	return composite;
}
 
Example #13
Source File: StringButtonDialogField.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected 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;
}
 
Example #14
Source File: TreeListDialogField.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected Button createButton(Composite parent, String label, SelectionListener listener) {
	Button button= new Button(parent, SWT.PUSH);
	button.setFont(parent.getFont());
	button.setText(label);
	button.addSelectionListener(listener);
	GridData gd= new GridData();
	gd.horizontalAlignment= GridData.FILL;
	gd.grabExcessHorizontalSpace= true;
	gd.verticalAlignment= GridData.BEGINNING;
	gd.widthHint= SWTUtil.getButtonWidthHint(button);

	button.setLayoutData(gd);
	return button;
}
 
Example #15
Source File: ListDialogField.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected Button createButton(Composite parent, String label, SelectionListener listener) {
	Button button= new Button(parent, SWT.PUSH);
	button.setFont(parent.getFont());
	button.setText(label);
	button.addSelectionListener(listener);
	GridData gd= new GridData();
	gd.horizontalAlignment= GridData.FILL;
	gd.grabExcessHorizontalSpace= true;
	gd.verticalAlignment= GridData.BEGINNING;
	gd.widthHint = SWTUtil.getButtonWidthHint(button);

	button.setLayoutData(gd);

	return button;
}
 
Example #16
Source File: ChangeParametersControl.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #17
Source File: ModifyDialogTabPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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());
		}
	});
}
 
Example #18
Source File: ProfileConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #19
Source File: ProfileConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #20
Source File: WhiteSpaceTabPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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);
        }
 
Example #21
Source File: FilteredElementTreeSelectionDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@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;
}
 
Example #22
Source File: ExternalizeWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #23
Source File: ChangeExceptionsControl.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #24
Source File: ComboSelectionDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@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;
}
 
Example #25
Source File: JavadocTreeWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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();
	}
 
Example #26
Source File: JavadocTreeWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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();
			}
		});
	}
 
Example #27
Source File: JavadocWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #28
Source File: CleanUpRegistry.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #29
Source File: JarOptionsPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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();
		}
	});
}
 
Example #30
Source File: ExternalizeWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}