Example usage for org.eclipse.jface.preference ScaleFieldEditor ScaleFieldEditor

List of usage examples for org.eclipse.jface.preference ScaleFieldEditor ScaleFieldEditor

Introduction

In this page you can find the example usage for org.eclipse.jface.preference ScaleFieldEditor ScaleFieldEditor.

Prototype

public ScaleFieldEditor(String name, String labelText, Composite parent) 

Source Link

Document

Creates a scale field editor.

Usage

From source file:org.eclipse.titan.designer.preferences.pages.DebugPreferencePage.java

License:Open Source License

private void createLoadBalancingSection(final Composite parent) {
    ExpandableComposite expandable = createExtendableComposite(parent, "Load balancing");
    Composite comp = new Composite(expandable, SWT.NONE);
    comp.setLayout(new GridLayout(2, false));
    comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    expandable.setClient(comp);//  ww w.j a  v  a  2 s.  c  o  m
    expandable.setExpanded(false);
    IntegerFieldEditor tokens = new IntegerFieldEditor(
            PreferenceConstants.DEBUG_LOAD_TOKENS_TO_PROCESS_IN_A_ROW,
            "Tokens to process between thread switches", comp);
    tokens.setValidRange(0, Integer.MAX_VALUE);
    addField(tokens);

    ScaleFieldEditor threadPriority = new ScaleFieldEditor(PreferenceConstants.DEBUG_LOAD_THREAD_PRIORITY,
            "Thread priority", comp);
    threadPriority.setMinimum(Thread.MIN_PRIORITY);
    threadPriority.setMaximum(Thread.MAX_PRIORITY);
    threadPriority.setIncrement(1);
    threadPriority.getScaleControl()
            .setToolTipText("Sets the priority of the threads created by the syntax analyzer.");
    addField(threadPriority);

    IntegerFieldEditor sleepBetweenFiles = new IntegerFieldEditor(
            PreferenceConstants.DEBUG_LOAD_SLEEP_BETWEEN_FILES,
            "Sleep the syntax analyzer thread after processing a single file(-1 to do not sleep at all)", comp);
    sleepBetweenFiles.setValidRange(-1, Integer.MAX_VALUE);
    addField(sleepBetweenFiles);

    BooleanFieldEditor yieldBetweenChecks = new BooleanFieldEditor(
            PreferenceConstants.DEBUG_LOAD_YIELD_BETWEEN_CHECKS,
            "Switch thread after semantically checking modules or definitions.", comp);
    addField(yieldBetweenChecks);
}

From source file:pt.org.aguiaj.core.AguiaJPreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {

    ScaleFieldEditor fontSize = new ScaleFieldEditor(PreferencesParam.FONTSIZE.name(),
            PreferencesParam.FONTSIZE.description, getFieldEditorParent()) {
        {/*from   w  w  w . j  a v  a 2  s. c om*/
            setMinimum(10);
            setMaximum(20);
            setIncrement(1);
        }
    };
    addField(fontSize);

    String[][] fontFaceValues = { { "Verdana", "Verdana" }, { "Arial", "Arial" }, { "Courier", "Courier" },
            { "Times", "Times" } };
    ComboFieldEditor fontFace = new ComboFieldEditor(PreferencesParam.FONTFACE.name(),
            PreferencesParam.FONTFACE.description, fontFaceValues, getFieldEditorParent());
    addField(fontFace);

    IntegerFieldEditor methodTimeOut = new IntegerFieldEditor(METHOD_TIMEOUT.name(), "Method timeout",
            getFieldEditorParent()) {
        {
            setValidRange(1, 10);
        }
    };

    IntegerFieldEditor javaBarFontSize = new IntegerFieldEditor(JAVABAR_FONT.name(), "Java Bar font size",
            getFieldEditorParent()) {
        {
            setValidRange(10, 32);
        }
    };
    addField(javaBarFontSize);

    addField(methodTimeOut);

    addAccessorPolicies();
    //      addEncapsulationPolicy();
}