Example usage for org.eclipse.jface.preference StringFieldEditor getLabelControl

List of usage examples for org.eclipse.jface.preference StringFieldEditor getLabelControl

Introduction

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

Prototype

public Label getLabelControl(Composite parent) 

Source Link

Document

Returns this field editor's label component.

Usage

From source file:org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsCategoryPropertyOptionPage.java

License:Open Source License

protected void createFieldEditors() {
    super.createFieldEditors();
    Composite parent = getFieldEditorParent();
    //      FontMetrics fm = AbstractCPropertyTab.getFontMetrics(parent);
    AutotoolsConfiguration.Option[] options = AutotoolsConfiguration.getChildOptions(catName);
    for (int i = 0; i < options.length; ++i) {
        AutotoolsConfiguration.Option option = options[i];
        switch (option.getType()) {
        case IConfigureOption.STRING:
        case IConfigureOption.INTERNAL:
        case IConfigureOption.MULTIARG:
            parent = getFieldEditorParent();
            StringFieldEditor f = new StringFieldEditor(option.getName(), option.getDescription(), 20, parent);
            f.getLabelControl(parent).setToolTipText(option.getToolTip());
            addField(f);/*from  w  w w  . j  a  v  a  2s.co  m*/
            fieldEditors.add(f);
            break;
        case IConfigureOption.BIN:
            parent = getFieldEditorParent();
            BooleanFieldEditor b = new BooleanFieldEditor(option.getName(), option.getDescription(), parent);
            b.getDescriptionControl(parent).setToolTipText(option.getToolTip());
            addField(b);
            fieldEditors.add(b);
            break;
        }
    }
}

From source file:org.polymap.service.ui.GeneralPreferencePage.java

License:Open Source License

protected void createFieldEditors() {
    Composite fieldParent = getFieldEditorParent();
    StringFieldEditor proxyUrlEditor = new StringFieldEditor(ServicesPlugin.PREF_PROXY_URL,
            Messages.get("GeneralPreferencesPage_proxyUrlLabel"), fieldParent);
    addField(proxyUrlEditor);//  ww  w.  ja v  a2 s.  c o  m
    proxyUrlEditor.getLabelControl(fieldParent)
            .setToolTipText(Messages.get("GeneralPreferencesPage_proxyUrlTip"));
    proxyUrlEditor.getTextControl(fieldParent)
            .setToolTipText(Messages.get("GeneralPreferencesPage_proxyUrlTip"));
}

From source file:org.robotframework.ide.eclipse.main.plugin.preferences.ContentAssistPreferencePage.java

License:Apache License

protected void createAutoActivationEditors(final Composite parent) {
    final Group autoActivationGroup = new Group(parent, SWT.NONE);
    autoActivationGroup.setText("Auto activation");
    GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(autoActivationGroup);
    GridLayoutFactory.fillDefaults().applyTo(autoActivationGroup);

    final BooleanFieldEditor autoActivationEnabled = new BooleanFieldEditor(
            RedPreferences.ASSISTANT_AUTO_ACTIVATION_ENABLED, "Auto activation enabled", autoActivationGroup);
    addField(autoActivationEnabled);/*from w w  w  . j av  a  2  s .  co  m*/
    final Button button = (Button) autoActivationEnabled.getDescriptionControl(autoActivationGroup);
    GridDataFactory.fillDefaults().indent(5, 10).applyTo(button);
    final boolean isAutoActivationEnabled = RedPlugin.getDefault().getPreferences()
            .isAssistantAutoActivationEnabled();

    final IntegerFieldEditor autoActivationDelay = new IntegerFieldEditor(
            RedPreferences.ASSISTANT_AUTO_ACTIVATION_DELAY, "Auto activation delay (ms)", autoActivationGroup,
            3);
    addField(autoActivationDelay);
    delayTextControl = autoActivationDelay.getTextControl(autoActivationGroup);
    delayTextControl.setEnabled(isAutoActivationEnabled);
    GridDataFactory.fillDefaults().indent(25, 2)
            .applyTo(autoActivationDelay.getLabelControl(autoActivationGroup));

    final StringFieldEditor autoActivationChars = new StringFieldEditor(
            RedPreferences.ASSISTANT_AUTO_ACTIVATION_CHARS, "Auto activation triggers", autoActivationGroup);
    addField(autoActivationChars);
    charsTextControl = autoActivationChars.getTextControl(autoActivationGroup);
    charsTextControl.setEnabled(isAutoActivationEnabled);
    GridDataFactory.fillDefaults().indent(25, 2)
            .applyTo(autoActivationChars.getLabelControl(autoActivationGroup));

    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            delayTextControl.setEnabled(button.getSelection());
            charsTextControl.setEnabled(button.getSelection());
        }
    });

}

From source file:org.robotframework.ide.eclipse.main.plugin.preferences.DefaultLaunchConfigurationPreferencePage.java

License:Apache License

private void createRobotLaunchConfigurationPreferences(final Composite parent) {
    final Group group = new Group(parent, SWT.NONE);
    group.setText("Robot tab");
    GridLayoutFactory.fillDefaults().applyTo(group);
    GridDataFactory.fillDefaults().grab(true, false).indent(0, 10).span(2, 1).applyTo(group);

    final StringFieldEditor additionalRobotArguments = new StringFieldEditor(
            RedPreferences.LAUNCH_ADDITIONAL_ROBOT_ARGUMENTS, "Additional Robot Framework arguments:", group);
    additionalRobotArguments.load();//w  ww .j  a va2s  .  c o  m
    addField(additionalRobotArguments);

    GridDataFactory.fillDefaults().grab(true, false).applyTo(additionalRobotArguments.getLabelControl(group));
}

From source file:org.springframework.ide.eclipse.boot.ui.preferences.BootPreferencePage.java

License:Open Source License

private void setTooltip(Composite parent, StringFieldEditor fe, String tooltip) {
    fe.getLabelControl(parent).setToolTipText(tooltip);
    fe.getTextControl(parent).setToolTipText(tooltip);
}

From source file:org.springframework.ide.eclipse.boot.ui.preferences.InitializrPreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    Composite parent = getFieldEditorParent();

    StringFieldEditor initializrUrl = new StringFieldEditor(PREF_INITIALIZR_URL, LABEL_INITIALIZR_URL, parent) {

        @Override//from  w  w  w. ja  v  a 2 s  . c  o  m
        protected boolean checkState() {
            // Checks if string has a correct URL format 
            Text text = getTextControl();
            if (text == null) {
                return false;
            }
            try {
                new URL(text.getText());
                clearErrorMessage();
                return true;
            } catch (MalformedURLException e) {
                setErrorMessage(MSG_INVALID_URL_FORMAT);
                showErrorMessage();
                return false;
            }
        }

    };

    initializrUrl.getLabelControl(parent).setToolTipText(TOOLTIP_INITIALIZR_URL);
    initializrUrl.getTextControl(parent).setToolTipText(TOOLTIP_INITIALIZR_URL);
    addField(initializrUrl);

}

From source file:tinyos.dlrc.environment.basic.preferences.AbstractEnvironmentPreferencePage.java

License:Open Source License

protected void setTooltip(StringFieldEditor editor, String tooltip) {
    editor.getLabelControl(getFieldEditorParent()).setToolTipText(tooltip);
    editor.getTextControl(getFieldEditorParent()).setToolTipText(tooltip);
}