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:melnorme.lang.ide.ui.views.AbstractFilteredTreePopupControl.java

License:Open Source License

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

    filterText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    filterText.addKeyListener(new KeyListener() {
        @Override//from  w  ww.ja  va2s. co m
        public void keyPressed(KeyEvent e) {
            if (e.keyCode == 0x0D || e.keyCode == SWT.KEYPAD_CR) {
                gotoSelectedElement();
            }
            if (e.keyCode == SWT.ARROW_DOWN) {
                treeViewer.getTree().setFocus();
            }
            if (e.keyCode == SWT.ARROW_UP) {
                treeViewer.getTree().setFocus();
            }
            if (e.character == SWT.ESC) {
                dispose();
            }
        }

        @Override
        public void keyReleased(KeyEvent e) {
        }
    });

    return filterText;
}

From source file:mpj_express_debugger.MPJExpressParameterTab.java

License:Open Source License

@Override
public void createControl(Composite parent) {
    Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_HORIZONTAL);
    setControl(comp);/*w w  w. j av  a  2s .  c om*/
    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
            IJavaDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_APPLET_PARAMETERS_TAB);

    @SuppressWarnings("restriction")
    Composite namecomp = SWTFactory.createComposite(comp, comp.getFont(), 5, 1, GridData.FILL_HORIZONTAL, 0, 0);

    SWTFactory.createLabel(namecomp, MPJLauncherMessages.mpjlauncher_argumenttab_nplabel_text, 1);

    npText = SWTFactory.createSingleText(namecomp, 1);
    npText.addModifyListener(fListener);

    SWTFactory.createLabel(namecomp, MPJLauncherMessages.mpjlauncher_argumenttab_homelabel_text, 1);

    mpjHomeText = SWTFactory.createSingleText(namecomp, 1);
    mpjHomeText.addModifyListener(fListener);
    fBrowseMPJHomeButton = SWTFactory.createPushButton(namecomp, "Browse", null);
    fBrowseMPJHomeButton.addSelectionListener(fListener);
    SWTFactory.createLabel(namecomp, MPJLauncherMessages.mpjlauncher_argumenttab_devlabel_text, 1);

    devText = SWTFactory.createSingleText(namecomp, 1);
    devText.addModifyListener(fListener);

    Label blank = new Label(namecomp, SWT.NONE);
    blank.setText(EMPTY_STRING);
    Label hint = SWTFactory.createLabel(namecomp, MPJLauncherMessages.MPJParametersTab__mandatory_mpj_home_path,
            1);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
    hint.setLayoutData(gd);

    SWTFactory.createVerticalSpacer(comp, 1);

    Composite paramcomp = SWTFactory.createComposite(comp, comp.getFont(), 2, 1, GridData.FILL_BOTH, 0, 0);

    SWTFactory.createLabel(paramcomp, MPJLauncherMessages.appletlauncher_argumenttab_parameterslabel_text, 2);

    Table ptable = new Table(paramcomp, SWT.FULL_SELECTION | SWT.BORDER);
    fViewer = new TableViewer(ptable);
    gd = new GridData(GridData.FILL_BOTH);
    ptable.setLayoutData(gd);
    TableColumn column1 = new TableColumn(ptable, SWT.NONE);
    column1.setText(MPJLauncherMessages.appletlauncher_argumenttab_parameterscolumn_name_text);
    TableColumn column2 = new TableColumn(ptable, SWT.NONE);
    column2.setText(MPJLauncherMessages.appletlauncher_argumenttab_parameterscolumn_value_text);
    TableLayout tableLayout = new TableLayout();
    ptable.setLayout(tableLayout);
    tableLayout.addColumnData(new ColumnWeightData(100));
    tableLayout.addColumnData(new ColumnWeightData(100));
    ptable.setHeaderVisible(true);
    ptable.setLinesVisible(true);
    ptable.addSelectionListener(fListener);
    ptable.addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent e) {
            setParametersButtonsEnableState();
            if (fParametersEditButton.isEnabled()) {
                handleParametersEditButtonSelected();
            }
        }
    });

    fViewer.setContentProvider(new IStructuredContentProvider() {
        public Object[] getElements(Object inputElement) {
            Map params = (Map) inputElement;
            return params.keySet().toArray();
        }

        public void dispose() {
        }

        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }
    });

    fViewer.setLabelProvider(new ITableLabelProvider() {
        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        public String getColumnText(Object element, int columnIndex) {
            if (columnIndex == 0) {
                return element.toString();
            }

            String key = (String) element;
            Map params = (Map) fViewer.getInput();
            Object object = params.get(key);
            if (object != null)
                return object.toString();
            return null;
        }

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }
    });

    fViewer.setComparator(new ViewerComparator());

    Composite envcomp = SWTFactory.createComposite(paramcomp, paramcomp.getFont(), 1, 1,
            GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL, 0, 0);

    fParametersAddButton = createPushButton(envcomp,
            MPJLauncherMessages.appletlauncher_argumenttab_parameters_button_add_text, null);
    fParametersAddButton.addSelectionListener(fListener);

    fParametersEditButton = createPushButton(envcomp,
            MPJLauncherMessages.appletlauncher_argumenttab_parameters_button_edit_text, null);
    fParametersEditButton.addSelectionListener(fListener);

    fParametersRemoveButton = createPushButton(envcomp,
            MPJLauncherMessages.appletlauncher_argumenttab_parameters_button_remove_text, null);
    fParametersRemoveButton.addSelectionListener(fListener);

    setParametersButtonsEnableState();
    Dialog.applyDialogFont(parent);
}

From source file:msi.gama.lang.gaml.ui.editor.toolbar.GamlQuickOutlinePopup.java

@Override
protected Text createFilterText(final Composite parent) {
    final Text filterText = new Text(parent, SWT.SEARCH | SWT.ICON_SEARCH);
    filterText.setMessage("Search keyword");
    Dialog.applyDialogFont(filterText);

    final GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.CENTER;
    filterText.setLayoutData(data);/*from   ww  w  .ja v  a  2s .c o m*/

    filterText.addKeyListener(new KeyAdapter() {
        @Override
        public void keyPressed(final KeyEvent e) {
            if (e.keyCode == 0x0D) {
                gotoSelectedElement();
            }
            if (e.keyCode == SWT.ARROW_DOWN) {
                getTreeViewer().getTree().setFocus();
            }
            if (e.keyCode == SWT.ARROW_UP) {
                getTreeViewer().getTree().setFocus();
            }
            if (e.character == 0x1B) {
                dispose();
            }
        }
    });
    return filterText;
}

From source file:mt.com.southedge.jclockwork.plugin.wizard.MainObjectMapWizardPage.java

License:Open Source License

/**
 * Method that creates all the controls in the wizard form.
 * /*from   ww  w.  ja  va2 s  .  co m*/
 * @param parent the composite
 */
public void createControl(Composite parent) {
    initializeDialogUnits(parent);

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

    int nColumns = FOUR;

    GridLayout layout = new GridLayout();
    layout.numColumns = nColumns;
    composite.setLayout(layout);

    createContainerControls(composite, nColumns);
    createPackageControls(composite, nColumns);

    createSeparator(composite, nColumns);

    createTypeNameControls(composite, nColumns);
    createModifierControls(composite, nColumns);

    createSuperClassControls(composite, nColumns);
    createSuperInterfacesControls(composite, nColumns);

    createMethodStubSelectionControls(composite, nColumns);

    createSeparator(composite, nColumns);

    sourceControlObject = createBeanControls(composite, nColumns,
            new CreateControlObject(ClockWorkWizardMessages.ClockWorkWizard_Source_Label,
                    ClockWorkWizardMessages.ClockWorkWizard_Browse_Button));

    targetControlObject = createBeanControls(composite, nColumns,
            new CreateControlObject(ClockWorkWizardMessages.ClockWorkWizard_Target_Label,
                    ClockWorkWizardMessages.ClockWorkWizard_Browse_Button));

    setControl(composite);

    Dialog.applyDialogFont(composite);
}

From source file:name.schedenig.eclipse.grepconsole.view.DefaultSizeDialog.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
 *//*from   ww  w  .j  a v  a  2s. c om*/
@Override
protected Control createContents(Composite parent) {
    Control contents = super.createContents(parent);
    Dialog.applyDialogFont(parent);

    return contents;
}

From source file:name.schedenig.eclipse.grepconsole.view.DefaultSizeTitleAreaDialog.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.TitleAreaDialog#createContents(org.eclipse.swt.widgets.Composite)
 *//* w  w  w . j  a va2s  . com*/
@Override
protected Control createContents(Composite parent) {
    Control contents = super.createContents(parent);

    Label imageLabel = getTitleImageLabel();
    FormData formData = (FormData) imageLabel.getLayoutData();
    formData.right.offset = -4;

    Dialog.applyDialogFont(parent);

    return contents;
}

From source file:name.schedenig.eclipse.grepconsole.view.items.ItemsAndStylesDialog.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 *///from   ww w . java 2 s.  c om
@Override
protected Control createDialogArea(Composite parent) {
    Dialog.applyDialogFont(parent);

    setHelpAvailable(true);

    tabFolder = new TabFolder(parent, SWT.TOP);
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    tiExpressions = new TabItem(tabFolder, SWT.NONE);
    tiExpressions.setText(Messages.ItemsAndStylesDialog_expressions);
    panelExpressions = createItemsPanel(tabFolder);
    tiExpressions.setControl(panelExpressions);

    tiStyles = new TabItem(tabFolder, SWT.NONE);
    tiStyles.setText(Messages.ItemsAndStylesDialog_styles);
    panelStyles = createStylesPanel(tabFolder);
    tiStyles.setControl(panelStyles);

    tabFolder.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            if (tabFolder.getSelection()[0] == tiExpressions) {
                panelExpressions.refresh();
            } else {
                panelStyles.refresh();
            }
        }
    });

    return tabFolder;
}

From source file:name.schedenig.eclipse.grepconsole.view.whatsnew.WhatsNewDialog.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
 *//*from w w  w  .j  a  v a 2s .  c  o  m*/
@Override
protected Control createContents(Composite parent) {
    Dialog.applyDialogFont(parent);

    return super.createContents(parent);
}

From source file:net.bpelunit.framework.client.eclipse.dialog.FieldBasedInputDialog.java

License:Open Source License

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

    fPanel = new Composite(container, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    fPanel.setLayout(layout);//from www  .  j a va2 s  . c  om
    fPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    for (Field field : fFields) {
        field.createControl(fPanel);
    }

    fMessageBox = new MessageBox(container, SWT.NONE);
    fMessageBox.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    Dialog.applyDialogFont(container);
    return container;
}

From source file:net.bpelunit.toolsupport.editors.wizards.pages.ActivityWizardPage.java

License:Open Source License

public void createControl(Composite parent) {

    initializeDialogUnits(parent);/* w ww. j  a  va2  s.  c  o m*/

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

    int nColumns = 4;

    GridLayout layout = new GridLayout();
    layout.numColumns = nColumns;
    composite.setLayout(layout);

    createFieldControls(composite, nColumns);

    setControl(composite);

    Dialog.applyDialogFont(composite);
}