Java Code Examples for org.eclipse.jface.dialogs.Dialog#applyDialogFont()

The following examples show how to use org.eclipse.jface.dialogs.Dialog#applyDialogFont() . 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: AbstractN4JSPreferencePage.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	Composite composite = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	composite.setLayout(layout);
	composite.setFont(parent.getFont());

	GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);

	configurationBlockControl = super.createContents(composite);
	configurationBlockControl.setLayoutData(data);

	if (isProjectPreferencePage()) {
		boolean useProjectSpecificSettings = hasProjectSpecificOptions();
		enableProjectSpecificSettings(useProjectSpecificSettings);
	}

	Dialog.applyDialogFont(composite);
	return composite;
}
 
Example 2
Source File: RenameTypeWizardSimilarElementsPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void createControl(Composite parent) {

		ViewForm viewForm= new ViewForm(parent, SWT.BORDER | SWT.FLAT);

		Composite inner= new Composite(viewForm, SWT.NULL);
		GridLayout layout= new GridLayout();
		inner.setLayout(layout);

		createTreeAndSourceViewer(inner);
		createButtonComposite(inner);
		viewForm.setContent(inner);

		setControl(viewForm);

		Dialog.applyDialogFont(viewForm);
		PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.RENAME_TYPE_WIZARD_PAGE);
	}
 
Example 3
Source File: PropertyAndPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	Composite composite = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	composite.setLayout(layout);
	composite.setFont(parent.getFont());

	GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);

	configurationBlockControl = createPreferenceContent(composite, getContainer());
	configurationBlockControl.setLayoutData(data);

	if (isProjectPreferencePage()) {
		boolean useProjectSettings = hasProjectSpecificOptions(getProject());
		enableProjectSpecificSettings(useProjectSettings);
	}

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

	final int nOfColumns= 4;

	initializeDialogUnits(ancestor);

	GridLayout layout= (GridLayout) parent.getLayout();
	layout.numColumns= nOfColumns;
	parent.setLayout(layout);

	createAccessorPart(parent, nOfColumns, convertWidthInCharsToPixels(40));

	Separator s= new Separator(SWT.SEPARATOR | SWT.HORIZONTAL);
	s.doFillIntoGrid(parent, nOfColumns);

	createPropertyPart(parent, nOfColumns, convertWidthInCharsToPixels(40));

	Dialog.applyDialogFont(parent);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJavaHelpContextIds.EXTERNALIZE_WIZARD_PROPERTIES_FILE_PAGE);
	validateAll();
	return parent;
}
 
Example 5
Source File: PropertyAndPreferenceFieldEditorPage.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
protected Control createContents(Composite parent)
{
	Composite composite = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	composite.setLayout(layout);
	composite.setFont(parent.getFont());

	GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);

	fConfigurationBlockControl = super.createContents(composite);
	fConfigurationBlockControl.setLayoutData(data);

	if (isProjectPreferencePage())
	{
		boolean useProjectSettings = hasProjectSpecificOptions(getProject());
		enableProjectSpecificSettings(useProjectSettings);
	}

	Dialog.applyDialogFont(composite);
	return composite;
}
 
Example 6
Source File: SyntaxColoringPreferencePage.java    From editorconfig-eclipse with Apache License 2.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	fOverlayStore.load();
	fOverlayStore.start();

	Composite contents = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	contents.setLayout(layout);
	contents.setLayoutData(new GridData(GridData.FILL_BOTH));

	createHeader(contents);

	createSyntaxPage(contents);

	initialize();

	Dialog.applyDialogFont(contents);
	return contents;
}
 
Example 7
Source File: MultipleInputDialog.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite)super.createDialogArea(parent);
	container.setLayout(new GridLayout(2, false));
	container.setLayoutData(new GridData(GridData.FILL_BOTH));
	
	panel = new Composite(container, SWT.NONE);
	GridLayout layout = new GridLayout(2, false);
	panel.setLayout(layout);
	panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	for (FieldSummary field : fieldList) {
		switch(field.type) {
			case TEXT:
				createTextField(field.name, field.initialValue, field.allowsEmpty);
				break;
			case BROWSE:
				createBrowseField(field.name, field.initialValue, field.allowsEmpty);
				break;
			case VARIABLE:
				createVariablesField(field.name, field.initialValue, field.allowsEmpty);
				break;
			case MULTILINE_VARIABLE:
				createMultilineVariablesField(field.name, field.initialValue, field.allowsEmpty);
				break;
			default:
				break;
		}
	}
	
	fieldList = null; // allow it to be gc'd
	Dialog.applyDialogFont(container);
	return container;
}
 
Example 8
Source File: ExtractMethodUserInputPage.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void createControl(Composite parent) {
	Composite result = new Composite(parent, SWT.NONE);
	setControl(result);
	GridLayout layout = new GridLayout(2, false);
	result.setLayout(layout);
	initializeDialogUnits(result);
	createNameField(result);
	createAccessModifierSection(result);
	createParameterControl(result);
	createAdditionalCheckboxes(result);
	createSeparator(result);
	createSignaturePreview(result);
	Dialog.applyDialogFont(result);
}
 
Example 9
Source File: SourceAttachmentPropertyPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createContents(Composite composite) {
	initializeDialogUnits(composite);
	Control result= createPageContent(composite);
	Dialog.applyDialogFont(result);
	return result;
}
 
Example 10
Source File: GamlQuickOutlinePopup.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected Text createFilterText(final Composite parent) {
	final Text filterText = new Text(parent, SWT.SEARCH | SWT.ICON_SEARCH);
	filterText.setMessage("Search keyword");
	Dialog.applyDialogFont(filterText);

	final GridData data = new GridData(GridData.FILL_HORIZONTAL);
	data.horizontalAlignment = GridData.FILL;
	data.verticalAlignment = GridData.CENTER;
	filterText.setLayoutData(data);

	filterText.addKeyListener(new KeyAdapter() {
		@Override
		public void keyPressed(final KeyEvent e) {
			if (e.keyCode == 0x0D) {
				gotoSelectedElement();
			}
			if (e.keyCode == SWT.ARROW_DOWN) {
				getTreeViewer().getTree().setFocus();
			}
			if (e.keyCode == SWT.ARROW_UP) {
				getTreeViewer().getTree().setFocus();
			}
			if (e.character == 0x1B) {
				dispose();
			}
		}
	});
	return filterText;
}
 
Example 11
Source File: JavaCapabilityConfigurationPage.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());
	composite.setLayout(new GridLayout(1, false));
	Control control= getBuildPathsBlock().createControl(composite);
	control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	Dialog.applyDialogFont(composite);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.NEW_JAVAPROJECT_WIZARD_PAGE);
	setControl(composite);
}
 
Example 12
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 13
Source File: CallbackDialog.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea ( final Composite parent )
{
    final Composite wrapper = (Composite)super.createDialogArea ( parent );

    initializeDialogUnits ( wrapper );
    final Composite contents = createComposite ( wrapper );
    contents.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );
    Dialog.applyDialogFont ( wrapper );

    return wrapper;
}
 
Example 14
Source File: NewUiBinderWizardPage.java    From gwt-eclipse-plugin 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);
  composite.setFont(parent.getFont());

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

  createContainerControls(composite, nColumns);
  createPackageControls(composite, nColumns);

  createSeparator(composite, nColumns);

  createTypeNameControls(composite, nColumns);
  createUiTypeControls(composite, nColumns);

  createSampleContentControls(composite, nColumns);

  createCommentControls(composite, nColumns);
  enableCommentControl(true);

  setControl(composite);

  Dialog.applyDialogFont(composite);
}
 
Example 15
Source File: FieldAssistPreferencePage.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Creates the field editors. Field editors are abstractions of the common
 * GUI blocks needed to manipulate various types of preferences. Each field
 * editor knows how to save and
 * 
 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
 */
protected void createFieldEditors( )
{
	addField( new BooleanFieldEditor( PreferenceConstants.PREF_SHOWREQUIREDFIELDLABELINDICATOR,
			Messages.getString( "ssPreferencesShowRequiredFieldLabelIndicator" ), //$NON-NLS-1$
			getFieldEditorParent( ) ) );

	Group g = new Group( getFieldEditorParent( ), SWT.NONE );
	g.setText( Messages.getString( "ssPreferencesAssistSymbol" ) ); //$NON-NLS-1$
	GridData gd = new GridData( GridData.FILL_HORIZONTAL );
	g.setLayoutData( gd );

	addField( new RadioGroupFieldEditor( PreferenceConstants.PREF_DECORATOR_VERTICALLOCATION,
			Messages.getString( "ssPreferencesDecoratorVert" ), //$NON-NLS-1$
			1,
			new String[][]{
					{
							Messages.getString( "ssPreferencesDecoratorTop" ), //$NON-NLS-1$
							PreferenceConstants.PREF_DECORATOR_VERTICALLOCATION_TOP
					},
					{
							Messages.getString( "ssPreferencesDecoratorCenter" ), //$NON-NLS-1$
							PreferenceConstants.PREF_DECORATOR_VERTICALLOCATION_CENTER
					},
					{
							Messages.getString( "ssPreferencesDecoratorBottom" ), //$NON-NLS-1$
							PreferenceConstants.PREF_DECORATOR_VERTICALLOCATION_BOTTOM
					}
			},
			g ) );

	addField( new RadioGroupFieldEditor( PreferenceConstants.PREF_DECORATOR_HORIZONTALLOCATION,
			Messages.getString( "ssPreferencesDecoratorHorz" ), //$NON-NLS-1$
			1,
			new String[][]{
					{
							Messages.getString( "ssPreferencesDecoratorLeft" ), //$NON-NLS-1$
							PreferenceConstants.PREF_DECORATOR_HORIZONTALLOCATION_LEFT
					},
					{
							Messages.getString( "ssPreferencesDecoratorRight" ), //$NON-NLS-1$
							PreferenceConstants.PREF_DECORATOR_HORIZONTALLOCATION_RIGHT
					}
			},
			g ) );

	IntegerFieldEditor editor = new IntegerFieldEditor( PreferenceConstants.PREF_DECORATOR_MARGINWIDTH,
			Messages.getString( "ssPreferencesDecoratorMargin" ), //$NON-NLS-1$
			g );
	editor.setValidRange( 0, 10 );
	addField( editor );

	g.setLayout( new GridLayout( ) );

	Dialog.applyDialogFont( getFieldEditorParent( ) );
}
 
Example 16
Source File: RenameInputWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void createControl(Composite parent) {
	Composite superComposite= new Composite(parent, SWT.NONE);
	setControl(superComposite);
	initializeDialogUnits(superComposite);
	superComposite.setLayout(new GridLayout());
	Composite composite= new Composite(superComposite, SWT.NONE);
	composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

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

	composite.setLayout(layout);
	RowLayouter layouter= new RowLayouter(2);

	Label label= new Label(composite, SWT.NONE);
	label.setText(getLabelText());

	Text text= createTextInputField(composite);
	text.selectAll();
	GridData gd= new GridData(GridData.FILL_HORIZONTAL);
	gd.widthHint= convertWidthInCharsToPixels(25);
	text.setLayoutData(gd);

	layouter.perform(label, text, 1);

	Label separator= new Label(composite, SWT.NONE);
	GridData gridData= new GridData(SWT.FILL, SWT.FILL, false, false);
	gridData.heightHint= 2;
	separator.setLayoutData(gridData);


	int indent= LayoutUtil.getIndent();

	addOptionalUpdateReferencesCheckbox(composite, layouter);
	addAdditionalOptions(composite, layouter);
	addOptionalUpdateTextualMatches(composite, layouter);
	addOptionalUpdateQualifiedNameComponent(composite, layouter, indent);
	addOptionalLeaveDelegateCheckbox(composite, layouter);
	addOptionalDeprecateDelegateCheckbox(composite, layouter, indent);
	updateForcePreview();

	Dialog.applyDialogFont(superComposite);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), fHelpContextID);
}
 
Example 17
Source File: NativeLibrariesPropertyPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected Control createContents(Composite parent) {
	if (!fIsValidElement || fIsReadOnly) {
		Composite inner= new Composite(parent, SWT.NONE);
		
		if (fIsReadOnly) {
			GridLayout layout= new GridLayout();
			layout.marginWidth= 0;
			inner.setLayout(layout);

			Label label= new Label(inner, SWT.WRAP);
			label.setText(PreferencesMessages.NativeLibrariesPropertyPage_location_path);
			
			Text location= new Text(inner, SWT.READ_ONLY | SWT.WRAP);
			SWTUtil.fixReadonlyTextBackground(location);
			GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
			gd.widthHint= convertWidthInCharsToPixels(80);
			location.setLayoutData(gd);
			String locationPath= PreferencesMessages.NativeLibrariesPropertyPage_locationPath_none;
			if (fEntry != null) {
				String nativeLibrariesPath= getNativeLibrariesPath(fEntry);
				if (nativeLibrariesPath != null)
					locationPath= nativeLibrariesPath;
			}
			location.setText(locationPath);
			Dialog.applyDialogFont(inner);
		}
		return inner;
	}

	IJavaElement elem= getJavaElement();
	if (elem == null)
		return new Composite(parent, SWT.NONE);

	fInitialNativeLibPath= getNativeLibrariesPath(fEntry);
	fConfigurationBlock= new NativeLibrariesConfigurationBlock(this, getShell(), fInitialNativeLibPath, fEntry);
	Control control= fConfigurationBlock.createContents(parent);

	Dialog.applyDialogFont(control);
	return control;
}
 
Example 18
Source File: WizardFolderImportPage.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
/**
 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
 */
public void createControl(Composite parent)
{
	// Collect the existing project names to avoid conflicts.
	IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
	projectsNames = new HashSet<String>();
	for (IProject project : projects)
	{
		projectsNames.add(project.getName());
	}
	modifyListener = new InputModifyListener();
	initializeDialogUnits(parent);

	Composite workArea = new Composite(parent, SWT.NONE);
	setControl(workArea);

	workArea.setLayout(new GridLayout());
	workArea.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));

	createProjectsRoot(workArea);

	Dialog.applyDialogFont(workArea);
	fLabelProvider = new NaturesLabelProvider(fNatureDescriptions);

	Label l = new Label(workArea, SWT.NONE);
	l.setText(EplMessages.WizardFolderImportPage_project_type_title);

	natureContributors = PrimaryNaturesManager.getManager().getContributorsMap();

	Composite tableComposite = new Composite(workArea, SWT.NONE);
	tableComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create());
	tableComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

	// Table for project natures
	fTableViewer = CheckboxTableViewer.newCheckList(tableComposite, SWT.TOP | SWT.BORDER);
	Table table = fTableViewer.getTable();
	table.setLinesVisible(true);
	table.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

	TableColumn column = new TableColumn(table, SWT.LEFT);
	column.setWidth(350);

	fTableViewer.setContentProvider(getContentProvider());
	fTableViewer.setLabelProvider(getLabelProvider());
	fTableViewer.setComparator(getViewerComperator());
	fTableViewer.setInput(ResourcesPlugin.getWorkspace());
	fTableViewer.addCheckStateListener(this);
	fTableViewer.addSelectionChangedListener(new ISelectionChangedListener()
	{
		public void selectionChanged(SelectionChangedEvent event)
		{
			updateButtons();
		}
	});
	table.setMenu(createMenu(table));

	// Add the buttons
	Composite buttons = new Composite(tableComposite, SWT.NONE);
	buttons.setLayout(GridLayoutFactory.fillDefaults().create());
	buttons.setLayoutData(GridDataFactory.fillDefaults().grab(false, true).create());
	fMakePrimaryButton = createButton(EplMessages.WizardFolderImportPage_make_primary_label, buttons);
	updateButtons();

	setPageComplete(false);
	setPrimaryNatureFromContributions(null);
	fTableViewer.setCheckedElements(new String[] { fPrimaryNature });

	if (!StringUtil.isEmpty(directoryPath))
	{
		directoryPathField.setText(directoryPath);
		setProjectName();
		setPageComplete(true);
	}
}
 
Example 19
Source File: NewAnnotationWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 3 votes vote down vote up
public void createControl(Composite parent) {
	initializeDialogUnits(parent);

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

	int nColumns= 4;

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

	createContainerControls(composite, nColumns);
	createPackageControls(composite, nColumns);
	createEnclosingTypeControls(composite, nColumns);

	createSeparator(composite, nColumns);

	createTypeNameControls(composite, nColumns);
	createModifierControls(composite, nColumns);

	createCommentControls(composite, nColumns);
	enableCommentControl(true);

	setControl(composite);

	Dialog.applyDialogFont(composite);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.NEW_ANNOTATION_WIZARD_PAGE);
}
 
Example 20
Source File: NewInterfaceWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 3 votes vote down vote up
public void createControl(Composite parent) {
	initializeDialogUnits(parent);

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

	int nColumns= 4;

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

	createContainerControls(composite, nColumns);
	createPackageControls(composite, nColumns);
	createEnclosingTypeControls(composite, nColumns);

	createSeparator(composite, nColumns);

	createTypeNameControls(composite, nColumns);
	createModifierControls(composite, nColumns);

	createSuperInterfacesControls(composite, nColumns);

	createCommentControls(composite, nColumns);
	enableCommentControl(true);

	setControl(composite);

	Dialog.applyDialogFont(composite);
	PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.NEW_INTERFACE_WIZARD_PAGE);
}