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:gov.redhawk.sca.ui.EventDetailsDialog.java

License:Open Source License

@Override
protected Control createDialogArea(final Composite parent) {
    final Composite container = new Composite(parent, SWT.NONE);
    final GridLayout layout = new GridLayout();
    layout.numColumns = 1;//from  ww  w  .j a  v  a  2 s .  c  o  m
    container.setLayout(layout);
    final GridData gd = new GridData(GridData.FILL_BOTH);
    container.setLayoutData(gd);

    if (this.status.isMultiStatus()) {
        createMultiStatusSection(container);
    } else {
        this.selection = this.status;
    }
    createDetailsSection(container);
    final SashForm sashForm = createSashForm(container);
    createStackSection(sashForm);

    updateProperties();
    Dialog.applyDialogFont(container);
    return container;
}

From source file:gov.redhawk.ui.parts.ContainerSelectionGroup.java

License:Open Source License

/**
 * Creates the contents of the composite.
 * //from ww  w.j  a  va 2 s . c o  m
 * @param message
 * @param heightHint
 * @param widthHint
 */
public void createContents(final String message, final int heightHint, final int widthHint) {
    final GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    setLayout(layout);
    setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    final Label label = new Label(this, SWT.WRAP);
    label.setText(message);
    label.setFont(this.getFont());

    if (this.allowNewContainerName) {
        this.containerNameField = new Text(this, SWT.SINGLE | SWT.BORDER);
        final GridData gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.widthHint = widthHint;
        this.containerNameField.setLayoutData(gd);
        this.containerNameField.addListener(SWT.Modify, this.listener);
        this.containerNameField.setFont(this.getFont());
    } else {
        // filler...
        new Label(this, SWT.NONE);
    }

    createTreeViewer(heightHint);
    Dialog.applyDialogFont(this);
}

From source file:gov.redhawk.ui.parts.TreeMessageDialog.java

License:Open Source License

/**
 * {@inheritDoc}/* w ww  .j a v a 2 s  .c  o m*/
 */
@Override
protected Control createCustomArea(final Composite parent) {
    final TreeViewer viewer = new TreeViewer(parent, SWT.BORDER);
    final GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 150; // SUPPRESS CHECKSTYLE MagicNumber
    viewer.getTree().setLayoutData(gd);
    viewer.setContentProvider(this.fContentProvider);
    viewer.setLabelProvider(this.fLabelProvider);
    viewer.setInput(this.fInput);
    Dialog.applyDialogFont(viewer.getControl());
    return viewer.getControl();
}

From source file:gov.redhawk.ui.util.SWTUtil.java

License:Open Source License

/**
 * Sets width and height hint for the button control. <b>Note:</b> This is a
 * NOP if the button's layout data is not an instance of
 * <code>GridData</code>./*from   w  w w. j a va2s . c  o m*/
 * 
 * @param button the button
 */
public static void setButtonDimensionHint(final Button button) {
    Dialog.applyDialogFont(button);
    Assert.isNotNull(button);
    final Object gd = button.getLayoutData();
    if (gd instanceof GridData) {
        ((GridData) gd).widthHint = SWTUtil.getButtonWidthHint(button);
    }
}

From source file:gov.redhawk.ui.wizards.RenameDialog.java

License:Open Source License

/**
 * {@inheritDoc}/* www  .  j a  v  a  2 s.  com*/
 */
@Override
protected Control createDialogArea(final Composite parent) {
    final Composite container = new Composite(parent, SWT.NULL);
    final GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 9; // SUPPRESS CHECKSTYLE MagicNumber
    layout.marginHeight = layout.marginWidth;
    container.setLayout(layout);

    GridData gd = new GridData(GridData.FILL_BOTH);
    container.setLayoutData(gd);

    final Label label = new Label(container, SWT.NULL);
    label.setText("&Enter new name:");

    this.renameText = new Text(container, SWT.SINGLE | SWT.BORDER);
    this.renameText.addModifyListener(new ModifyListener() {
        @Override
        public void modifyText(final ModifyEvent e) {
            textChanged(RenameDialog.this.renameText.getText());
        }
    });
    gd = new GridData(GridData.FILL_HORIZONTAL);
    this.renameText.setLayoutData(gd);
    Dialog.applyDialogFont(container);
    return container;
}

From source file:greclipse.org.eclipse.jdt.junit.wizards.NewTestCaseWizardPageOne.java

License:Open Source License

public void createControl(Composite parent) {
    initializeDialogUnits(parent);/* w ww  . java 2 s .  com*/

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

    int nColumns = 4;

    GridLayout layout = new GridLayout();
    layout.numColumns = nColumns;
    composite.setLayout(layout);
    createJUnit4Controls(composite, nColumns);
    createContainerControls(composite, nColumns);
    createPackageControls(composite, nColumns);
    createSeparator(composite, nColumns);
    createTypeNameControls(composite, nColumns);
    createSuperClassControls(composite, nColumns);
    createMethodStubSelectionControls(composite, nColumns);
    createCommentControls(composite, nColumns);
    createSeparator(composite, nColumns);
    createClassUnderTestControls(composite, nColumns);
    createBuildPathConfigureControls(composite, nColumns);

    setControl(composite);

    //set default and focus
    String classUnderTest = getClassUnderTestText();
    if (classUnderTest.length() > 0) {
        setTypeName(Signature.getSimpleName(classUnderTest) + TEST_SUFFIX, true);
    }

    Dialog.applyDialogFont(composite);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJUnitHelpContextIds.NEW_TESTCASE_WIZARD_PAGE);

    setFocus();
}

From source file:hydrograph.ui.help.aboutDialog.HydrographInstallationDialog.java

License:Apache License

@Override
protected Control createContents(Composite parent) {
    Control control = super.createContents(parent);
    boolean selected = false;
    if (folder.getItemCount() > 0) {
        if (lastSelectedTabId != null) {
            CTabItem[] items = folder.getItems();
            for (int i = 0; i < items.length; i++)
                if (items[i].getData(ID).equals("30.PluginPage")) {
                    folder.setSelection(i);
                    tabSelected(items[i]);
                    selected = true;/*from w  ww  .j a v  a 2 s .  c o m*/
                    break;
                }
        }
        if (!selected)
            tabSelected(folder.getItem(0));
    }
    // need to reapply the dialog font now that we've created new
    // tab items
    Dialog.applyDialogFont(folder);
    return control;
}

From source file:hydrograph.ui.help.aboutDialog.HydrographInstallationDialog.java

License:Apache License

private void tabSelected(CTabItem item) {
    if (item.getData() instanceof IConfigurationElement) {
        final IConfigurationElement element = (IConfigurationElement) item.getData();

        Composite pageComposite = (Composite) item.getControl();
        try {//ww  w .  ja  va2 s. c om
            final InstallationPage page = (InstallationPage) element
                    .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS);
            page.createControl(pageComposite);
            // new controls created since the dialog font was applied, so
            // apply again.
            Dialog.applyDialogFont(pageComposite);
            page.setPageContainer(this);
            // Must be done before creating the buttons because the control
            // button creation methods
            // use this map.
            pageToId.put(page, element.getAttribute(IWorkbenchRegistryConstants.ATT_ID));
            createButtons(page);
            item.setData(page);
            item.addDisposeListener(new DisposeListener() {

                @Override
                public void widgetDisposed(DisposeEvent e) {
                    page.dispose();
                }
            });
            pageComposite.layout(true, true);

        } catch (CoreException e1) {
            Label label = new Label(pageComposite, SWT.NONE);
            label.setText(e1.getMessage());
            item.setData(null);
        }

    }
    String id = (String) item.getData(ID);
    rememberSelectedTab(id);
    buttonManager.update(id);
    Button button = createButton(buttonManager.getParent(), IDialogConstants.CLOSE_ID,
            IDialogConstants.CLOSE_LABEL, true);
    GridData gd = (GridData) button.getLayoutData();
    gd.horizontalAlignment = SWT.BEGINNING;
    gd.horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH) / 2;
    // Layout the button bar's parent and all of its children.  We must
    // cascade through all children because the buttons have changed and
    // because tray dialog inserts an extra composite in the button bar
    // hierarchy.
    getButtonBar().getParent().layout(true, true);

}

From source file:hydrograph.ui.help.aboutDialog.HydrographInstallationDialog.java

License:Apache License

protected void createButtons(InstallationPage page) {
    page.createPageButtons(buttonManager.getParent());
    Dialog.applyDialogFont(buttonManager.getParent());
}

From source file:ilg.gnumcueclipse.core.ui.preferences.McuPreferencesPage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);//  w ww.  j  a v a  2s  . c o  m

    Composite container = 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);
    container.setLayout(layout);

    Dialog.applyDialogFont(container);
    return container;
}