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.motorola.studio.android.wizards.buildingblocks.NewBuildingBlocksWizardPage.java

License:Apache License

@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);/*  w  w  w .  j  a va2s .co  m*/

    // main control
    Composite mainComposite = new Composite(parent, SWT.FILL);
    mainComposite.setLayout(new FillLayout(SWT.FILL));
    final ScrolledComposite scroll = new ScrolledComposite(mainComposite, SWT.H_SCROLL | SWT.V_SCROLL);

    final Composite composite = new Composite(scroll, SWT.NONE);
    composite.setFont(parent.getFont());

    int nColumns = 4;

    createSampleControls(composite, nColumns);

    GridLayout layout = new GridLayout(nColumns, false);
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));

    if (hasHeader()) {
        setPackageFragmentRoot(getBuildBlock().getPackageFragmentRoot(), true);
        createContainerControls(composite, nColumns);
        setPackageFragment(getBuildBlock().getPackageFragment(), true);
        createPackageControls(composite, nColumns);

        createSeparator(composite, nColumns);

        createTypeNameControls(composite, nColumns);

        createLabelControls(composite);

        setSuperClass(getBuildBlock().getSuperClass(), getBuildBlock().useExtendedClass());
        createSuperClassControls(composite, nColumns);

        createPermissionControls(composite);

        createIntermediateControls(composite);

        createMethodCreationControl(composite, getMethods());
    }
    createExtendedControls(composite);

    // set up scroll
    scroll.setContent(composite);

    scroll.setExpandHorizontal(true);
    scroll.setExpandVertical(true);

    scroll.addControlListener(new ControlAdapter() {
        @Override
        public void controlResized(ControlEvent e) {
            scroll.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
        }
    });

    setControl(mainComposite);
    Dialog.applyDialogFont(mainComposite);

    mainComposite.getShell().addShellListener(new WizardShellListener());
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, getHelpId());
    PlatformUI.getWorkbench().getHelpSystem().setHelp(mainComposite, getHelpId());
}

From source file:com.mousefeed.eclipse.preferences.ActionInvocationPreferencePage.java

License:Open Source License

protected Control createContents(final Composite parent) {
    initializeDialogUnits(parent);//from w  w w  .  j  av a2s . c o m

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

    Control c;
    invocationControlEnabledCheckbox = createInvocationControlEnabledCheckbox(composite, null);
    ((FormData) invocationControlEnabledCheckbox.getLayoutData()).top = new FormAttachment(0);
    c = invocationControlEnabledCheckbox;

    configureKeyboardShortcutCheckbox = createConfigureKeyboardShortcutCheckbox(composite, c);
    c = configureKeyboardShortcutCheckbox;

    configureKeyboardShortcutThreshold = createConfigureKeyboardShortcutThreshold(composite, c);
    c = configureKeyboardShortcutThreshold;

    showUsedKeyboardShortcutCheckbox = createShowUsedKeyboardShortcutCheckbox(composite, c);
    c = showUsedKeyboardShortcutCheckbox;

    c = onWrongInvocationModeUI.createLabel(composite, c,
            MESSAGES.get("field.defaultOnWrongInvocationMode.label"));
    onWrongInvocationModeCombo = onWrongInvocationModeUI.createCombo(composite, c);
    c = onWrongInvocationModeCombo;
    updateOnWrongInvocationModeCombo(preferences.getOnWrongInvocationMode());
    updateInvocationControlEnabled(preferences.isInvocationControlEnabled());
    updateConfigureKeyboardShortcutEnabled(preferences.isConfigureKeyboardShortcutEnabled());
    updateConfigureKeyboardShortcutThreshold(preferences.getConfigureKeyboardShortcutThreshold());
    updateShowUsedKeyboardShortcutEnabled(preferences.isShowUsedKeyboardShortcutEnabled());

    actionModeControl = createActionModeControl(composite);
    c = actionModeControl;

    final Control separator = createHorizontalSeparator(composite, c);
    layoutActionModeControl(onWrongInvocationModeCombo, separator);

    onInvocationControlEnabledCheckboxSelected();
    Dialog.applyDialogFont(composite);
    return composite;
}

From source file:com.mousefeed.eclipse.preferences.invocation.ActionInvocationPreferencePage.java

License:Open Source License

protected Control createContents(final Composite parent) {
    initializeDialogUnits(parent);/*  ww  w .j ava2s .  c  om*/

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

    actionModeControl = createActionModeControl(composite);
    GridDataFactory.fillDefaults().applyTo(actionModeControl);

    Dialog.applyDialogFont(composite);
    return composite;
}

From source file:com.mousefeed.eclipse.preferences.presentation.PresentationModePreferencePage.java

License:Open Source License

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

    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));

    this.parenthesesButton = new Button(composite, SWT.CHECK);
    parenthesesButton.setText("Show Label in parentheses '()'");
    GridDataFactory.fillDefaults().span(2, 1).applyTo(parenthesesButton);

    this.viewer = new TableViewer(composite,
            SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);

    createColumns(viewer);
    GridDataFactory.fillDefaults().span(2, 1).grab(true, true).applyTo(viewer.getTable());

    // make lines and header visible
    final Table table = viewer.getTable();
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    viewer.setContentProvider(ArrayContentProvider.getInstance());
    viewer.setInput(createInput());

    Button addButton = new Button(composite, SWT.PUSH);
    addButton.setText("Add");
    GridDataFactory.swtDefaults().hint(80, SWT.DEFAULT).applyTo(addButton);

    final Button removeButton = new Button(composite, SWT.PUSH);
    removeButton.setText("Remove");
    GridDataFactory.swtDefaults().hint(80, SWT.DEFAULT).applyTo(removeButton);

    // ###

    removeButton.setEnabled(false);

    this.parenthesesButton.setSelection(preferences.isUsePresentationModeParentheses());

    // ###

    parenthesesButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            updateParentheses(((Button) e.widget).getSelection());
        }
    });

    addButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            addItem(viewer);
        }
    });
    removeButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            removeItem(viewer);
        }
    });

    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            removeButton.setEnabled(!viewer.getSelection().isEmpty());
        }
    });

    Dialog.applyDialogFont(composite);
    return composite;
}

From source file:com.mulgasoft.emacsplus.execute.SelectionDialog.java

License:Open Source License

private final void createTableDialogArea(final Composite parent) {

    String[] inputKeys = getSelectableKeys();
    int columnCount = 0;
    Point dimens = getColumnCount(parent, inputKeys, sizeHint.x);
    int count = dimens.x;

    GridLayout compositeLayout = new GridLayout(count, true);
    parent.setLayout(compositeLayout);//from   w  w  w .j av a2  s . c o m
    parent.setLayoutData(new GridData(GridData.FILL_BOTH));

    Table table = new Table(parent, SWT.V_SCROLL | SWT.HORIZONTAL | SWT.WRAP | SWT.FULL_SELECTION); //| SWT.MULTI);
    GridData gridData = new GridData(GridData.FILL_BOTH);
    table.setLayoutData(gridData);
    table.setBackground(parent.getBackground());
    table.setLinesVisible(true);
    table.setHeaderVisible(false);

    int columnWidth = (sizeHint.x - getSizeAdjustment()) / count;

    TableColumn[] columns = new TableColumn[count];
    for (int i = 0; i < count; i++) {
        columns[i] = new TableColumn(table, SWT.LEFT, columnCount++);
        columns[i].setWidth(columnWidth);
    }
    TableColumnLayout layout = new TableColumnLayout();
    for (int i = 0; i < count; i++) {
        layout.setColumnData(columns[i], new ColumnWeightData(100 / count, columnWidth, false));
    }
    parent.setLayout(layout);

    int len = inputKeys.length;
    int rowCount = len / columnCount;
    if ((len - rowCount * columnCount) > 0) {
        rowCount++;
    }
    for (int i = 0; i < rowCount; i++) {
        String[] row = new String[columnCount];
        for (int j = 0; j < columnCount; j++) {
            int sourceIndex = i * columnCount + j;
            row[j] = (sourceIndex < len ? (String) inputKeys[sourceIndex] : ""); //$NON-NLS-1$ 
        }
        TableItem item = new TableItem(table, SWT.NULL);
        item.setText(row);
    }

    table.pack();
    sizeHint.y = Math.min(table.getBounds().height + getSizeAdjustment(), sizeHint.y);

    Dialog.applyDialogFont(parent);
    addTableListeners(table);
}

From source file:com.myeclipsedev.gdt.eclipse.ui.internal.wizard.WebComponentExportPage.java

License:Open Source License

@Override
public void createControl(Composite parent) {
    project = ActiveProjectFinder.getInstance().getProject();

    Composite composite = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout(1, false);
    composite.setLayout(layout);//from  ww  w . j  av a  2 s  . c  o m

    createSourceAndDestinationGroup(composite);
    createCompilerAndShellComponent(composite);

    createEntryPointModulesComponent(composite);

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

    addEventHandlers();

    initializeControls();
}

From source file:com.mywork.eclipse.base.MyWizardNewProjectCreationPage.java

License:Open Source License

/** (non-Javadoc)
  * Method declared on IDialogPage./*  w  w  w . j  ava  2  s. co  m*/
  */
public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.NULL);

    initializeDialogUnits(parent);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IIDEHelpContextIds.NEW_PROJECT_WIZARD_PAGE);

    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    createProjectNameGroup(composite);

    //************************************
    templateLocationArea = new ProjectContentsLocationArea(getErrorReporter(), composite);
    templateLocationArea.updateProjectName("F://eclipse/templates/");
    templateLocationArea.getBrowseButton().setText("template location");
    // Scale the button based on the rest of the dialog
    setButtonLayoutData(templateLocationArea.getBrowseButton());
    //************************************

    locationArea = new ProjectContentsLocationArea(getErrorReporter(), composite);
    if (initialProjectFieldValue != null) {
        locationArea.updateProjectName(initialProjectFieldValue);
    }
    locationArea.getBrowseButton().setText("project location");
    // Scale the button based on the rest of the dialog
    setButtonLayoutData(locationArea.getBrowseButton());

    setPageComplete(validatePage());
    // Show description on opening
    setErrorMessage(null);
    setMessage(null);
    setControl(composite);
    Dialog.applyDialogFont(composite);
}

From source file:com.nokia.carbide.cdt.internal.builder.ui.AddEditEnvVarDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    container.setLayout(new GridLayout(2, false));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    panel = new Composite(container, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    panel.setLayout(layout);/*from ww w  .j a va2  s . c  om*/
    panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    for (Iterator<FieldSummary> i = fieldList.iterator(); i.hasNext();) {
        FieldSummary field = (FieldSummary) i.next();
        switch (field.type) {
        case TEXT:
            createTextField(field.name, field.initialValue, field.allowsEmpty);
            break;
        case BROWSE:
            createBrowseField(field.name, field.initialValue, field.allowsEmpty);
            break;
        case VARIABLE:
            createVariablesField(field.name, field.initialValue, field.allowsEmpty);
            break;
        }
    }

    fieldList = null; // allow it to be gc'd
    Dialog.applyDialogFont(container);
    return container;
}

From source file:com.nokia.carbide.cpp.debug.crashdebugger.ui.CrashDebugConnectionTab.java

License:Open Source License

public void createControl(Composite parent) {
    Composite comp = new Composite(parent, SWT.NONE);
    setControl(comp);/*ww  w  .  j  a  v a 2 s.  c  om*/

    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), LaunchTabHelpIds.RUN_MODE_CONNECTION);

    GridLayout topLayout = new GridLayout();
    topLayout.numColumns = 2;
    comp.setLayout(topLayout);

    createVerticalSpacer(comp, 2);
    createWidgets(comp, 2);

    Dialog.applyDialogFont(parent);
}

From source file:com.nokia.carbide.internal.discovery.ui.wizard.AbstractImportExportPage.java

License:Open Source License

public void createControl(Composite parent) {
    initializeDialogUnits(parent);/*from   www .  jav  a2 s . c  o m*/
    featureImg = FEATURE_IMGDESC.createImage();

    Composite composite = new Composite(parent, SWT.NONE);
    GridLayoutFactory.swtDefaults().numColumns(2).applyTo(composite);
    GridDataFactory.fillDefaults().applyTo(composite);
    composite.setSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));

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