Example usage for org.eclipse.jface.resource JFaceResources getDialogFont

List of usage examples for org.eclipse.jface.resource JFaceResources getDialogFont

Introduction

In this page you can find the example usage for org.eclipse.jface.resource JFaceResources getDialogFont.

Prototype

public static Font getDialogFont() 

Source Link

Document

Returns the JFace's dialog font.

Usage

From source file:org.eclipse.birt.report.designer.ui.preferences.OptionsConfigurationBlock.java

License:Open Source License

protected Combo addInversedComboBox(Composite parent, String label, Key key, String[] values,
        String[] valueLabels, int indent) {
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    gd.horizontalIndent = indent;/*from w w w.  ja v  a 2  s  .c o m*/
    gd.horizontalSpan = 3;

    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 2;
    composite.setLayout(layout);
    composite.setLayoutData(gd);

    Combo comboBox = newComboControl(composite, key, values, valueLabels);
    comboBox.setFont(JFaceResources.getDialogFont());
    comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

    Label labelControl = new Label(composite, SWT.LEFT | SWT.WRAP);
    labelControl.setText(label);
    labelControl.setLayoutData(new GridData());

    fLabels.put(comboBox, labelControl);

    updateCombo(comboBox);

    return comboBox;
}

From source file:org.eclipse.birt.report.designer.ui.preferences.OptionsConfigurationBlock.java

License:Open Source License

protected Combo newComboControl(Composite composite, Key key, String[] values, String[] valueLabels) {
    ControlData data = new ControlData(key, values);

    Combo comboBox = new Combo(composite, SWT.READ_ONLY);
    comboBox.setVisibleItemCount(30);/*  w w w  .jav a 2 s  .  co m*/
    comboBox.setItems(valueLabels);
    comboBox.setData(data);
    comboBox.addSelectionListener(getSelectionListener());
    comboBox.setFont(JFaceResources.getDialogFont());

    String currValue = getValue(key);
    comboBox.select(data.getSelection(currValue));

    fComboBoxes.add(comboBox);

    return comboBox;
}

From source file:org.eclipse.birt.report.designer.ui.preferences.OptionsConfigurationBlock.java

License:Open Source License

protected Text addTextField(Composite parent, String label, Key key, int indent, int widthHint, int style) {
    Label labelControl = null;/*from   w  w  w. j  a va2  s  .c o  m*/
    if (label != null && label.length() > 0) {
        labelControl = new Label(parent, SWT.WRAP);
        labelControl.setText(label);
        labelControl.setFont(JFaceResources.getDialogFont());
        labelControl.setLayoutData(new GridData());
    }
    Text textBox = new Text(parent, style);
    textBox.setData(key);
    textBox.setLayoutData(new GridData());

    if (labelControl != null)
        fLabels.put(textBox, labelControl);

    String currValue = getValue(key);
    if (currValue != null) {
        textBox.setText(currValue);
    }
    textBox.addModifyListener(getTextModifyListener());

    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    if (widthHint != 0) {
        data.widthHint = widthHint;
    } else
        data.grabExcessHorizontalSpace = true;
    data.horizontalIndent = indent;
    if (labelControl != null)
        data.horizontalSpan = 2;
    else
        data.horizontalSpan = 3;
    textBox.setLayoutData(data);

    fTextBoxes.add(textBox);

    updateText(textBox);

    return textBox;
}

From source file:org.eclipse.bpel.apache.ode.deploy.ui.pages.dialogs.AddMappingDialog.java

License:Apache License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    ((GridLayout) parent.getLayout()).numColumns++;

    Button button = new Button(parent, SWT.PUSH);
    button.setText("Save");
    button.setFont(JFaceResources.getDialogFont());
    button.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            /*/*from  ww  w  . j a v a  2  s  .co m*/
             * Saving the values in the Activity Mapping
             */
            if (!availableActivities.getText().isEmpty() && !policyAdress.getText().isEmpty()) {

                // Create a new Activity Mapping
                ddFactory factory = ddFactory.eINSTANCE;
                mapping = factory.createTActivityMapping();

                String activityName = availableActivities.getText();
                // mapping.setActivity(DeployUtils.findActivityByName(
                // activityName, processType.getModel()));
                mapping.setActivity(activityName);

                mapping.setPolicy(DeployUtils.queryPolicyByPath(policyAdress.getText()));

                // TODO: Has to be changed if more than one strategy is
                // available.
                mapping.setStrategy(
                        strategy.getText().equals(StrategyType.FIRST_FIND.getName()) ? StrategyType.FIRST_FIND
                                : StrategyType.FIRST_FIND);

                close();

            } else {
                setErrorMessage("Please enter a value for every paramater of the mapping");
            }
        }
    });
}

From source file:org.eclipse.bpel.apache.ode.deploy.ui.pages.dialogs.EditMappingDialog.java

License:Apache License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    ((GridLayout) parent.getLayout()).numColumns++;

    Button button = new Button(parent, SWT.PUSH);
    button.setText("Save");
    button.setFont(JFaceResources.getDialogFont());
    button.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            /*/*  w  w  w . j a  v a  2 s  .  c  om*/
             * Saving the values in the Activity Mapping
             */
            // Create a new Activity Mapping

            if (!availableActivities.getText().isEmpty() && !policyAdress.getText().isEmpty()) {
                ddFactory factory = ddFactory.eINSTANCE;
                mapping = factory.createTActivityMapping();

                String activityName = availableActivities.getText();
                // mapping.setActivity(DeployUtils.findActivityByName(
                // activityName, processType.getModel()));
                mapping.setActivity(activityName);

                mapping.setPolicy(DeployUtils.queryPolicyByPath(policyAdress.getText()));

                // TODO: Has to be changed if more than one strategy is
                // available.
                mapping.setStrategy(
                        strategy.getText().equals(StrategyType.FIRST_FIND.getName()) ? StrategyType.FIRST_FIND
                                : StrategyType.FIRST_FIND);
                close();
            } else {
                setErrorMessage("Please enter a value for every paramater of the mapping");
            }
        }
    });
}

From source file:org.eclipse.bpel.ui.dialogs.BrowseSelectorDialog.java

License:Open Source License

protected Button createRadioButton(Composite parent, String label, int id, boolean checked) {

    Button button = new Button(parent, SWT.RADIO);
    button.setText(label);// w  w  w  .  j av a 2s. c  o  m
    button.setFont(JFaceResources.getDialogFont());
    button.setData(new Integer(id));
    button.setSelection(checked);

    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            Button b = (Button) event.widget;
            int val = ((Integer) b.getData()).intValue();

            buttonPressed(val, b.getSelection(), true);
        }
    });

    return button;

}

From source file:org.eclipse.bpel.ui.dialogs.BrowseSelectorDialog.java

License:Open Source License

protected Button createCheckButton(Composite parent, String label, int id, boolean checked) {

    Button button = new Button(parent, SWT.CHECK);
    button.setText(label);/*from  w w w. j a  va2s . com*/
    button.setFont(JFaceResources.getDialogFont());
    button.setData(new Integer(id));
    button.setSelection(checked);

    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            Button b = (Button) event.widget;
            int val = ((Integer) b.getData()).intValue();

            buttonPressed(val, b.getSelection(), true);
        }
    });

    return button;

}

From source file:org.eclipse.bpel.ui.dialogs.SchemaImportDialog.java

License:Open Source License

protected Button createRadioButton(Composite parent, String label, int id, boolean checked) {

    Button button = new Button(parent, SWT.RADIO);
    button.setText(label);/*from  w  w w  .j  av  a 2s.c o m*/
    button.setFont(JFaceResources.getDialogFont());
    button.setData(new Integer(id));
    button.setSelection(checked);

    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            Button b = (Button) event.widget;
            int bid = ((Integer) b.getData()).intValue();

            buttonPressed(bid, b.getSelection());
        }
    });

    return button;

}

From source file:org.eclipse.bpmn2.modeler.ui.property.dialogs.DefaultSchemaImportDialog.java

License:Open Source License

protected Button createRadioButton(Composite parent, String label, int id, boolean checked) {

    Button button = new Button(parent, SWT.RADIO);
    button.setText(label);//from   ww w.  j av  a  2s  . c  om
    button.setFont(JFaceResources.getDialogFont());
    button.setData(Integer.valueOf(id));
    button.setSelection(checked);

    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            Button b = (Button) event.widget;
            int bid = ((Integer) b.getData()).intValue();

            buttonPressed(bid, b.getSelection());
        }
    });

    return button;

}

From source file:org.eclipse.buildship.ui.util.font.FontUtils.java

License:Open Source License

/**
 * Provides the default dialog font.//w  w w  .j a  va  2 s  . co m
 *
 * @return the default dialog font
 */
public static synchronized Font getDefaultDialogFont() {
    Font font = JFaceResources.getDialogFont();
    Device device = font.getDevice();
    FontData[] fontData = font.getFontData();
    return new Font(device, fontData);
}