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:com.siteview.mde.internal.ui.editor.contentassist.TypeCompletionProposal.java

License:Open Source License

public IInformationControlCreator getInformationControlCreator() {
    if (fCreator == null) {
        fCreator = new AbstractReusableInformationControlCreator() {

            /*/*from w  ww.  j  av a2 s .c  om*/
             * @see org.eclipse.jdt.internal.ui.text.java.hover.AbstractReusableInformationControlCreator#doCreateInformationControl(org.eclipse.swt.widgets.Shell)
             */
            public IInformationControl doCreateInformationControl(Shell parent) {
                if (BrowserInformationControl.isAvailable(parent))
                    return new BrowserInformationControl(parent, JFaceResources.DIALOG_FONT, false);
                return new DefaultInformationControl(parent, false);
            }
        };
    }
    return fCreator;
}

From source file:com.siteview.mde.internal.ui.editor.contentassist.XMLCompletionProposal.java

License:Open Source License

public IInformationControlCreator getInformationControlCreator() {
    if (fCreator == null) {
        fCreator = new AbstractReusableInformationControlCreator() {
            public IInformationControl doCreateInformationControl(Shell parent) {
                if (BrowserInformationControl.isAvailable(parent))
                    return new BrowserInformationControl(parent, JFaceResources.DIALOG_FONT, false);
                return new DefaultInformationControl(parent, false);
            }//from   w  w w.jav a2s .  co m
        };
    }
    return fCreator;
}

From source file:com.siteview.mde.internal.ui.nls.ExternalizeStringsLabelProvider.java

License:Open Source License

public Font getFont(Object element) {
    if (element instanceof ModelChangeElement) {
        ModelChangeElement changeElement = (ModelChangeElement) element;
        if (changeElement.isExternalized()) {
            return fFontRegistry.getBold(JFaceResources.DIALOG_FONT);
        }/* ww  w  .ja v a  2s.  c  o  m*/
    }
    return null;
}

From source file:com.siteview.mde.internal.ui.preferences.PDECompilersConfigurationBlock.java

License:Open Source License

/**
 * Creates an {@link ExpandableComposite} with a client composite and a default grid layout
 * @param parent// w  w w.  ja  v a2  s. c  om
 * @param title
 * @return a new expandable composite
 */
private Composite createExpansibleComposite(Composite parent, String title) {
    ExpandableComposite ecomp = SWTFactory.createExpandibleComposite(parent, title, 1,
            GridData.FILL_HORIZONTAL);
    ecomp.addExpansionListener(new ExpansionAdapter() {
        public void expansionStateChanged(ExpansionEvent e) {
            Object obj = e.getSource();
            handleExpand(getScrollingParent(obj));
        }
    });
    ecomp.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    fExpComps.add(ecomp);
    Composite client = SWTFactory.createComposite(ecomp, 2, 1, GridData.FILL_BOTH);
    ecomp.setClient(client);
    return client;
}

From source file:com.siteview.mde.internal.ui.SWTFactory.java

License:Open Source License

/**
 * Creates an ExpandibleComposite widget
 * //from  w ww  .  j a v a2s  . c o  m
 * @param parent the parent to add this widget to
 * @param style the style for ExpandibleComposite expanding handle, and layout
 * @param label the label for the widget
 * @param hspan how many columns to span in the parent
 * @param fill the fill style for the widget
 * Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code>
 * @return a new ExpandibleComposite widget
 */
public static ExpandableComposite createExpandibleComposite(Composite parent, String label, int hspan,
        int fill) {
    ExpandableComposite ex = new ExpandableComposite(parent, SWT.NONE,
            ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
    ex.setText(label);
    ex.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    GridData gd = new GridData(fill);
    gd.horizontalSpan = hspan;
    gd.grabExcessHorizontalSpace = true;
    ex.setLayoutData(gd);
    return ex;
}

From source file:com.toubassi.jface.ContextHintDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    Composite contents = new Composite(parent, SWT.NONE);

    contents.setLayout(new FormLayout());

    Composite infoComposite = new Composite(contents, SWT.NONE);
    FormData infoCompositeFormData = new FormData();
    infoCompositeFormData.left = new FormAttachment(0, 0);
    infoCompositeFormData.right = new FormAttachment(100, 0);
    infoCompositeFormData.top = new FormAttachment(0, 0);
    infoComposite.setLayoutData(infoCompositeFormData);
    infoComposite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));

    infoComposite.setLayout(new FormLayout());

    infoTitleLabel = new Label(infoComposite, SWT.NONE);
    FontRegistry fontRegistry = JFaceResources.getFontRegistry();
    infoTitleLabel.setFont(fontRegistry.getBold(JFaceResources.DIALOG_FONT));
    infoTitleLabel.setBackground(infoComposite.getBackground());

    if (infoTitle != null) {
        infoTitleLabel.setText(infoTitle);
    }/* ww w  .j  a  v a  2s. com*/
    FormData infoTitleLabelFormData = new FormData();
    infoTitleLabelFormData.top = new FormAttachment(0, 10);
    infoTitleLabelFormData.left = new FormAttachment(0, 15);

    Label topSeparator = new Label(contents, SWT.SEPARATOR | SWT.HORIZONTAL);
    FormData topSeparatorFormData = new FormData();
    topSeparatorFormData.top = new FormAttachment(infoComposite, 0);
    topSeparatorFormData.left = new FormAttachment(0, 0);
    topSeparatorFormData.right = new FormAttachment(100, 0);
    topSeparator.setLayoutData(topSeparatorFormData);

    Composite customContents = new Composite(contents, SWT.NONE);
    FormData customContentsFormData = new FormData();
    customContentsFormData.top = new FormAttachment(topSeparator, 20);
    customContentsFormData.left = new FormAttachment(0, 15);
    customContentsFormData.right = new FormAttachment(100, -15);
    customContents.setLayoutData(customContentsFormData);

    createCustomContents(customContents);

    if (controlHints.size() > 0) {
        infoDescription = new Label(infoComposite, SWT.WRAP);
        infoDescription.setBackground(infoComposite.getBackground());
    } else {
        infoTitleLabelFormData.width = 300;
        Composite spacer = new Composite(infoComposite, SWT.NONE);
        spacer.setBackground(infoComposite.getBackground());
        FormData spacerFormData = new FormData();
        spacerFormData.top = new FormAttachment(infoTitleLabel);
        spacerFormData.height = 15;
        spacer.setLayoutData(spacerFormData);
    }

    infoTitleLabel.setLayoutData(infoTitleLabelFormData);

    Label bottomSeparator = new Label(contents, SWT.SEPARATOR | SWT.HORIZONTAL);
    FormData bottomSeparatorFormData = new FormData();
    bottomSeparatorFormData.top = new FormAttachment(customContents, 5, SWT.BOTTOM);
    bottomSeparatorFormData.left = new FormAttachment(0, 0);
    bottomSeparatorFormData.right = new FormAttachment(100, 0);
    bottomSeparator.setLayoutData(bottomSeparatorFormData);

    if (infoDescription != null) {
        Point size = new Point(70, 0);
        ControlUtil.convertSizeInCharsToPixels(infoDescription, size);

        String longestHint = longestControlHint();
        Point infoSize = new Point(0, 0);
        if (longestHint != null) {
            infoDescription.setText(longestHint);
            infoSize = infoDescription.computeSize(size.x, SWT.DEFAULT);
            infoDescription.setText("");
        }

        if (controlHints.get(null) != null) {
            infoDescription.setText((String) controlHints.get(null));
        }

        FormData infoDescriptionFormData = new FormData();
        infoDescriptionFormData.top = new FormAttachment(infoTitleLabel, 10);
        infoDescriptionFormData.left = new FormAttachment(0, 25);
        infoDescriptionFormData.right = new FormAttachment(100, -15);
        infoDescriptionFormData.bottom = new FormAttachment(100, -15);
        infoDescriptionFormData.width = size.x;
        infoDescriptionFormData.height = infoSize.y;
        infoDescription.setLayoutData(infoDescriptionFormData);
    }

    return contents;
}

From source file:de.gebit.integrity.ui.contentassist.IntegrityConfigurableCompletionProposal.java

License:Open Source License

@Override
public IInformationControlCreator getInformationControlCreator() {
    if (useHtmlAdditionalProposalInfo) {
        return new IInformationControlCreator() {

            @Override//from  w w w .ja va2 s  . c  o  m
            public IInformationControl createInformationControl(Shell aParent) {
                if (BrowserInformationControl.isAvailable(aParent)) {
                    return new BrowserInformationControl(aParent, JFaceResources.DIALOG_FONT, true);
                } else {
                    return new DefaultInformationControl(aParent);
                }
            }
        };
    } else {
        // just use the default
        return super.getInformationControlCreator();
    }
}

From source file:de.itemis.tooling.terminology.ui.preferences.TerminologyBuilderPreferencePage.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   www  .  j  a  v  a  2  s . c  o 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() {
        @Override
        public void expansionStateChanged(ExpansionEvent e) {
            getShell().layout(true, true);
        }
    });
    return excomposite;
}

From source file:de.itemis.tooling.terminology.ui.search.TerminologyEObjectSearchDialog.java

License:Open Source License

protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) {
    ExpandableComposite excomposite = new ExpandableComposite(parent,
            ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
    excomposite.setText(label);/*from  ww  w  . ja v  a2  s . c  om*/
    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) {
            getShell().layout(true, true);
        }
    });
    return excomposite;
}

From source file:de.jcup.egradle.eclipse.ui.SWTFactory.java

License:Apache License

/**
 * Creates an ExpandibleComposite widget
 * //from   w  w w .  j  a  v  a 2  s. c o  m
 * @param parent
 *            the parent to add this widget to
 * @param style
 *            the style for ExpandibleComposite expanding handle, and layout
 * @param label
 *            the label for the widget
 * @param hspan
 *            how many columns to span in the parent
 * @param fill
 *            the fill style for the widget Can be one of
 *            <code>GridData.FILL_HORIZONAL</code>,
 *            <code>GridData.FILL_BOTH</code> or
 *            <code>GridData.FILL_VERTICAL</code>
 * @return a new ExpandibleComposite widget
 */
public static ExpandableComposite createExpandibleComposite(Composite parent, int style, String label,
        int hspan, int fill) {
    ExpandableComposite ex = new ExpandableComposite(parent, SWT.NONE, style);
    ex.setText(label);
    ex.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    GridData gd = new GridData(fill);
    gd.horizontalSpan = hspan;
    ex.setLayoutData(gd);
    return ex;
}