Example usage for org.eclipse.jface.resource JFaceResources DIALOG_FONT

List of usage examples for org.eclipse.jface.resource JFaceResources DIALOG_FONT

Introduction

In this page you can find the example usage for org.eclipse.jface.resource JFaceResources DIALOG_FONT.

Prototype

String DIALOG_FONT

To view the source code for org.eclipse.jface.resource JFaceResources DIALOG_FONT.

Click Source Link

Document

The symbolic font name for the dialog font (value "org.eclipse.jface.dialogfont").

Usage

From source file:net.tourbook.ui.views.tourSegmenter.TourSegmenterView.java

License:Open Source License

@Override
public void createPartControl(final Composite parent) {

    _parent = parent;// w  w w  .  j  a  v  a  2 s .  com
    _pc = new PixelConverter(parent);
    _spinnerWidth = _pc.convertWidthInCharsToPixels(_isOSX ? 10 : 5);
    _boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);

    setMaxDistanceSpinner();

    // define all columns
    _columnManager = new ColumnManager(this, _state);
    _columnManager.setIsCategoryAvailable(true);
    defineAllColumns(parent);

    createUI(parent);
    createActions();
    fillToolbar();

    addSelectionListener();
    addPartListener();
    addPrefListener();
    addTourEventListener();

    // tell the site that this view is a selection provider
    getSite().setSelectionProvider(_postSelectionProvider = new PostSelectionProvider(ID));

    _pageBookUI.showPage(_pageNoData);

    restoreState();
    enableActions();

    showTour();
}

From source file:org.apache.directory.studio.connection.ui.widgets.AuthenticationParameterPage.java

License:Apache License

protected ExpandableComposite createExpandableSection(Composite parent, String label, int nColumns) {
    ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE,
            ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
    excomposite.setText(label);/* ww  w.  j a  v  a  2s  . co m*/
    excomposite.setExpanded(false);
    excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
    excomposite.addExpansionListener(new ExpansionAdapter() {
        /**
         * {@inheritDoc}
         */
        @Override
        public void expansionStateChanged(ExpansionEvent event) {
            ExpandableComposite excomposite = (ExpandableComposite) event.getSource();
            excomposite.getParent().setSize(excomposite.getParent().computeSize(SWT.DEFAULT, SWT.DEFAULT));
        }
    });

    return excomposite;
}

From source file:org.codehaus.groovy.eclipse.dsl.inferencing.suggestions.ui.AbstractDialogue.java

License:Apache License

protected Font getRequiredParameterFont() {
    return JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);
}

From source file:org.codehaus.groovy.eclipse.preferences.ScriptFolderSelectorPreferences.java

License:Apache License

public ListDialogField createListContents() {
    Label label = new Label(parent, SWT.WRAP);
    label.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
    label.setText("Groovy Script Folders:");
    label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));

    Composite inner = new Composite(parent, SWT.BORDER);
    inner.setFont(parent.getFont());/*from ww w  . j a v  a  2s.c om*/
    GridLayout layout = new GridLayout();
    layout.marginHeight = 3;
    layout.marginWidth = 3;
    layout.numColumns = 1;
    inner.setLayout(layout);
    inner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    disableButton = new BooleanFieldEditor(Activator.GROOVY_SCRIPT_FILTERS_ENABLED,
            "Enable script folder support", BooleanFieldEditor.DEFAULT, inner);

    disableButton.setPreferenceStore(store);
    disableButton.load();

    // inner composite contains the dialog itself
    final Composite innerInner = new Composite(inner, SWT.NONE);
    innerInner.setFont(parent.getFont());
    layout = new GridLayout();
    layout.marginHeight = 3;
    layout.marginWidth = 3;
    layout.numColumns = 3;
    innerInner.setLayout(layout);
    innerInner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    innerInner.setToolTipText("CHECKED boxes are COPIED to output folder.\nUNCHECKED boxes are NOT copied.");
    boolean enabled = disableButton.getBooleanValue();
    innerInner.setEnabled(enabled);

    // enable/disable pattern list based
    disableButton.setPropertyChangeListener(new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            if (event.getProperty() == FieldEditor.VALUE) {
                Object o = event.getNewValue();
                if (o instanceof Boolean) {
                    boolean enabled = ((Boolean) o);
                    innerInner.setEnabled(enabled);
                    for (Control c : innerInner.getChildren()) {
                        c.setEnabled(enabled);
                    }
                }
            }
        }
    });

    ScriptPatternAdapter adapter = new ScriptPatternAdapter();

    patternList = new CheckedListDialogField(adapter, buttonLabels, new ScriptLabelProvider(DESCRIPTOR));
    patternList.setDialogFieldListener(adapter);
    patternList.setLabelText("Groovy files that match these patterns are treated as scripts.  "
            + "They will not be compiled and will be copied as-is to the output folder.\n\n"
            + "CHECKED boxes will be COPIED to the output folder.  UNCHECKED boxes are NOT copied to the output folder.");
    patternList.setRemoveButtonIndex(IDX_REMOVE);
    patternList.enableButton(IDX_EDIT, false);
    patternList.setCheckAllButtonIndex(IDX_CHECKALL);
    patternList.setUncheckAllButtonIndex(IDX_UNCHECKALL);

    patternList.doFillIntoGrid(innerInner, 3);
    Label l = patternList.getLabelControl(innerInner);
    GridData gd = new GridData(SWT.FILL, SWT.TOP, true, false);
    gd.widthHint = 200;
    l.setLayoutData(gd);

    resetElements();
    patternList.enableButton(IDX_ADD, true);
    patternList.setViewerComparator(new ViewerComparator());

    // finally force greying out of tree if required
    innerInner.setEnabled(enabled);
    for (Control c : innerInner.getChildren()) {
        c.setEnabled(enabled);
    }

    return patternList;
}

From source file:org.cs3.pdt.editor.internal.contentassistant.PredicateCompletionProposal.java

License:Open Source License

@Override
public IInformationControl createInformationControl(Shell parent) {
    if (BrowserInformationControl.isAvailable(parent)) {
        return new BrowserInformationControl(parent, JFaceResources.DIALOG_FONT, true) {
            @Override//from  w w w. ja v a2  s  .co m
            public IInformationControlCreator getInformationPresenterControlCreator() {
                return PredicateCompletionProposal.this;
            }
        };
    } else {
        return new DefaultInformationControl(parent);
    }
}

From source file:org.eclipse.buildship.ui.external.viewer.FilteredTree.java

License:Open Source License

/**
 * Return a bold font if the given element matches the given pattern. Clients can opt to call
 * this method from a Viewer's label provider to get a bold font for which to highlight the
 * given element in the tree./*from  w ww .  j a  va2s. co  m*/
 *
 * @param element element for which a match should be determined
 * @param tree FilteredTree in which the element resides
 * @param filter PatternFilter which determines a match
 *
 * @return bold font
 */
public static Font getBoldFont(Object element, FilteredTree tree, PatternFilter filter) {
    String filterText = tree.getFilterString();

    if (filterText == null) {
        return null;
    }

    // Do nothing if it's empty string
    String initialText = tree.getInitialText();
    if (!filterText.equals("") && !filterText.equals(initialText)) {//$NON-NLS-1$
        if (tree.getPatternFilter() != filter) {
            boolean initial = initialText != null && initialText.equals(filterText);
            if (initial) {
                filter.setPattern(null);
            } else if (filterText != null) {
                filter.setPattern(filterText);
            }
        }
        if (filter.isElementVisible(tree.getViewer(), element)
                && filter.isLeafMatch(tree.getViewer(), element)) {
            return JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);
        }
    }
    return null;
}

From source file:org.eclipse.cdt.internal.ui.language.LanguageMappingWidget.java

License:Open Source License

public LanguageMappingWidget() {
    fOverriddenFont = JFaceResources.getFontRegistry().getItalic(JFaceResources.DIALOG_FONT);
    fOverriddenContentTypes = Collections.emptySet();

    // keep a mapping of all registered content types and their names
    fContentTypeNamesToIDsMap = new HashMap<String, String>();
    String[] contentTypesIDs = LanguageManager.getInstance().getRegisteredContentTypeIds();

    IContentTypeManager contentTypeManager = Platform.getContentTypeManager();

    for (int i = 0; i < contentTypesIDs.length; i++) {

        String name = contentTypeManager.getContentType(contentTypesIDs[i]).getName();

        // keep track of what ID this name corresponds to so that when we
        // setup the mapping
        // later based upon user selection, we'll know what ID to use
        fContentTypeNamesToIDsMap.put(name, contentTypesIDs[i]);
    }//w ww .j  a va2 s  .  c  o  m

    fAffectedContentTypes = new HashSet<IContentType>();
}

From source file:org.eclipse.cdt.internal.ui.preferences.OptionsConfigurationBlock.java

License:Open Source License

protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) {
    ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE,
            ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
    excomposite.setText(label);//from   w  ww. j a  v a2 s . com
    excomposite.setExpanded(false);
    excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
    excomposite.addExpansionListener(new ExpansionAdapter() {
        @Override
        public void expansionStateChanged(ExpansionEvent e) {
            expandedStateChanged((ExpandableComposite) e.getSource());
        }
    });
    fExpandedComposites.add(excomposite);
    makeScrollableCompositeAware(excomposite);
    return excomposite;
}

From source file:org.eclipse.cdt.internal.ui.search.CSearchPage.java

License:Open Source License

/**
 * Creates a composite with a highlighted Note entry and a message text.
 * This is designed to take up the full width of the page.<br>
 * This method has been copied from class {@link PreferencePage}
 * //from w  ww .java2 s .c o m
 * @param font the font to use
 * @param composite the parent composite
 * @param title the title of the note
 * @param message the message for the note
 * @return the composite for the note
 */
protected Composite createNoteComposite(Font font, Composite composite, String title, String message) {
    Composite messageComposite = new Composite(composite, SWT.NONE);
    GridLayout messageLayout = new GridLayout();
    messageLayout.numColumns = 2;
    messageLayout.marginWidth = 0;
    messageLayout.marginHeight = 0;
    messageComposite.setLayout(messageLayout);
    messageComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    messageComposite.setFont(font);

    final Label noteLabel = new Label(messageComposite, SWT.BOLD);
    noteLabel.setText(title);
    noteLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    noteLabel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));

    Label messageLabel = new Label(messageComposite, SWT.WRAP);
    messageLabel.setText(message);
    messageLabel.setFont(font);
    return messageComposite;
}

From source file:org.eclipse.compare.internal.patch.PreviewPatchPage2.java

License:Open Source License

private void buildPatchOptionsGroup(final Form form) {
    Composite parent = form.getBody();

    patchOptions = fToolkit.createExpandableComposite(parent,
            ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
    patchOptions.setText(PatchMessages.PreviewPatchPage_PatchOptions_title);
    patchOptions.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    patchOptions.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
    patchOptions.addExpansionListener(new ExpansionAdapter() {
        public void expansionStateChanged(ExpansionEvent e) {
            form.layout();/*from  w w w. jav  a 2s  .c o m*/
        }
    });

    Composite c = new Composite(patchOptions, SWT.NONE);
    patchOptions.setClient(c);
    patchOptions.setExpanded(true);
    GridLayout gl = new GridLayout();
    gl.numColumns = 3;
    c.setLayout(gl);
    c.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));

    // 1st row
    createStripSegmentCombo(c);
    createShowMatchedToggle(c);
    createFuzzFactorChooser(c);

    // 2nd row
    createReversePatchToggle(c);
    createShowRemovedToggle(c);
    createGenerateRejectsToggle(c);

    // register listeners
    final WorkspacePatcher patcher = getPatcher();
    if (fStripPrefixSegments != null)
        fStripPrefixSegments.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                if (patcher.getStripPrefixSegments() != getStripPrefixSegments()) {
                    if (promptToRebuild(PatchMessages.PreviewPatchPage2_4)) {
                        if (patcher.setStripPrefixSegments(getStripPrefixSegments()))
                            rebuildTree();
                    }
                }
            }
        });

    fFuzzField.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            if (patcher.getFuzz() != getFuzzFactor()) {
                if (promptToRebuild(PatchMessages.PreviewPatchPage2_5)) {
                    if (patcher.setFuzz(getFuzzFactor()))
                        rebuildTree();
                } else {
                    fFuzzField.setText(Integer.toString(patcher.getFuzz()));
                }
            }
        }
    });
}