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:com.siteview.mde.ui.launcher.MainTab.java

License:Open Source License

public void createControl(Composite parent) {
    final ScrolledComposite scrollContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
    scrollContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Composite composite = new Composite(scrollContainer, SWT.NONE);
    scrollContainer.setContent(composite);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    fDataBlock.createControl(composite);
    fProgramBlock.createControl(composite);
    fJreBlock.createControl(composite);//from   ww  w . j  a  v  a  2 s .  c  om

    // Add listener for each control to recalculate scroll bar when it is entered.
    // This results in scrollbar scrolling when user tabs to a control that is not in the field of view.
    Listener listener = new Listener() {
        public void handleEvent(Event e) {
            Control child = (Control) e.widget;
            Rectangle bounds = child.getBounds();
            Rectangle area = scrollContainer.getClientArea();
            Point origin = scrollContainer.getOrigin();
            if (origin.x > bounds.x)
                origin.x = Math.max(0, bounds.x);
            if (origin.y > bounds.y)
                origin.y = Math.max(0, bounds.y);
            if (origin.x + area.width < bounds.x + bounds.width)
                origin.x = Math.max(0, bounds.x + bounds.width - area.width);
            if (origin.y + area.height < bounds.y + bounds.height)
                origin.y = Math.max(0, bounds.y + bounds.height - area.height);
            scrollContainer.setOrigin(origin);
        }
    };
    Control[] controls = composite.getChildren();
    for (int i = 0; i < controls.length; i++)
        controls[i].addListener(SWT.Activate, listener);

    Dialog.applyDialogFont(composite);
    composite.setSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    scrollContainer.setExpandHorizontal(true);
    setControl(scrollContainer);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.LAUNCHER_BASIC);
}

From source file:com.siteview.mde.ui.launcher.OSGiSettingsTab.java

License:Open Source License

public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new GridLayout());
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    fJREBlock.createControl(container);/*  ww  w.  j a  v a2  s  . c o m*/
    fConfigurationBlock.createControl(container);

    Dialog.applyDialogFont(container);
    setControl(container);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.LAUNCHER_CONFIGURATION);
}

From source file:com.siteview.mde.ui.launcher.PluginsTab.java

License:Open Source License

public void createControl(Composite parent) {
    Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_HORIZONTAL);

    Composite buttonComp = SWTFactory.createComposite(composite, 6, 1, GridData.FILL_HORIZONTAL, 0, 0);

    SWTFactory.createLabel(buttonComp, MDEUIMessages.PluginsTab_launchWith, 1);

    fSelectionCombo = SWTFactory.createCombo(buttonComp, SWT.READ_ONLY | SWT.BORDER, 1,
            GridData.HORIZONTAL_ALIGN_BEGINNING, new String[] { MDEUIMessages.PluginsTab_allPlugins,
                    MDEUIMessages.PluginsTab_selectedPlugins, MDEUIMessages.PluginsTab_customFeatureMode });
    fSelectionCombo.select(DEFAULT_SELECTION);
    fSelectionCombo.addSelectionListener(fListener);

    Label label = SWTFactory.createLabel(buttonComp, MDEUIMessages.EquinoxPluginsTab_defaultStart, 1);
    GridData gd = new GridData();
    gd.horizontalIndent = 20;/*from  w  w  w  .ja  v  a2s  .  c  o  m*/
    label.setLayoutData(gd);

    fDefaultStartLevel = new Spinner(buttonComp, SWT.BORDER);
    fDefaultStartLevel.setMinimum(1);
    fDefaultStartLevel.addModifyListener(fListener);

    label = SWTFactory.createLabel(buttonComp, MDEUIMessages.EquinoxPluginsTab_defaultAuto, 1);
    gd = new GridData();
    gd.horizontalIndent = 20;
    label.setLayoutData(gd);

    fDefaultAutoStart = SWTFactory.createCombo(buttonComp, SWT.BORDER | SWT.READ_ONLY, 1,
            GridData.HORIZONTAL_ALIGN_BEGINNING,
            new String[] { Boolean.toString(true), Boolean.toString(false) });
    fDefaultAutoStart.select(0);
    fDefaultAutoStart.addSelectionListener(fListener);

    Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
    separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    fBlock.createControl(composite, 7, 10);

    setControl(composite);
    Dialog.applyDialogFont(composite);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.LAUNCHER_ADVANCED);
}

From source file:com.siteview.mde.ui.launcher.TracingTab.java

License:Open Source License

public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    container.setLayout(new GridLayout());
    fTracingBlock.createControl(container);
    setControl(container);//from w  ww  .j a  va2 s  .  c  o m
    Dialog.applyDialogFont(container);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(container, IHelpContextIds.LAUNCHER_TRACING);
}

From source file:com.siteview.mde.ui.templates.OptionTemplateWizardPage.java

License:Open Source License

/**
 * Creates the page control by creating individual options in the order
 * subject to their position in the list.'
 * //from   w w  w . ja v a 2 s  . c  om
 * @param composite
 */
public void createControl(Composite composite) {
    Composite container = new Composite(composite, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.verticalSpacing = 9;
    container.setLayout(layout);

    for (int i = 0; i < options.size(); i++) {
        TemplateOption option = (TemplateOption) options.get(i);
        option.createControl(container, 2);
    }
    if (helpContextId != null)
        PlatformUI.getWorkbench().getHelpSystem().setHelp(container, helpContextId);
    setControl(container);
    Dialog.applyDialogFont(container);
    container.forceFocus();
}

From source file:com.ssn.quickoverviewruler.QuickAnnotationInformationControl.java

License:Open Source License

@Override
protected Text createFilterText(Composite parent) {
    Text fFilterText = new Text(parent, SWT.NONE);
    Dialog.applyDialogFont(fFilterText);

    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.CENTER;
    fFilterText.setLayoutData(data);/*  www  .j  a v  a2s . c  om*/

    fFilterText.addKeyListener(new KeyListener() {
        @SuppressWarnings("synthetic-access")
        public void keyPressed(KeyEvent e) {
            if (e.keyCode == 0x0D) // return
                goToSelectedElement();
            if (e.keyCode == SWT.ARROW_DOWN)
                getTreeViewer().getTree().setFocus();
            if (e.keyCode == SWT.ARROW_UP)
                getTreeViewer().getTree().setFocus();
            if (e.character == 0x1B) // ESC
                dispose();
        }

        public void keyReleased(KeyEvent e) {
            // do nothing
        }
    });

    try {
        Field field = AbstractInformationControl.class.getDeclaredField("fFilterText");
        field.setAccessible(true);
        field.set(this, fFilterText);
    } catch (Exception e) {
        logError(e);
    }

    return fFilterText;
}

From source file:com.surelogic.common.ui.dialogs.ManageLicensesDialog.java

@Override
protected Control createDialogArea(Composite parent) {
    final Composite contents = (Composite) super.createDialogArea(parent);

    final Composite panel = new Composite(contents, SWT.NONE);
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.widthHint = CONTENTS_WIDTH_HINT;
    panel.setLayoutData(data);/*  ww  w .  j a v  a2  s . c o  m*/

    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    panel.setLayout(gridLayout);

    final Label info = new Label(panel, SWT.WRAP);
    info.setText(I18N.msg("common.manage.licenses.dialog.info"));
    info.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));

    final Table licenseTable = new Table(panel, SWT.MULTI | SWT.FULL_SELECTION);
    licenseTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    licenseTable.setHeaderVisible(true);
    licenseTable.setLinesVisible(true);

    final TableColumn product = new TableColumn(licenseTable, SWT.DEFAULT);
    product.setText(I18N.msg("common.manage.licenses.dialog.column.product"));

    final TableColumn activated = new TableColumn(licenseTable, SWT.DEFAULT);
    activated.setText(I18N.msg("common.manage.licenses.dialog.column.activated"));

    final TableColumn type = new TableColumn(licenseTable, SWT.DEFAULT);
    type.setText(I18N.msg("common.manage.licenses.dialog.column.type"));

    final TableColumn expired = new TableColumn(licenseTable, SWT.DEFAULT);
    expired.setText(I18N.msg("common.manage.licenses.dialog.column.expired"));

    final TableColumn issuedTo = new TableColumn(licenseTable, SWT.DEFAULT);
    issuedTo.setText(I18N.msg("common.manage.licenses.dialog.column.issuedTo"));

    final TableColumn id = new TableColumn(licenseTable, SWT.DEFAULT);
    id.setText(I18N.msg("common.manage.licenses.dialog.column.id"));

    final Composite buttonPanel = new Composite(panel, SWT.NONE);
    buttonPanel.setLayoutData(new GridData(SWT.DEFAULT, SWT.TOP, false, false));
    final RowLayout rl = new RowLayout(SWT.VERTICAL);
    rl.fill = true;
    buttonPanel.setLayout(rl);

    final Button installFromFileButton = new Button(buttonPanel, SWT.PUSH);
    installFromFileButton.setText(I18N.msg("common.manage.licenses.dialog.installFromFile"));

    final Button installFromClipboardButton = new Button(buttonPanel, SWT.PUSH);
    installFromClipboardButton.setText(I18N.msg("common.manage.licenses.dialog.installFromClipboard"));

    final Button activateButton = new Button(buttonPanel, SWT.PUSH);
    activateButton.setText(I18N.msg("common.manage.licenses.dialog.activate"));
    activateButton.setEnabled(false);

    final Button renewButton = new Button(buttonPanel, SWT.PUSH);
    renewButton.setText(I18N.msg("common.manage.licenses.dialog.renew"));
    renewButton.setEnabled(false);

    final Button uninstallButton = new Button(buttonPanel, SWT.PUSH);
    uninstallButton.setText(I18N.msg("common.manage.licenses.dialog.uninstall"));
    uninstallButton.setEnabled(false);

    setTitle(I18N.msg("common.manage.licenses.dialog.msg.title"));
    setMessage(I18N.msg("common.manage.licenses.dialog.msg"), IMessageProvider.INFORMATION);
    Dialog.applyDialogFont(panel);

    f_mediator = new ManageLicensesMediator(licenseTable, installFromFileButton, installFromClipboardButton,
            activateButton, renewButton, uninstallButton);
    f_mediator.init();

    return contents;
}

From source file:com.sympedia.genfw.presentation.MultiLineDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    Composite mainArea = (Composite) super.createDialogArea(parent);

    Composite control = new Composite(mainArea, SWT.NONE);
    control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    GridLayout layout = new GridLayout();
    layout.marginLeft = IDialogConstants.BUTTON_MARGIN;
    layout.marginTop = IDialogConstants.BUTTON_MARGIN;
    layout.marginRight = IDialogConstants.BUTTON_MARGIN;
    layout.marginBottom = IDialogConstants.BUTTON_MARGIN;
    control.setLayout(layout);//from  ww w.  jav  a2 s. c  o  m

    initializeDialogUnits(control);

    textArea = createTextControl(control);
    textArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    setTitle(displayName);
    setMessage("Edit the " + displayName + " property of the " + object.eClass().getName() + ".");

    Dialog.applyDialogFont(mainArea);
    return mainArea;
}

From source file:com.vectrace.MercurialEclipse.preferences.ConsolePreferencesPage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    final Composite composite = getFieldEditorParent();
    createLabel(composite, Messages.getString("ConsolePreferencesPage.header")); //$NON-NLS-1$
    IPreferenceStore store = getPreferenceStore();

    // ** WRAP//w  w w.j  av  a  2s  . c om
    wrap = new BooleanFieldEditor(MercurialPreferenceConstants.PREF_CONSOLE_WRAP,
            Messages.getString("ConsolePreferencesPage.wrapText"), //$NON-NLS-1$
            composite);
    addField(wrap);

    width = new IntegerFieldEditor(MercurialPreferenceConstants.PREF_CONSOLE_WIDTH,
            Messages.getString("ConsolePreferencesPage.consoleWidth"), composite); //$NON-NLS-1$
    addField(width);

    // ** RESTRICT OUTPUT
    restrictOutput = new BooleanFieldEditor(MercurialPreferenceConstants.PREF_CONSOLE_LIMIT_OUTPUT,
            Messages.getString("ConsolePreferencesPage.limitOutput"), composite); //$NON-NLS-1$
    addField(restrictOutput);

    highWaterMark = new IntegerFieldEditor(MercurialPreferenceConstants.PREF_CONSOLE_HIGH_WATER_MARK,
            Messages.getString("ConsolePreferencesPage.numberChars"), composite); // ) //$NON-NLS-1$

    addField(highWaterMark);

    // ** SHOW AUTOMATICALLY
    showOnMessage = new BooleanFieldEditor(MercurialPreferenceConstants.PREF_CONSOLE_SHOW_ON_MESSAGE,
            Messages.getString("ConsolePreferencesPage.showConsoleOnMsg"), composite); //$NON-NLS-1$
    addField(showOnMessage);

    // ** show on startup
    showOnStartup = new BooleanFieldEditor(MercurialPreferenceConstants.PREF_CONSOLE_SHOW_ON_STARTUP,
            "Show console on start-up", composite); //$NON-NLS-1$
    addField(showOnStartup);

    // ** SHOW DEBUG
    debug = new BooleanFieldEditor(MercurialPreferenceConstants.PREF_CONSOLE_DEBUG,
            Messages.getString("ConsolePreferencesPage.showAllHgMsg"), composite); //$NON-NLS-1$
    addField(debug);

    // ** SHOW TIME
    debugTime = new BooleanFieldEditor(MercurialPreferenceConstants.PREF_CONSOLE_DEBUG_TIME,
            Messages.getString("ConsolePreferencesPage.showCommandExecutionTime"), composite); //$NON-NLS-1$
    addField(debugTime);

    createLabel(composite, Messages.getString("ConsolePreferencesPage.colorPrefs")); //$NON-NLS-1$

    // ** COLORS AND FONTS
    commandColorEditor = SWTWidgetHelper.createColorFieldEditor(
            MercurialPreferenceConstants.PREF_CONSOLE_COMMAND_COLOR,
            Messages.getString("ConsolePreferencesPage.cmdColor"), composite, this, getPreferenceStore()); //$NON-NLS-1$
    addField(commandColorEditor);

    messageColorEditor = SWTWidgetHelper.createColorFieldEditor(
            MercurialPreferenceConstants.PREF_CONSOLE_MESSAGE_COLOR,
            Messages.getString("ConsolePreferencesPage.msgColor"), composite, this, getPreferenceStore()); //$NON-NLS-1$
    addField(messageColorEditor);

    errorColorEditor = SWTWidgetHelper.createColorFieldEditor(
            MercurialPreferenceConstants.PREF_CONSOLE_ERROR_COLOR,
            Messages.getString("ConsolePreferencesPage.errorColor"), composite, this, getPreferenceStore()); //$NON-NLS-1$
    addField(errorColorEditor);

    //initIntegerFields();
    width.setEnabled(store.getBoolean(MercurialPreferenceConstants.PREF_CONSOLE_WRAP), composite);
    highWaterMark.setEnabled(store.getBoolean(MercurialPreferenceConstants.PREF_CONSOLE_LIMIT_OUTPUT),
            composite);
    Dialog.applyDialogFont(composite);
}

From source file:com.vectrace.MercurialEclipse.search.MercurialTextSearchPage.java

License:Open Source License

public void createControl(Composite parent) {
    initializeDialogUnits(parent);/*from   w ww  . j a  v a  2  s .  co  m*/
    readConfiguration();

    Composite result = new Composite(parent, SWT.NONE);
    result.setFont(parent.getFont());
    GridLayout layout = new GridLayout(2, false);
    result.setLayout(layout);

    addTextPatternControls(result);

    Label separator = new Label(result, SWT.NONE);
    separator.setVisible(false);
    GridData data = new GridData(GridData.FILL, GridData.FILL, false, false, 2, 1);
    data.heightHint = convertHeightInCharsToPixels(1) / 3;
    separator.setLayoutData(data);

    addFileNameControls(result);

    separator = new Label(result, SWT.NONE);
    separator.setVisible(false);
    data = new GridData(GridData.FILL, GridData.FILL, false, false, 2, 1);
    data.heightHint = convertHeightInCharsToPixels(1) / 3;
    separator.setLayoutData(data);

    addSearchInControls(result);

    setControl(result);
    Dialog.applyDialogFont(result);
}