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

The following examples show how to use org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil#doDefaultLayout() . 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: JavaMethodFilterInputDialog.java    From jdt-codemining with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
	Composite composite= (Composite) super.createDialogArea(parent);

	Composite inner= new Composite(composite, SWT.NONE);
	LayoutUtil.doDefaultLayout(inner, new DialogField[] { fNameDialogField }, true, 0, 0);

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

	fNameDialogField.postSetFocusOnDialogField(parent.getDisplay());

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

	Composite composite= (Composite) super.createDialogArea(parent);

	Composite inner= new Composite(composite, SWT.NONE);
	inner.setLayoutData(new GridData(GridData.FILL_BOTH));
	inner.setFont(composite.getFont());

	LayoutUtil.doDefaultLayout(inner, new DialogField[] { fHistoryList }, true, 0, 0);
	LayoutUtil.setHeightHint(fHistoryList.getListControl(null), convertHeightInCharsToPixels(12));
	LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null));

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

	Composite composite= (Composite) super.createDialogArea(parent);

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

	inner.setLayoutData(new GridData(GridData.FILL_BOTH));

	LayoutUtil.doDefaultLayout(inner, new DialogField[] { fHistoryList }, true, 0, 0);
	LayoutUtil.setHeightHint(fHistoryList.getListControl(null), convertHeightInCharsToPixels(12));
	LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null));

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

	Composite composite= (Composite) super.createDialogArea(parent);

	Composite inner= new Composite(composite, SWT.NONE);
	inner.setLayoutData(new GridData(GridData.FILL_BOTH));
	inner.setFont(composite.getFont());

	LayoutUtil.doDefaultLayout(inner, new DialogField[] { fHistoryList, new Separator() }, true);
	LayoutUtil.setHeightHint(fHistoryList.getListControl(null), convertHeightInCharsToPixels(12));
	LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null));

	Composite additionalControls= new Composite(inner, SWT.NONE);
	additionalControls.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
	LayoutUtil.doDefaultLayout(additionalControls, new DialogField[] { fMaxEntriesField }, false);
	LayoutUtil.setHorizontalGrabbing(fMaxEntriesField.getTextControl(null));

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

	Composite inner= new Composite(composite, SWT.NONE);
	LayoutUtil.doDefaultLayout(inner, new DialogField[] { fNameDialogField }, true, 0, 0);

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

	fNameDialogField.postSetFocusOnDialogField(parent.getDisplay());

	applyDialogFont(composite);
	return composite;
}
 
Example 6
Source File: UserLibraryPreferencePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
	Composite composite= (Composite) super.createDialogArea(parent);
	DialogField[] fields;
	if (isSave()) {
		fields= new DialogField[] { fExportImportList, fLocationField };
	} else {
		fields= new DialogField[] { fLocationField, fExportImportList };
	}
	LayoutUtil.doDefaultLayout(composite, fields, true, SWT.DEFAULT, SWT.DEFAULT);
	fExportImportList.getListControl(null).setLayoutData(new GridData(GridData.FILL_BOTH));

	fLocationField.postSetFocusOnDialogField(parent.getDisplay());
	BidiUtils.applyBidiProcessing(fLocationField.getTextControl(parent), StructuredTextTypeHandlerFactory.FILE);

	Dialog.applyDialogFont(composite);

	if (isSave()) {
		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.CP_EXPORT_USER_LIBRARY);
	} else {
		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.CP_IMPORT_USER_LIBRARY);
	}

	return composite;
}
 
Example 7
Source File: RenameTypeWizardSimilarElementsPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
	final Composite composite= (Composite) super.createDialogArea(parent);
	LayoutUtil.doDefaultLayout(composite, new DialogField[] { fNameField }, true, SWT.DEFAULT, SWT.DEFAULT);
	fNameField.postSetFocusOnDialogField(parent.getDisplay());

	LayoutUtil.setWidthHint(fNameField.getLabelControl(null), convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH));
	Text text= fNameField.getTextControl(null);
	LayoutUtil.setHorizontalGrabbing(text);
	TextFieldNavigationHandler.install(text);

	Dialog.applyDialogFont(composite);
	return composite;
}
 
Example 8
Source File: CategoryFilterActionGroup.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite composite= (Composite) super.createDialogArea(parent);
	LayoutUtil.doDefaultLayout(composite, new DialogField[] { fCategoryList }, true, 5, 5);
	LayoutUtil.setHorizontalGrabbing(fCategoryList.getListControl(null));
	Dialog.applyDialogFont(composite);
	setHelpAvailable(false);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJavaHelpContextIds.VISIBLE_CATEGORIES_DIALOG);
	return composite;
}
 
Example 9
Source File: UserLibraryPreferencePage.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);
	LayoutUtil.doDefaultLayout(composite, new DialogField[] { fNameField, fIsSystemField }, true, SWT.DEFAULT, SWT.DEFAULT);
	fNameField.postSetFocusOnDialogField(parent.getDisplay());

	Dialog.applyDialogFont(composite);

	PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.CP_EDIT_USER_LIBRARY);

	return composite;
}
 
Example 10
Source File: UserLibraryPreferencePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	Composite composite= new Composite(parent, SWT.NONE);
	composite.setFont(parent.getFont());
	LayoutUtil.doDefaultLayout(composite, new DialogField[] { fLibraryList }, true);
	LayoutUtil.setHorizontalGrabbing(fLibraryList.getTreeControl(null));
	Dialog.applyDialogFont(composite);
	return composite;
}
 
Example 11
Source File: SourceContainerWorkbookPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Control getControl(Composite parent) {
	PixelConverter converter= new PixelConverter(parent);
	Composite composite= new Composite(parent, SWT.NONE);

	LayoutUtil.doDefaultLayout(composite, new DialogField[] { fFoldersList, fUseFolderOutputs , fOutputLocationField}, true, SWT.DEFAULT, SWT.DEFAULT);
	BidiUtils.applyBidiProcessing(fOutputLocationField.getTextControl(null), StructuredTextTypeHandlerFactory.FILE);
	LayoutUtil.setHorizontalGrabbing(fFoldersList.getTreeControl(null));

	int buttonBarWidth= converter.convertWidthInCharsToPixels(24);
	fFoldersList.setButtonsMinWidth(buttonBarWidth);

	fSWTControl= composite;

	// expand
	List<CPListElement> elements= fFoldersList.getElements();
	for (int i= 0; i < elements.size(); i++) {
		CPListElement elem= elements.get(i);
		IPath[] exclusionPatterns= (IPath[]) elem.getAttribute(CPListElement.EXCLUSION);
		IPath[] inclusionPatterns= (IPath[]) elem.getAttribute(CPListElement.INCLUSION);
		IPath output= (IPath) elem.getAttribute(CPListElement.OUTPUT);
		if (exclusionPatterns.length > 0 || inclusionPatterns.length > 0 || output != null) {
			fFoldersList.expandElement(elem, 3);
		}
	}
	return composite;
}
 
Example 12
Source File: UserLibraryWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void createControl(Composite parent) {
	Composite composite= new Composite(parent, SWT.NONE);
	composite.setFont(parent.getFont());

	LayoutUtil.doDefaultLayout(composite, new DialogField[] { fLibrarySelector }, true, SWT.DEFAULT, SWT.DEFAULT);
	LayoutUtil.setHorizontalGrabbing(fLibrarySelector.getListControl(null));
	Dialog.applyDialogFont(composite);
	setControl(composite);
}
 
Example 13
Source File: ClasspathOrderingWorkbookPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Control getControl(Composite parent) {
	PixelConverter converter= new PixelConverter(parent);

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

	LayoutUtil.doDefaultLayout(composite, new DialogField[] { fClassPathList }, true, SWT.DEFAULT, SWT.DEFAULT);
	LayoutUtil.setHorizontalGrabbing(fClassPathList.getListControl(null));

	int buttonBarWidth= converter.convertWidthInCharsToPixels(24);
	fClassPathList.setButtonsMinWidth(buttonBarWidth);

	return composite;
}
 
Example 14
Source File: VariableBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public Control createContents(Composite parent) {
	Composite composite= new Composite(parent, SWT.NONE);
	composite.setFont(parent.getFont());

	LayoutUtil.doDefaultLayout(composite, new DialogField[] { fVariablesList }, true, 0, 0);
	LayoutUtil.setHorizontalGrabbing(fVariablesList.getListControl(null));

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

	fControl= composite;
	updateDeprecationWarning();

	return composite;
}
 
Example 15
Source File: LibrariesWorkbookPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public Control getControl(Composite parent) {
	PixelConverter converter= new PixelConverter(parent);

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

	LayoutUtil.doDefaultLayout(composite, new DialogField[] { fLibrariesList }, true, SWT.DEFAULT, SWT.DEFAULT);
	LayoutUtil.setHorizontalGrabbing(fLibrariesList.getTreeControl(null));

	int buttonBarWidth= converter.convertWidthInCharsToPixels(24);
	fLibrariesList.setButtonsMinWidth(buttonBarWidth);

	fLibrariesList.setViewerComparator(new CPListElementSorter());

	fSWTControl= composite;

	return composite;
}
 
Example 16
Source File: ProjectsWorkbookPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public Control getControl(Composite parent) {
	PixelConverter converter= new PixelConverter(parent);

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

	LayoutUtil.doDefaultLayout(composite, new DialogField[] { fProjectsList }, true, SWT.DEFAULT, SWT.DEFAULT);
	LayoutUtil.setHorizontalGrabbing(fProjectsList.getTreeControl(null));

	int buttonBarWidth= converter.convertWidthInCharsToPixels(24);
	fProjectsList.setButtonsMinWidth(buttonBarWidth);

	fSWTControl= composite;

	return composite;
}