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.drools.eclipse.flow.ruleflow.view.property.exceptionHandler.ExceptionHandlerDialog.java

License:Apache License

protected Control createDialogArea(Composite parent) {
    final Composite composite = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;/*from  ww  w . j av  a  2 s . c  om*/
    composite.setLayout(gridLayout);

    Label nameLabel = new Label(composite, SWT.NONE);
    nameLabel.setText("Name: ");
    nameText = new Text(composite, SWT.NONE);
    GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    nameText.setLayoutData(gridData);
    if (key != null) {
        nameText.setText(key);
        nameText.setEditable(false);
    }

    nameLabel = new Label(composite, SWT.NONE);
    nameLabel.setText("FaultVariable: ");
    faultVariableText = new Text(composite, SWT.NONE);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    faultVariableText.setLayoutData(gridData);
    String faultVariable = getValue().getFaultVariable();
    faultVariableText.setText(faultVariable == null ? "" : faultVariable);

    Composite top = new Composite(composite, SWT.NONE);
    GridData gd = new GridData();
    gd.horizontalSpan = 2;
    gd.grabExcessHorizontalSpace = true;
    top.setLayoutData(gd);

    gridLayout = new GridLayout();
    gridLayout.numColumns = 4;
    top.setLayout(gridLayout);

    Label label = new Label(top, SWT.NONE);
    label.setText("Dialect:");
    createDialectCombo(top);

    Button importButton = new Button(top, SWT.PUSH);
    importButton.setText("Imports ...");
    importButton.setFont(JFaceResources.getDialogFont());
    importButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            importButtonPressed();
        }
    });

    Button globalButton = new Button(top, SWT.PUSH);
    globalButton.setText("Globals ...");
    globalButton.setFont(JFaceResources.getDialogFont());
    globalButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            globalButtonPressed();
        }
    });

    tabFolder = new TabFolder(composite, SWT.NONE);
    gd = new GridData();
    gd.horizontalSpan = 3;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.verticalAlignment = GridData.FILL;
    gd.horizontalAlignment = GridData.FILL;
    tabFolder.setLayoutData(gd);
    TabItem textEditorTab = new TabItem(tabFolder, SWT.NONE);
    textEditorTab.setText("Textual Editor");

    textEditorTab.setControl(createTextualEditor(tabFolder));
    return composite;
}

From source file:org.drools.eclipse.flow.ruleflow.view.property.metadata.MetaDataDialog.java

License:Apache License

public Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;//  w w w.  j ava  2 s .  co m
    composite.setLayout(layout);

    table = new Table(composite, SWT.SINGLE);
    GridData gd = new GridData();
    gd.verticalSpan = 3;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.verticalAlignment = GridData.FILL;
    gd.horizontalAlignment = GridData.FILL;
    table.setLayoutData(gd);
    table.addSelectionListener(new SelectionListener() {
        public void widgetDefaultSelected(SelectionEvent e) {
            removeButton.setEnabled(table.getSelectionIndex() != -1);
        }

        public void widgetSelected(SelectionEvent e) {
            removeButton.setEnabled(table.getSelectionIndex() != -1);
        }
    });
    table.addMouseListener(this);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    TableColumn variableNameColumn = new TableColumn(table, SWT.LEFT);
    variableNameColumn.setText("Name");
    variableNameColumn.setWidth(150);
    TableColumn parameterNameColumn = new TableColumn(table, SWT.LEFT);
    parameterNameColumn.setText("Value");
    parameterNameColumn.setWidth(225);

    editor = new TableEditor(table);
    text = new Text(table, SWT.NORMAL);
    text.setVisible(false);
    text.setText("");
    editor.minimumWidth = text.getSize().x;
    editor.horizontalAlignment = SWT.LEFT;
    editor.grabHorizontal = true;

    Button addButton = new Button(composite, SWT.PUSH);
    addButton.setText("Add");
    addButton.setFont(JFaceResources.getDialogFont());
    addButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            addButtonPressed();
        }
    });
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    addButton.setLayoutData(gd);

    removeButton = new Button(composite, SWT.PUSH);
    removeButton.setText("Remove");
    removeButton.setFont(JFaceResources.getDialogFont());
    removeButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            removeButtonPressed();
        }
    });
    gd = new GridData();
    removeButton.setLayoutData(gd);
    removeButton.setEnabled(false);

    updateTable();

    return composite;
}

From source file:org.drools.eclipse.flow.ruleflow.view.property.subprocess.SubProcessParameterInMappingDialog.java

License:Apache License

public Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;//from www .  ja v a2  s  . c o m
    composite.setLayout(layout);

    table = new Table(composite, SWT.SINGLE);
    GridData gd = new GridData();
    gd.verticalSpan = 3;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.verticalAlignment = GridData.FILL;
    gd.horizontalAlignment = GridData.FILL;
    table.setLayoutData(gd);
    table.addSelectionListener(new SelectionListener() {
        public void widgetDefaultSelected(SelectionEvent e) {
            removeButton.setEnabled(table.getSelectionIndex() != -1);
        }

        public void widgetSelected(SelectionEvent e) {
            removeButton.setEnabled(table.getSelectionIndex() != -1);
        }
    });
    table.addMouseListener(this);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    TableColumn variableNameColumn = new TableColumn(table, SWT.LEFT);
    variableNameColumn.setText("Sub Process Variable");
    variableNameColumn.setWidth(150);
    TableColumn parameterNameColumn = new TableColumn(table, SWT.LEFT);
    parameterNameColumn.setText("Process Variable");
    parameterNameColumn.setWidth(225);

    editor = new TableEditor(table);
    text = new Text(table, SWT.NORMAL);
    text.setVisible(false);
    text.setText("");
    editor.minimumWidth = text.getSize().x;
    editor.horizontalAlignment = SWT.LEFT;
    editor.grabHorizontal = true;

    Button addButton = new Button(composite, SWT.PUSH);
    addButton.setText("Add");
    addButton.setFont(JFaceResources.getDialogFont());
    addButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            addButtonPressed();
        }
    });
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    addButton.setLayoutData(gd);

    removeButton = new Button(composite, SWT.PUSH);
    removeButton.setText("Remove");
    removeButton.setFont(JFaceResources.getDialogFont());
    removeButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            removeButtonPressed();
        }
    });
    gd = new GridData();
    removeButton.setLayoutData(gd);
    removeButton.setEnabled(false);

    updateTable();

    return composite;
}

From source file:org.drools.eclipse.flow.ruleflow.view.property.subprocess.SubProcessParameterOutMappingDialog.java

License:Apache License

public Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;//from w  w w.j a  v  a2 s  . co m
    composite.setLayout(layout);

    table = new Table(composite, SWT.SINGLE);
    GridData gd = new GridData();
    gd.verticalSpan = 3;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.verticalAlignment = GridData.FILL;
    gd.horizontalAlignment = GridData.FILL;
    table.setLayoutData(gd);
    table.addSelectionListener(new SelectionListener() {
        public void widgetDefaultSelected(SelectionEvent e) {
            removeButton.setEnabled(table.getSelectionIndex() != -1);
        }

        public void widgetSelected(SelectionEvent e) {
            removeButton.setEnabled(table.getSelectionIndex() != -1);
        }
    });
    table.addMouseListener(this);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    TableColumn variableNameColumn = new TableColumn(table, SWT.LEFT);
    variableNameColumn.setText("Process Variable");
    variableNameColumn.setWidth(150);
    TableColumn parameterNameColumn = new TableColumn(table, SWT.LEFT);
    parameterNameColumn.setText("Sub Process Variable");
    parameterNameColumn.setWidth(225);

    editor = new TableEditor(table);
    text = new Text(table, SWT.NORMAL);
    text.setVisible(false);
    text.setText("");
    editor.minimumWidth = text.getSize().x;
    editor.horizontalAlignment = SWT.LEFT;
    editor.grabHorizontal = true;

    Button addButton = new Button(composite, SWT.PUSH);
    addButton.setText("Add");
    addButton.setFont(JFaceResources.getDialogFont());
    addButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            addButtonPressed();
        }
    });
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    addButton.setLayoutData(gd);

    removeButton = new Button(composite, SWT.PUSH);
    removeButton.setText("Remove");
    removeButton.setFont(JFaceResources.getDialogFont());
    removeButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            removeButtonPressed();
        }
    });
    gd = new GridData();
    removeButton.setLayoutData(gd);
    removeButton.setEnabled(false);

    updateTable();

    return composite;
}

From source file:org.drools.eclipse.flow.ruleflow.view.property.timers.TimerDialog.java

License:Apache License

protected Control createDialogArea(Composite parent) {
    final Composite composite = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;// w ww  .j a v  a2s  .  c  o m
    composite.setLayout(gridLayout);

    Label label = new Label(composite, SWT.NONE);
    label.setText("Timer delay: ");
    delayText = new Text(composite, SWT.NONE);
    GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    delayText.setLayoutData(gridData);
    if (timer != null && timer.getDelay() != null) {
        delayText.setText(timer.getDelay());
    }
    label = new Label(composite, SWT.NONE);
    label.setText("Timer period: ");
    periodText = new Text(composite, SWT.NONE);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    periodText.setLayoutData(gridData);
    if (timer != null && timer.getPeriod() != null) {
        periodText.setText(timer.getPeriod());
    }

    Composite top = new Composite(composite, SWT.NONE);
    GridData gd = new GridData();
    gd.horizontalSpan = 2;
    gd.grabExcessHorizontalSpace = true;
    top.setLayoutData(gd);

    gridLayout = new GridLayout();
    gridLayout.numColumns = 4;
    top.setLayout(gridLayout);

    label = new Label(top, SWT.NONE);
    label.setText("Dialect:");
    createDialectCombo(top);

    Button importButton = new Button(top, SWT.PUSH);
    importButton.setText("Imports ...");
    importButton.setFont(JFaceResources.getDialogFont());
    importButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            importButtonPressed();
        }
    });

    Button globalButton = new Button(top, SWT.PUSH);
    globalButton.setText("Globals ...");
    globalButton.setFont(JFaceResources.getDialogFont());
    globalButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            globalButtonPressed();
        }
    });

    tabFolder = new TabFolder(composite, SWT.NONE);
    gd = new GridData();
    gd.horizontalSpan = 3;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.verticalAlignment = GridData.FILL;
    gd.horizontalAlignment = GridData.FILL;
    tabFolder.setLayoutData(gd);
    TabItem textEditorTab = new TabItem(tabFolder, SWT.NONE);
    textEditorTab.setText("Textual Editor");

    textEditorTab.setControl(createTextualEditor(tabFolder));
    return composite;
}

From source file:org.drools.eclipse.flow.ruleflow.view.property.workitem.WorkItemParameterMappingDialog.java

License:Apache License

public Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;/*from w w w . j  a  va2s .  c  o  m*/
    composite.setLayout(layout);

    table = new Table(composite, SWT.SINGLE);
    GridData gd = new GridData();
    gd.verticalSpan = 3;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.verticalAlignment = GridData.FILL;
    gd.horizontalAlignment = GridData.FILL;
    table.setLayoutData(gd);
    table.addSelectionListener(new SelectionListener() {
        public void widgetDefaultSelected(SelectionEvent e) {
            removeButton.setEnabled(table.getSelectionIndex() != -1);
        }

        public void widgetSelected(SelectionEvent e) {
            removeButton.setEnabled(table.getSelectionIndex() != -1);
        }
    });
    table.addMouseListener(this);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    TableColumn variableNameColumn = new TableColumn(table, SWT.LEFT);
    variableNameColumn.setText("Parameter");
    variableNameColumn.setWidth(150);
    TableColumn parameterNameColumn = new TableColumn(table, SWT.LEFT);
    parameterNameColumn.setText("Variable");
    parameterNameColumn.setWidth(225);

    editor = new TableEditor(table);
    text = new Text(table, SWT.NORMAL);
    text.setVisible(false);
    text.setText("");
    editor.minimumWidth = text.getSize().x;
    editor.horizontalAlignment = SWT.LEFT;
    editor.grabHorizontal = true;

    Button addButton = new Button(composite, SWT.PUSH);
    addButton.setText("Add");
    addButton.setFont(JFaceResources.getDialogFont());
    addButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            addButtonPressed();
        }
    });
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    addButton.setLayoutData(gd);

    removeButton = new Button(composite, SWT.PUSH);
    removeButton.setText("Remove");
    removeButton.setFont(JFaceResources.getDialogFont());
    removeButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            removeButtonPressed();
        }
    });
    gd = new GridData();
    removeButton.setLayoutData(gd);
    removeButton.setEnabled(false);

    updateTable();

    return composite;
}

From source file:org.drools.eclipse.flow.ruleflow.view.property.workitem.WorkItemResultMappingDialog.java

License:Apache License

public Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;/*from www  . ja  v a  2  s. c o m*/
    composite.setLayout(layout);

    table = new Table(composite, SWT.SINGLE);
    GridData gd = new GridData();
    gd.verticalSpan = 3;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.verticalAlignment = GridData.FILL;
    gd.horizontalAlignment = GridData.FILL;
    table.setLayoutData(gd);
    table.addSelectionListener(new SelectionListener() {
        public void widgetDefaultSelected(SelectionEvent e) {
            removeButton.setEnabled(table.getSelectionIndex() != -1);
        }

        public void widgetSelected(SelectionEvent e) {
            removeButton.setEnabled(table.getSelectionIndex() != -1);
        }
    });
    table.addMouseListener(this);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    TableColumn variableNameColumn = new TableColumn(table, SWT.LEFT);
    variableNameColumn.setText("Variable");
    variableNameColumn.setWidth(150);
    TableColumn parameterNameColumn = new TableColumn(table, SWT.LEFT);
    parameterNameColumn.setText("Result Parameter");
    parameterNameColumn.setWidth(225);

    editor = new TableEditor(table);
    text = new Text(table, SWT.NORMAL);
    text.setVisible(false);
    text.setText("");
    editor.minimumWidth = text.getSize().x;
    editor.horizontalAlignment = SWT.LEFT;
    editor.grabHorizontal = true;

    Button addButton = new Button(composite, SWT.PUSH);
    addButton.setText("Add");
    addButton.setFont(JFaceResources.getDialogFont());
    addButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            addButtonPressed();
        }
    });
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    addButton.setLayoutData(gd);

    removeButton = new Button(composite, SWT.PUSH);
    removeButton.setText("Remove");
    removeButton.setFont(JFaceResources.getDialogFont());
    removeButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            removeButtonPressed();
        }
    });
    gd = new GridData();
    removeButton.setLayoutData(gd);
    removeButton.setEnabled(false);

    updateTable();

    return composite;
}

From source file:org.ebayopensource.turmeric.eclipse.utils.ui.UIUtil.java

License:Open Source License

/**
 * Returns a width hint for a button control.
 * /* www . j  a v  a  2  s. c o  m*/
 * @param button
 *            the button
 * @return the width hint
 */
public static int getButtonWidthHint(Button button) {
    button.setFont(JFaceResources.getDialogFont());
    Font font = button.getFont();
    GC gc = new GC(font.getDevice());
    gc.setFont(font);
    int widthHint = Dialog.convertHorizontalDLUsToPixels(gc.getFontMetrics(), IDialogConstants.BUTTON_WIDTH);
    gc.dispose();
    return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
}

From source file:org.ebayopensource.vjet.eclipse.internal.ui.preferences.VjetProblemSeveritiesConfigurationBlock.java

License:Open Source License

protected Combo addComboBox(Composite parent, String label, PreferenceKey key, String[] values,
        String[] valueLabels, int indent) {
    GridData gd = new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
    gd.horizontalIndent = indent;// w w  w  .j ava2s  .com

    Label labelControl = new Label(parent, SWT.LEFT);
    labelControl.setFont(JFaceResources.getDialogFont());
    labelControl.setText(label);
    labelControl.setLayoutData(gd);

    Combo comboBox = newComboControl(parent, key, values, valueLabels);
    comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

    return comboBox;
}

From source file:org.ebayopensource.vjet.eclipse.internal.ui.preferences.VjetProblemSeveritiesConfigurationBlock.java

License:Open Source License

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

    Combo comboBox = new Combo(composite, SWT.READ_ONLY);
    comboBox.setItems(valueLabels);/* w  ww .ja v a  2s .c o  m*/
    comboBox.setData(data);
    // comboBox.addSelectionListener(getSelectionListener());
    comboBox.setFont(JFaceResources.getDialogFont());

    makeScrollableCompositeAware(comboBox);

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

    return comboBox;
}