Example usage for org.eclipse.jface.dialogs Dialog applyDialogFont

List of usage examples for org.eclipse.jface.dialogs Dialog applyDialogFont

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs Dialog applyDialogFont.

Prototype

public static void applyDialogFont(Control control) 

Source Link

Document

Applies the dialog font to all controls that currently have the default font.

Usage

From source file:de.walware.statet.r.internal.ui.wizards.RPkgProjectWizardPage.java

License:Open Source License

@Override
public void createControl(final Composite parent) {
    initializeDialogUnits(parent);/*from   www  . j  a v a 2s.c o  m*/

    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(LayoutUtil.createContentGrid(1));

    {
        final Composite group = createRPkgGroup(composite);
        group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    }

    Dialog.applyDialogFont(composite);
    setControl(composite);

    final Realm realm = Realm.getDefault();
    fDbc = new DataBindingContext(realm);
    addBindings(fDbc, realm);
    WizardPageSupport.create(this, fDbc);
}

From source file:de.walware.statet.r.launching.ui.REnvTab.java

License:Open Source License

@Override
public void createControl(final Composite parent) {
    final Composite mainComposite = new Composite(parent, SWT.NONE);
    setControl(mainComposite);/*  www.ja  v  a 2  s.c o  m*/
    mainComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    mainComposite.setLayout(GridLayoutFactory.swtDefaults().create());

    Group group;
    group = new Group(mainComposite, SWT.NONE);
    group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    group.setText(RLaunchingMessages.REnv_Tab_REnvConfig_label + ':');
    group.setLayout(LayoutUtil.createGroupGrid(1));
    if (fLocal) {
        fREnvControl = new REnvSelectionComposite(group) {
            @Override
            protected boolean isValid(IREnvConfiguration rEnvConfig) {
                return super.isValid(rEnvConfig) && rEnvConfig.isLocal();
            }
        };
    } else {
        fREnvControl = new REnvSelectionComposite(group, true);
    }
    fREnvControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    if (fWithWD) {
        fWorkingDirectoryControl = new ResourceInputComposite(mainComposite,
                ResourceInputComposite.STYLE_GROUP | ResourceInputComposite.STYLE_TEXT,
                ResourceInputComposite.MODE_DIRECTORY | ResourceInputComposite.MODE_OPEN,
                RLaunchingMessages.REnv_Tab_WorkingDir_label);
        fWorkingDirectoryControl.setShowInsertVariable(true, DialogUtil.DEFAULT_INTERACTIVE_FILTERS, null);
        fWorkingDirectoryControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    }

    Dialog.applyDialogFont(parent);
    initBindings();
}

From source file:descent.internal.ui.preferences.AbstractConfigurationBlockPreferencePage.java

License:Open Source License

protected Control createContents(Composite parent) {

    fOverlayStore.load();//from   ww  w  .j a  v  a2 s. c  o  m
    fOverlayStore.start();

    Control content = fConfigurationBlock.createControl(parent);

    initialize();

    Dialog.applyDialogFont(content);
    return content;
}

From source file:descent.internal.ui.preferences.AppearancePreferencePage.java

License:Open Source License

protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);/*from  ww  w. j a  v a  2 s.co  m*/
    int nColumns = 1;

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

    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.numColumns = nColumns;
    result.setLayout(layout);

    fShowMethodReturnType.doFillIntoGrid(result, nColumns);
    fShowMethodTypeParameters.doFillIntoGrid(result, nColumns);
    fShowCategory.doFillIntoGrid(result, nColumns);
    fShowMembersInPackageView.doFillIntoGrid(result, nColumns);
    fFoldPackagesInPackageExplorer.doFillIntoGrid(result, nColumns);

    new Separator().doFillIntoGrid(result, nColumns);

    fCompressPackageNames.doFillIntoGrid(result, nColumns);
    fPackageNamePattern.doFillIntoGrid(result, 2);
    LayoutUtil.setHorizontalGrabbing(fPackageNamePattern.getTextControl(null));
    LayoutUtil.setWidthHint(fPackageNamePattern.getLabelControl(null), convertWidthInCharsToPixels(65));

    new Separator().doFillIntoGrid(result, nColumns);
    fStackBrowsingViewsVertically.doFillIntoGrid(result, nColumns);

    String noteTitle = PreferencesMessages.AppearancePreferencePage_note;
    String noteMessage = PreferencesMessages.AppearancePreferencePage_preferenceOnlyEffectiveForNewPerspectives;
    Composite noteControl = createNoteComposite(JFaceResources.getDialogFont(), result, noteTitle, noteMessage);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 2;
    noteControl.setLayoutData(gd);

    initFields();

    Dialog.applyDialogFont(result);
    return result;
}

From source file:descent.internal.ui.preferences.BuildPathsPropertyPage.java

License:Open Source License

protected Control createContents(Composite parent) {
    // ensure the page has no special buttons
    noDefaultAndApplyButton();/*  ww w .  j  a  va2s . co m*/

    IProject project = getProject();
    Control result;
    if (project == null || !isJavaProject(project)) {
        result = createWithoutJava(parent);
    } else if (!project.isOpen()) {
        result = createForClosedProject(parent);
    } else {
        result = createWithJava(parent, project);
    }
    Dialog.applyDialogFont(result);
    return result;
}

From source file:descent.internal.ui.preferences.ClasspathVariablesPreferencePage.java

License:Open Source License

protected Control createContents(Composite parent) {
    Control result = fVariableBlock.createContents(parent);
    Dialog.applyDialogFont(result);
    return result;
}

From source file:descent.internal.ui.preferences.FoldingConfigurationBlock.java

License:Open Source License

void updateListDependencies() {
    String id = fStore.getString(PreferenceConstants.EDITOR_FOLDING_PROVIDER);
    JavaFoldingStructureProviderDescriptor desc = (JavaFoldingStructureProviderDescriptor) fProviderDescriptors
            .get(id);//from  ww w .  ja va  2s . c  o m
    IJavaFoldingPreferenceBlock prefs;

    if (desc == null) {
        // safety in case there is no such descriptor
        String message = Messages.format(PreferencesMessages.FoldingConfigurationBlock_error_not_exist, id);
        JavaPlugin.log(new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, null));
        prefs = new ErrorPreferences(message);
    } else {
        prefs = (IJavaFoldingPreferenceBlock) fProviderPreferences.get(id);
        if (prefs == null) {
            try {
                prefs = desc.createPreferences();
                fProviderPreferences.put(id, prefs);
            } catch (CoreException e) {
                JavaPlugin.log(e);
                prefs = new ErrorPreferences(e.getLocalizedMessage());
            }
        }
    }

    Control control = (Control) fProviderControls.get(id);
    if (control == null) {
        control = prefs.createControl(fGroup);
        if (control == null) {
            String message = PreferencesMessages.FoldingConfigurationBlock_info_no_preferences;
            control = new ErrorPreferences(message).createControl(fGroup);
        } else {
            fProviderControls.put(id, control);
        }
    }
    Dialog.applyDialogFont(control);
    fStackLayout.topControl = control;
    control.pack();
    fGroup.layout();
    fGroup.getParent().layout();

    prefs.initialize();
}

From source file:descent.internal.ui.preferences.JavaBasePreferencePage.java

License:Open Source License

protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);/*from w w  w  .  ja v  a2s .co m*/

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    result.setLayout(layout);

    // new Label(composite, SWT.NONE); // spacer
    // Group linkSettings= new Group(result, SWT.NONE);
    // linkSettings.setLayout(new GridLayout());
    // linkSettings.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    // linkSettings.setText(PreferencesMessages.getString("JavaBasePreferencePage.linkSettings.text")); //$NON-NLS-1$
    //addCheckBox(linkSettings, PreferencesMessages.getString("JavaBasePreferencePage.linkJavaBrowsingViewsCheckbox.text"), LINK_BROWSING_VIEW_TO_EDITOR); //$NON-NLS-1$
    //addCheckBox(linkSettings, PreferencesMessages.getString("JavaBasePreferencePage.linkPackageView"), LINK_PACKAGES_TO_EDITOR); //$NON-NLS-1$
    //addCheckBox(linkSettings, PreferencesMessages.getString("JavaBasePreferencePage.linkTypeHierarchy"), LINK_TYPEHIERARCHY_TO_EDITOR); //$NON-NLS-1$

    // new Label(result, SWT.NONE); // spacer

    Group doubleClickGroup = new Group(result, SWT.NONE);
    doubleClickGroup.setLayout(new GridLayout());
    doubleClickGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    doubleClickGroup.setText(PreferencesMessages.JavaBasePreferencePage_doubleclick_action);
    addRadioButton(doubleClickGroup, PreferencesMessages.JavaBasePreferencePage_doubleclick_gointo,
            DOUBLE_CLICK, DOUBLE_CLICK_GOES_INTO);
    addRadioButton(doubleClickGroup, PreferencesMessages.JavaBasePreferencePage_doubleclick_expand,
            DOUBLE_CLICK, DOUBLE_CLICK_EXPANDS);

    // new Label(result, SWT.NONE); // spacer

    Group typeHierarchyGroup = new Group(result, SWT.NONE);
    typeHierarchyGroup.setLayout(new GridLayout());
    typeHierarchyGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    typeHierarchyGroup.setText(PreferencesMessages.JavaBasePreferencePage_openTypeHierarchy);
    addRadioButton(typeHierarchyGroup, PreferencesMessages.JavaBasePreferencePage_inPerspective,
            OPEN_TYPE_HIERARCHY, OPEN_TYPE_HIERARCHY_IN_PERSPECTIVE);
    addRadioButton(typeHierarchyGroup, PreferencesMessages.JavaBasePreferencePage_inView, OPEN_TYPE_HIERARCHY,
            OPEN_TYPE_HIERARCHY_IN_VIEW_PART);

    Group refactoringGroup = new Group(result, SWT.NONE);
    refactoringGroup.setLayout(new GridLayout());
    refactoringGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    refactoringGroup.setText(PreferencesMessages.JavaBasePreferencePage_refactoring_title);
    addCheckBox(refactoringGroup, PreferencesMessages.JavaBasePreferencePage_refactoring_auto_save,
            RefactoringSavePreferences.PREF_SAVE_ALL_EDITORS);

    Group group = new Group(result, SWT.NONE);
    group.setLayout(new GridLayout());
    group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    group.setText(PreferencesMessages.JavaBasePreferencePage_search);

    addCheckBox(group, PreferencesMessages.JavaBasePreferencePage_search_small_menu,
            PreferenceConstants.SEARCH_USE_REDUCED_MENU);

    layout = new GridLayout();
    layout.numColumns = 2;

    Group dontAskGroup = new Group(result, SWT.NONE);
    dontAskGroup.setLayout(layout);
    dontAskGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    dontAskGroup.setText(PreferencesMessages.JavaBasePreferencePage_dialogs);

    Label label = new Label(dontAskGroup, SWT.WRAP);
    label.setText(PreferencesMessages.JavaBasePreferencePage_do_not_hide_description);
    GridData data = new GridData(GridData.FILL, GridData.CENTER, true, false);
    data.widthHint = convertVerticalDLUsToPixels(50);
    label.setLayoutData(data);

    Button clearButton = new Button(dontAskGroup, SWT.PUSH);
    clearButton.setText(PreferencesMessages.JavaBasePreferencePage_do_not_hide_button);
    clearButton.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
    clearButton.addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent e) {
            unhideAllDialogs();
        }

        public void widgetDefaultSelected(SelectionEvent e) {
            unhideAllDialogs();
        }
    });

    SWTUtil.setButtonDimensionHint(clearButton);
    Dialog.applyDialogFont(result);
    return result;
}

From source file:descent.internal.ui.preferences.NewJavaProjectPreferencePage.java

License:Open Source License

protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);//from w  w w  .  j  av  a 2  s.  co m

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.numColumns = 2;
    result.setLayout(layout);

    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;

    Group sourceFolderGroup = new Group(result, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    sourceFolderGroup.setLayout(layout);
    sourceFolderGroup.setLayoutData(gd);
    sourceFolderGroup.setText(PreferencesMessages.NewJavaProjectPreferencePage_sourcefolder_label);

    int indent = 0;

    fProjectAsSourceFolder = addRadioButton(sourceFolderGroup,
            PreferencesMessages.NewJavaProjectPreferencePage_sourcefolder_project, SRCBIN_FOLDERS_IN_NEWPROJ,
            IPreferenceStore.FALSE, indent);
    fProjectAsSourceFolder.addSelectionListener(fSelectionListener);

    fFoldersAsSourceFolder = addRadioButton(sourceFolderGroup,
            PreferencesMessages.NewJavaProjectPreferencePage_sourcefolder_folder, SRCBIN_FOLDERS_IN_NEWPROJ,
            IPreferenceStore.TRUE, indent);
    fFoldersAsSourceFolder.addSelectionListener(fSelectionListener);

    indent = convertWidthInCharsToPixels(4);

    fSrcFolderNameLabel = new Label(sourceFolderGroup, SWT.NONE);
    fSrcFolderNameLabel.setText(PreferencesMessages.NewJavaProjectPreferencePage_folders_src);
    fSrcFolderNameText = addTextControl(sourceFolderGroup, fSrcFolderNameLabel, SRCBIN_SRCNAME, indent);
    fSrcFolderNameText.addModifyListener(fModifyListener);

    fBinFolderNameLabel = new Label(sourceFolderGroup, SWT.NONE);
    fBinFolderNameLabel.setText(PreferencesMessages.NewJavaProjectPreferencePage_folders_bin);
    fBinFolderNameText = addTextControl(sourceFolderGroup, fBinFolderNameLabel, SRCBIN_BINNAME, indent);
    fBinFolderNameText.addModifyListener(fModifyListener);

    String[] jreNames = getJRENames();
    if (jreNames.length > 0) {
        Label jreSelectionLabel = new Label(result, SWT.NONE);
        jreSelectionLabel.setText(PreferencesMessages.NewJavaProjectPreferencePage_jrelibrary_label);
        jreSelectionLabel.setLayoutData(new GridData());

        int index = getPreferenceStore().getInt(CLASSPATH_JRELIBRARY_INDEX);
        fJRECombo = new Combo(result, SWT.READ_ONLY);
        fJRECombo.setItems(jreNames);
        fJRECombo.select(index);
        fJRECombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    }

    validateFolders();

    Dialog.applyDialogFont(result);
    return result;
}

From source file:descent.internal.ui.preferences.ProjectSelectionDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    // page group
    Composite composite = (Composite) super.createDialogArea(parent);

    Font font = parent.getFont();
    composite.setFont(font);/*from   w w  w  .  ja v a 2s. com*/

    createMessageArea(composite);

    fTableViewer = new TableViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
            doSelectionChanged(((IStructuredSelection) event.getSelection()).toArray());
        }
    });
    fTableViewer.addDoubleClickListener(new IDoubleClickListener() {
        public void doubleClick(DoubleClickEvent event) {
            okPressed();
        }
    });
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.heightHint = SIZING_SELECTION_WIDGET_HEIGHT;
    data.widthHint = SIZING_SELECTION_WIDGET_WIDTH;
    fTableViewer.getTable().setLayoutData(data);

    fTableViewer.setLabelProvider(new JavaElementLabelProvider());
    fTableViewer.setContentProvider(new StandardJavaElementContentProvider());
    fTableViewer.setSorter(new JavaElementSorter());
    fTableViewer.getControl().setFont(font);

    Button checkbox = new Button(composite, SWT.CHECK);
    checkbox.setText(PreferencesMessages.ProjectSelectionDialog_filter);
    checkbox.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false));
    checkbox.addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent e) {
            updateFilter(((Button) e.widget).getSelection());
        }

        public void widgetDefaultSelected(SelectionEvent e) {
            updateFilter(((Button) e.widget).getSelection());
        }
    });
    IDialogSettings dialogSettings = JavaPlugin.getDefault().getDialogSettings();
    boolean doFilter = !dialogSettings.getBoolean(DIALOG_SETTINGS_SHOW_ALL)
            && !fProjectsWithSpecifics.isEmpty();
    checkbox.setSelection(doFilter);
    updateFilter(doFilter);

    IJavaModel input = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
    fTableViewer.setInput(input);

    doSelectionChanged(new Object[0]);
    Dialog.applyDialogFont(composite);
    return composite;
}