Java Code Examples for org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil#setHorizontalSpan()

The following examples show how to use org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil#setHorizontalSpan() . 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: SetFilterWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void createControl(Composite parent) {
	Composite inner= new Composite(parent, SWT.NONE);
	inner.setFont(parent.getFont());

	GridLayout layout= new GridLayout();
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	layout.numColumns= 2;
	inner.setLayout(layout);
	inner.setLayoutData(new GridData(GridData.FILL_BOTH));

	fInclusionPatternList.doFillIntoGrid(inner, 3);
	LayoutUtil.setHorizontalSpan(fInclusionPatternList.getLabelControl(null), 2);
	LayoutUtil.setHorizontalGrabbing(fInclusionPatternList.getListControl(null));

	fExclusionPatternList.doFillIntoGrid(inner, 3);
	LayoutUtil.setHorizontalSpan(fExclusionPatternList.getLabelControl(null), 2);
	LayoutUtil.setHorizontalGrabbing(fExclusionPatternList.getListControl(null));

	setControl(inner);
	Dialog.applyDialogFont(inner);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(inner, IJavaHelpContextIds.INCLUSION_EXCLUSION_WIZARD_PAGE);
}
 
Example 2
Source File: CodeTemplateBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	fPixelConverter=  new PixelConverter(parent);

	setShell(parent.getShell());

	Composite composite=  new Composite(parent, SWT.NONE);
	composite.setFont(parent.getFont());

	GridLayout layout= new GridLayout();
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	layout.numColumns= 2;
	composite.setLayout(layout);

	fCodeTemplateTree.doFillIntoGrid(composite, 3);
	LayoutUtil.setHorizontalSpan(fCodeTemplateTree.getLabelControl(null), 2);
	LayoutUtil.setHorizontalGrabbing(fCodeTemplateTree.getTreeControl(null));

	fPatternViewer= createViewer(composite, 2);

	fGenerateComments.doFillIntoGrid(composite, 2);

	return composite;
}
 
Example 3
Source File: JavaMethodFiltersTable.java    From jdt-codemining with Eclipse Public License 1.0 6 votes vote down vote up
public void createControl(Composite parent) {
	Composite composite = new Composite(parent, SWT.NONE);
	composite.setFont(parent.getFont());

	GridLayout layout = new GridLayout();
	layout.numColumns = 2;
	layout.marginWidth = 0;
	layout.marginHeight = 0;

	composite.setLayout(layout);

	fFilterListField.doFillIntoGrid(composite, 3);
	LayoutUtil.setHorizontalSpan(fFilterListField.getLabelControl(null), 2);
	// LayoutUtil.setWidthHint(fFilterListField.getLabelControl(null),
	// convertWidthInCharsToPixels(40));
	LayoutUtil.setHorizontalGrabbing(fFilterListField.getListControl(null));

	fFilterListField.getTableViewer().setComparator(new ViewerComparator());

}
 
Example 4
Source File: CodeAssistFavoritesConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void createFavoriteList(Composite parent) {
	String[] buttonLabels= new String[] {
			PreferencesMessages.CodeAssistStaticMembersConfigurationBlock_newType_button,
			PreferencesMessages.CodeAssistStaticMembersConfigurationBlock_newMember_button,
			PreferencesMessages.CodeAssistStaticMembersConfigurationBlock_edit_button,
			PreferencesMessages.CodeAssistStaticMembersConfigurationBlock_remove_button
	};

	ListAdapter adapter= new ListAdapter();

	fList= new ListDialogField<String>(adapter, buttonLabels, new ListLabelProvider());
	fList.setDialogFieldListener(adapter);
	fList.setLabelText(PreferencesMessages.CodeAssistStaticMembersConfigurationBlock_description);
	fList.setRemoveButtonIndex(IDX_REMOVE);
	fList.enableButton(IDX_EDIT, false);
	fList.setViewerComparator(new ViewerComparator());

	PixelConverter pixelConverter= new PixelConverter(parent);

	fList.doFillIntoGrid(parent, 3);
	LayoutUtil.setHorizontalSpan(fList.getLabelControl(null), 2);
	LayoutUtil.setWidthHint(fList.getLabelControl(null), pixelConverter.convertWidthInCharsToPixels(60));
	LayoutUtil.setHorizontalGrabbing(fList.getListControl(null));
}
 
Example 5
Source File: ImportOrganizeInputDialog.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);
	initializeDialogUnits(parent);

	GridLayout layout= (GridLayout) composite.getLayout();
	layout.numColumns= 2;

	fNameDialogField.doFillIntoGrid(composite, 3);

	LayoutUtil.setHorizontalSpan(fNameDialogField.getLabelControl(null), 2);

	int fieldWidthHint= convertWidthInCharsToPixels(60);
	Text text= fNameDialogField.getTextControl(null);
	LayoutUtil.setWidthHint(text, fieldWidthHint);
	LayoutUtil.setHorizontalGrabbing(text);
	BidiUtils.applyBidiProcessing(text, StructuredTextTypeHandlerFactory.JAVA);
	TextFieldNavigationHandler.install(text);

	DialogField.createEmptySpace(composite, 1);
	fBrowseTypeButton.doFillIntoGrid(composite, 1);

	fNameDialogField.postSetFocusOnDialogField(parent.getDisplay());

	applyDialogFont(composite);
	return composite;
}
 
Example 6
Source File: AddSourceFolderWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void doFillIntoGrid(Composite parent, int numColumns) {
	fLinkLocation.doFillIntoGrid(parent, numColumns);

	LayoutUtil.setHorizontalSpan(fLinkLocation.getLabelControl(null), numColumns);
	LayoutUtil.setHorizontalGrabbing(fLinkLocation.getTextControl(null));
	BidiUtils.applyBidiProcessing(fLinkLocation.getTextControl(null), StructuredTextTypeHandlerFactory.FILE);

	fVariables.doFillIntoGrid(parent, 1);
}
 
Example 7
Source File: ExclusionInclusionEntryDialog.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(60);

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

	Label description= new Label(inner, SWT.WRAP);

	if (fIsExclusion) {
		description.setText(NewWizardMessages.ExclusionInclusionEntryDialog_exclude_description);
	} else {
		description.setText(NewWizardMessages.ExclusionInclusionEntryDialog_include_description);
	}
	GridData gd= new GridData();
	gd.horizontalSpan= 2;
	gd.widthHint= convertWidthInCharsToPixels(80);
	description.setLayoutData(gd);

	fExclusionPatternDialog.doFillIntoGrid(inner, 3);

	LayoutUtil.setWidthHint(fExclusionPatternDialog.getLabelControl(null), widthHint);
	LayoutUtil.setHorizontalSpan(fExclusionPatternDialog.getLabelControl(null), 2);

	LayoutUtil.setWidthHint(fExclusionPatternDialog.getTextControl(null), widthHint);
	LayoutUtil.setHorizontalGrabbing(fExclusionPatternDialog.getTextControl(null));

	fExclusionPatternDialog.postSetFocusOnDialogField(parent.getDisplay());
	applyDialogFont(composite);
	return composite;
}
 
Example 8
Source File: ExclusionInclusionDialog.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);

	Composite inner= new Composite(composite, SWT.NONE);
	inner.setFont(parent.getFont());

	GridLayout layout= new GridLayout();
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	layout.numColumns= 2;
	inner.setLayout(layout);
	inner.setLayoutData(new GridData(GridData.FILL_BOTH));

	DialogField labelField= new DialogField();
	labelField.setLabelText(Messages.format(NewWizardMessages.ExclusionInclusionDialog_description, BasicElementLabels.getPathLabel(fCurrElement.getPath(), false)));
	labelField.doFillIntoGrid(inner, 2);

	fInclusionPatternList.doFillIntoGrid(inner, 3);
	LayoutUtil.setHorizontalSpan(fInclusionPatternList.getLabelControl(null), 2);
	LayoutUtil.setHorizontalGrabbing(fInclusionPatternList.getListControl(null));

	fExclusionPatternList.doFillIntoGrid(inner, 3);
	LayoutUtil.setHorizontalSpan(fExclusionPatternList.getLabelControl(null), 2);
	LayoutUtil.setHorizontalGrabbing(fExclusionPatternList.getListControl(null));

	applyDialogFont(composite);
	return composite;
}
 
Example 9
Source File: NewVariableEntryDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
	initializeDialogUnits(parent);

	Composite composite= (Composite) super.createDialogArea(parent);
	GridLayout layout= (GridLayout) composite.getLayout();
	layout.numColumns= 2;

	fVariablesList.doFillIntoGrid(composite, 3);

	LayoutUtil.setHorizontalSpan(fVariablesList.getLabelControl(null), 2);

	GridData listData= (GridData) fVariablesList.getListControl(null).getLayoutData();
	listData.grabExcessHorizontalSpace= true;
	listData.heightHint= convertHeightInCharsToPixels(10);
	listData.widthHint= convertWidthInCharsToPixels(70);

	fWarning= new CLabel(composite, SWT.NONE);
	fWarning.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, fVariablesList.getNumberOfControls() - 1, 1));

	Composite lowerComposite= new Composite(composite, SWT.NONE);
	lowerComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

	layout= new GridLayout();
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	lowerComposite.setLayout(layout);

	fConfigButton.doFillIntoGrid(lowerComposite, 1);

	applyDialogFont(composite);
	return composite;
}
 
Example 10
Source File: EditVariableEntryDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
	initializeDialogUnits(parent);
	Composite composite= (Composite) super.createDialogArea(parent);

	GridLayout layout= (GridLayout) composite.getLayout();
	layout.numColumns= 3;

	int widthHint= convertWidthInCharsToPixels(50);

	GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gd.horizontalSpan= 3;

	// archive name field
	fFileNameField.doFillIntoGrid(composite, 4);
	LayoutUtil.setHorizontalSpan(fFileNameField.getLabelControl(null), 3);
	LayoutUtil.setWidthHint(fFileNameField.getTextControl(null), widthHint);
	LayoutUtil.setHorizontalGrabbing(fFileNameField.getTextControl(null));

	// label that shows the resolved path for variable jars
	//DialogField.createEmptySpace(composite, 1);
	fFullPathResolvedLabel= new CLabel(composite, SWT.LEFT);
	fFullPathResolvedLabel.setText(getResolvedLabelString());
	fFullPathResolvedLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	DialogField.createEmptySpace(composite, 2);


	fFileNameField.postSetFocusOnDialogField(parent.getDisplay());

	PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.SOURCE_ATTACHMENT_BLOCK);
	applyDialogFont(composite);
	return composite;
}
 
Example 11
Source File: AddSourceFolderWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void createControl(Composite parent) {
	initializeDialogUnits(parent);

	Composite composite= new Composite(parent, SWT.NONE);

	GridLayout layout= new GridLayout();
	layout.numColumns= 4;
	composite.setLayout(layout);

	if (fLinkedMode) {
		fLinkFields.doFillIntoGrid(composite, layout.numColumns);
		fRootDialogField.doFillIntoGrid(composite, layout.numColumns - 1);
	} else {
		fRootDialogField.doFillIntoGrid(composite, layout.numColumns - 1);
	}

	if (fAllowRemoveProjectFolder)
		fRemoveProjectFolder.doFillIntoGrid(composite, layout.numColumns);

	if (fAllowAddExclusionPatterns)
		fAddExclusionPatterns.doFillIntoGrid(composite, layout.numColumns);

	if (fAllowConflict)
		fIgnoreConflicts.doFillIntoGrid(composite, layout.numColumns);

	LayoutUtil.setHorizontalSpan(fRootDialogField.getLabelControl(null), layout.numColumns);
	LayoutUtil.setHorizontalGrabbing(fRootDialogField.getTextControl(null));

	setControl(composite);
	Dialog.applyDialogFont(composite);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.NEW_PACKAGEROOT_WIZARD_PAGE);
}
 
Example 12
Source File: TypeFilterPreferencePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	initializeDialogUnits(parent);

	Composite composite= new Composite(parent, SWT.NONE);
	composite.setFont(parent.getFont());

	GridLayout layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginWidth= 0;
	layout.marginHeight= 0;

	composite.setLayout(layout);

	fFilterListField.doFillIntoGrid(composite, 3);
	LayoutUtil.setHorizontalSpan(fFilterListField.getLabelControl(null), 2);
	LayoutUtil.setWidthHint(fFilterListField.getLabelControl(null), convertWidthInCharsToPixels(40));
	LayoutUtil.setHorizontalGrabbing(fFilterListField.getListControl(null));

	fFilterListField.getTableViewer().setComparator(new ViewerComparator());
	
	Label spacer= new Label(composite, SWT.LEFT );
	GridData gd= new GridData(SWT.DEFAULT, convertHeightInCharsToPixels(1) / 2);
	gd.horizontalSpan= 2;
	spacer.setLayoutData(gd);
	
	String label= PreferencesMessages.TypeFilterPreferencePage_restricted_link;
	Map<String, String> targetInfo= new java.util.HashMap<String, String>(2);
	targetInfo.put(ProblemSeveritiesPreferencePage.DATA_SELECT_OPTION_KEY,	JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE);
	targetInfo.put(ProblemSeveritiesPreferencePage.DATA_SELECT_OPTION_QUALIFIER, JavaCore.PLUGIN_ID);
	createPreferencePageLink(composite, label, targetInfo);
	
	fHideForbiddenField.doFillIntoGrid(composite, 2);
	fHideDiscouragedField.doFillIntoGrid(composite, 2);

	Dialog.applyDialogFont(composite);
	return composite;
}
 
Example 13
Source File: ExpandWithConstructorsConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create a list dialog field.
 *
 * @param parent the composite
 */
private void createPreferenceList(Composite parent) {
	String[] buttonLabels= new String[] {
			CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_newType_button,
			CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_newMember_button,
			CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_edit_button,
			CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_remove_button,
			CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_restoreDefaults_button
	};

	ListAdapter adapter= new ListAdapter();

	fList= new ListDialogField<String>(adapter, buttonLabels, new ListLabelProvider());
	fList.setDialogFieldListener(adapter);
	fList.setLabelText(CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_description);
	fList.setRemoveButtonIndex(IDX_REMOVE);
	fList.enableButton(IDX_EDIT, false);
	fList.setViewerComparator(new ViewerComparator());

	PixelConverter pixelConverter= new PixelConverter(parent);

	fList.doFillIntoGrid(parent, 3);
	LayoutUtil.setHorizontalSpan(fList.getLabelControl(null), 2);
	LayoutUtil.setWidthHint(fList.getLabelControl(null), pixelConverter.convertWidthInCharsToPixels(60));
	LayoutUtil.setHorizontalGrabbing(fList.getListControl(null));

	Control listControl= fList.getListControl(null);
	GridData gd= (GridData)listControl.getLayoutData();
	gd.verticalAlignment= GridData.FILL;
	gd.grabExcessVerticalSpace= true;
	gd.heightHint= pixelConverter.convertHeightInCharsToPixels(10);
}
 
Example 14
Source File: AbstractNewSarlElementWizardPage.java    From sarl with Apache License 2.0 5 votes vote down vote up
/** Create the controls related to the behavior units to generate.
 *
 * @param composite the container of the controls.
 * @param columns the number of columns.
 * @param enableConstructors indicates if the constructor creation is enable.
 * @param enableInherited indicates if the inherited operation creation is enable.
 * @param defaultEvents indicates if the default events will be generated.
 * @param lifecycleFunctions indicates if the default lifecycle functions will be generated.
 */
protected void createMethodStubControls(Composite composite, int columns,
		boolean enableConstructors, boolean enableInherited, boolean defaultEvents,
		boolean lifecycleFunctions) {
	this.isConstructorCreationEnabled = enableConstructors;
	this.isInheritedCreationEnabled = enableInherited;
	this.isDefaultEventGenerated = defaultEvents;
	this.isDefaultLifecycleFunctionsGenerated = lifecycleFunctions;
	final List<String> nameList = new ArrayList<>(4);
	if (enableConstructors) {
		nameList.add(Messages.AbstractNewSarlElementWizardPage_0);
	}
	if (enableInherited) {
		nameList.add(Messages.AbstractNewSarlElementWizardPage_1);
	}
	if (defaultEvents) {
		nameList.add(Messages.AbstractNewSarlElementWizardPage_17);
	}
	if (lifecycleFunctions) {
		nameList.add(Messages.AbstractNewSarlElementWizardPage_18);
	}
	if (nameList.isEmpty()) {
		return;
	}
	final String[] buttonNames = new String[nameList.size()];
	nameList.toArray(buttonNames);

	this.methodStubsButtons = new SelectionButtonDialogFieldGroup(SWT.CHECK, buttonNames, 1);
	this.methodStubsButtons.setLabelText(Messages.AbstractNewSarlElementWizardPage_2);

	final Control labelControl = this.methodStubsButtons.getLabelControl(composite);
	LayoutUtil.setHorizontalSpan(labelControl, columns);

	DialogField.createEmptySpace(composite);

	final Control buttonGroup = this.methodStubsButtons.getSelectionButtonsGroup(composite);
	LayoutUtil.setHorizontalSpan(buttonGroup, columns - 1);
}
 
Example 15
Source File: NewClassWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void createMethodStubSelectionControls(Composite composite, int nColumns) {
	Control labelControl= fMethodStubsButtons.getLabelControl(composite);
	LayoutUtil.setHorizontalSpan(labelControl, nColumns);

	DialogField.createEmptySpace(composite);

	Control buttonGroup= fMethodStubsButtons.getSelectionButtonsGroup(composite);
	LayoutUtil.setHorizontalSpan(buttonGroup, nColumns - 1);
}
 
Example 16
Source File: NewHostPageWizardPage.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
private void createPageElementsControls(Composite composite, int nColumns) {
  Control labelControl = hostPageElementsButtons.getLabelControl(composite);
  LayoutUtil.setHorizontalSpan(labelControl, nColumns);

  DialogField.createEmptySpace(composite);

  Control buttonGroup = hostPageElementsButtons.getSelectionButtonsGroup(composite);
  LayoutUtil.setHorizontalSpan(buttonGroup, nColumns - 1);
}
 
Example 17
Source File: NewEntryPointWizardPage.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
private void createMethodStubSelectionControls(Composite composite,
    int nColumns) {
  Control labelControl = methodStubsButtons.getLabelControl(composite);
  LayoutUtil.setHorizontalSpan(labelControl, nColumns);

  DialogField.createEmptySpace(composite);

  Control buttonGroup = methodStubsButtons.getSelectionButtonsGroup(composite);
  LayoutUtil.setHorizontalSpan(buttonGroup, nColumns - 1);
}
 
Example 18
Source File: NewXtendClassWizardPage.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
private void createMethodStubSelectionControls(Composite composite, int nColumns) {
	Control labelControl= fMethodStubsButtons.getLabelControl(composite);
	LayoutUtil.setHorizontalSpan(labelControl, nColumns);

	DialogField.createEmptySpace(composite);

	Control buttonGroup= fMethodStubsButtons.getSelectionButtonsGroup(composite);
	LayoutUtil.setHorizontalSpan(buttonGroup, nColumns - 1);
}
 
Example 19
Source File: PropertyAndPreferencePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected Label createDescriptionLabel(Composite parent) {
	fParentComposite= parent;
	if (isProjectPreferencePage()) {
		Composite composite= new Composite(parent, SWT.NONE);
		composite.setFont(parent.getFont());
		GridLayout layout= new GridLayout();
		layout.marginHeight= 0;
		layout.marginWidth= 0;
		layout.numColumns= 2;
		composite.setLayout(layout);
		composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

		IDialogFieldListener listener= new IDialogFieldListener() {
			public void dialogFieldChanged(DialogField field) {
				boolean enabled= ((SelectionButtonDialogField) field).isSelected();
				enableProjectSpecificSettings(enabled);

				if (enabled && getData() != null) {
					applyData(getData());
				}
			}
		};

		fUseProjectSettings= new SelectionButtonDialogField(SWT.CHECK);
		fUseProjectSettings.setDialogFieldListener(listener);
		fUseProjectSettings.setLabelText(PreferencesMessages.PropertyAndPreferencePage_useprojectsettings_label);
		fUseProjectSettings.doFillIntoGrid(composite, 1);
		LayoutUtil.setHorizontalGrabbing(fUseProjectSettings.getSelectionButton(null));

		if (offerLink()) {
			fChangeWorkspaceSettings= createLink(composite, PreferencesMessages.PropertyAndPreferencePage_useworkspacesettings_change);
			fChangeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
		} else {
			LayoutUtil.setHorizontalSpan(fUseProjectSettings.getSelectionButton(null), 2);
		}

		Label horizontalLine= new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
		horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
		horizontalLine.setFont(composite.getFont());
	} else if (supportsProjectSpecificOptions() && offerLink()) {
		fChangeWorkspaceSettings= createLink(parent, PreferencesMessages.PropertyAndPreferencePage_showprojectspecificsettings_label);
		fChangeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false));
	}

	return super.createDescriptionLabel(parent);
   }
 
Example 20
Source File: ImportOrganizeConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	setShell(parent.getShell());

	fPixelConverter= new PixelConverter(parent);

	Composite composite= new Composite(parent, SWT.NONE);
	composite.setFont(parent.getFont());

	GridLayout layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginWidth= 0;
	layout.marginHeight= 0;

	composite.setLayout(layout);

	fOrderListField.doFillIntoGrid(composite, 3);
	LayoutUtil.setHorizontalSpan(fOrderListField.getLabelControl(null), 2);
	LayoutUtil.setWidthHint(fOrderListField.getLabelControl(null), fPixelConverter.convertWidthInCharsToPixels(60));
	LayoutUtil.setHorizontalGrabbing(fOrderListField.getListControl(null));

	Composite importExportComp= new Composite(composite, SWT.NONE);
	importExportComp.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
	layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginWidth= 0;
	layout.marginHeight= 0;

	importExportComp.setLayout(layout);

	fImportButton.doFillIntoGrid(importExportComp, 1);
	fExportButton.doFillIntoGrid(importExportComp, 1);

	fThresholdField.doFillIntoGrid(composite, 2);
	((GridData) fThresholdField.getTextControl(null).getLayoutData()).grabExcessHorizontalSpace= false;
	fStaticThresholdField.doFillIntoGrid(composite, 2);
	fIgnoreLowerCaseTypesField.doFillIntoGrid(composite, 2);

	Dialog.applyDialogFont(composite);

	return composite;
}