Search in sources :

Example 11 with RadioGroupFieldEditor

use of org.eclipse.jface.preference.RadioGroupFieldEditor in project ch.hsr.ifs.cdttesting by IFS-HSR.

the class PreferencePage method createFieldEditors.

@Override
public void createFieldEditors() {
    final String[][] labelAndValues = { { "By &hovering over the node", PreferenceConstants.P_SELECT_BY_MOUSE_OVER }, { "By &left click", PreferenceConstants.P_SELECT_BY_LEFT_CLICK }, { "By &right click", PreferenceConstants.P_SELECT_BY_RIGHT_CLICK } };
    addField(new RadioGroupFieldEditor(PreferenceConstants.P_HOW_TO_SELECT, "How shall the displayed node be selected?", 1, labelAndValues, getFieldEditorParent()));
}
Also used : RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor)

Example 12 with RadioGroupFieldEditor

use of org.eclipse.jface.preference.RadioGroupFieldEditor in project tdi-studio-se by Talend.

the class HL7DragAndDrogDialog method createDialogArea.

/*
     * (non-Javadoc) Method declared on Dialog.
     */
protected Control createDialogArea(Composite parent) {
    // create composite
    Composite composite = (Composite) super.createDialogArea(parent);
    // composite.setLayout(new GridLayout());
    String[][] namevalues = null;
    if (hideAttr) {
        namevalues = new String[][] { { "Create as sub-element of target node", CREATE_AS_SUBELEMENT }, { "Add linker to target node", CREATE_AS_TEXT } };
    } else {
        namevalues = new String[][] { { "Create as sub-element of target node", CREATE_AS_SUBELEMENT }, { "Create as attribute of target node", CREATE_AS_ATTRIBUTE }, { "Add linker to target node", CREATE_AS_TEXT } };
    }
    RadioGroupFieldEditor rgfe = new RadioGroupFieldEditor("", "Select the operation:", 1, namevalues, composite, true);
    GridLayout layout = new GridLayout();
    layout.marginWidth = 12;
    composite.setLayout(layout);
    rgfe.setPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent event) {
            value = event.getNewValue().toString();
        }
    });
    applyDialogFont(composite);
    return composite;
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor) GridLayout(org.eclipse.swt.layout.GridLayout) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) Composite(org.eclipse.swt.widgets.Composite)

Example 13 with RadioGroupFieldEditor

use of org.eclipse.jface.preference.RadioGroupFieldEditor in project linuxtools by eclipse.

the class MacroProposalsPreferencePage method createFieldEditors.

@Override
protected void createFieldEditors() {
    ListEditor macroListEditor = new MacroListEditor(PreferenceConstants.P_MACRO_PROPOSALS_FILESPATH, Messages.MacroProposalsPreferencePage_0, getFieldEditorParent());
    addField(macroListEditor);
    RadioGroupFieldEditor macroHoverListEditor = new RadioGroupFieldEditor(PreferenceConstants.P_MACRO_HOVER_CONTENT, Messages.MacroProposalsPreferencePage_1, 1, new String[][] { { Messages.MacroProposalsPreferencePage_2, PreferenceConstants.P_MACRO_HOVER_CONTENT_VIEWDESCRIPTION }, { Messages.MacroProposalsPreferencePage_3, PreferenceConstants.P_MACRO_HOVER_CONTENT_VIEWCONTENT } }, getFieldEditorParent(), true);
    addField(macroHoverListEditor);
}
Also used : ListEditor(org.eclipse.jface.preference.ListEditor) RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor)

Example 14 with RadioGroupFieldEditor

use of org.eclipse.jface.preference.RadioGroupFieldEditor in project linuxtools by eclipse.

the class RpmProposalsPreferencePage method rpmtoolsRadioGroupFieldEditor.

private FieldEditor rpmtoolsRadioGroupFieldEditor() {
    ArrayList<String[]> list = new ArrayList<>();
    list.add(new String[] { Messages.RpmProposalsPreferencePage_3, PreferenceConstants.DP_RPMTOOLS_RPM });
    /*
		 * Show only installed tools. Don't forgot to add sanity check in
		 * UiUtils.pluginSanityCheck().
		 */
    if (Files.exists(Paths.get("/usr/bin/yum"))) {
        // $NON-NLS-1$
        list.add(new String[] { Messages.RpmProposalsPreferencePage_4, PreferenceConstants.DP_RPMTOOLS_YUM });
    }
    if (Files.exists(Paths.get("/usr/bin/urpmq"))) {
        // $NON-NLS-1$
        list.add(new String[] { Messages.RpmProposalsPreferencePage_5, PreferenceConstants.DP_RPMTOOLS_URPM });
    }
    String[][] radioItems = new String[list.size()][2];
    int pos = 0;
    for (String[] item : list) {
        radioItems[pos][0] = item[0];
        radioItems[pos][1] = item[1];
        pos++;
    }
    RadioGroupFieldEditor rpmToolsRadioGroupEditor = new RadioGroupFieldEditor(PreferenceConstants.P_CURRENT_RPMTOOLS, Messages.RpmProposalsPreferencePage_6, 1, radioItems, getFieldEditorParent(), true);
    return rpmToolsRadioGroupEditor;
}
Also used : RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor) ArrayList(java.util.ArrayList)

Example 15 with RadioGroupFieldEditor

use of org.eclipse.jface.preference.RadioGroupFieldEditor in project linuxtools by eclipse.

the class PathPreferencePage method createFieldEditors.

@Override
public void createFieldEditors() {
    Composite parent = getFieldEditorParent();
    String[][] labels = { // $NON-NLS-1$
    { Localization.getString("PathPreferencePage.LocalMachine"), LOCAL }, // $NON-NLS-1$
    { Localization.getString("PathPreferencePage.RemoteMachine"), REMOTE } };
    RadioGroupFieldEditor radioEditor = new RadioGroupFieldEditor(IDEPreferenceConstants.P_REMOTE_LOCAL_KERNEL_SOURCE, // $NON-NLS-1$
    Localization.getString("PathPreferencePage.RemoteOrLocalRadio"), // $NON-NLS-1$
    1, // $NON-NLS-1$
    labels, // $NON-NLS-1$
    parent, // $NON-NLS-1$
    true) {

        @Override
        protected void fireValueChanged(String property, Object oldValue, Object newValue) {
            super.fireValueChanged(property, oldValue, newValue);
            if (!oldValue.equals(newValue) && directoryEditor != null) {
                if (newValue.equals(REMOTE))
                    directoryEditor.setRemote(true, getFieldEditorParent());
                else
                    directoryEditor.setRemote(false, getFieldEditorParent());
            }
        }
    };
    addField(radioEditor);
    IPreferenceStore p = IDEPlugin.getDefault().getPreferenceStore();
    String remoteOrLocal = p.getString(IDEPreferenceConstants.P_REMOTE_LOCAL_KERNEL_SOURCE);
    boolean remote;
    if (remoteOrLocal.equals(REMOTE))
        remote = true;
    else
        remote = false;
    directoryEditor = new LocalRemoteDirectoryEditor(IDEPreferenceConstants.P_KERNEL_SOURCE, Localization.getString("PathPreferencePage.KernelSourceDirectory"), parent, // $NON-NLS-1$
    remote);
    addField(directoryEditor);
    addField(new ListEditor(IDEPreferenceConstants.P_EXCLUDED_KERNEL_SOURCE, Localization.getString("PathPreferencePage.ExcludedSourceFolders"), Localization.getString("PathPreferencePage.ExcludedDirectory"), "", new DirectoryValidator(), // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    parent));
}
Also used : RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor) Composite(org.eclipse.swt.widgets.Composite) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore)

Aggregations

RadioGroupFieldEditor (org.eclipse.jface.preference.RadioGroupFieldEditor)23 BooleanFieldEditor (org.eclipse.jface.preference.BooleanFieldEditor)12 Composite (org.eclipse.swt.widgets.Composite)12 IntegerFieldEditor (org.eclipse.jface.preference.IntegerFieldEditor)5 StringFieldEditor (org.eclipse.jface.preference.StringFieldEditor)5 GridLayout (org.eclipse.swt.layout.GridLayout)5 Label (org.eclipse.swt.widgets.Label)4 ComboFieldEditor (org.eclipse.jface.preference.ComboFieldEditor)3 DirectoryFieldEditor (org.eclipse.jface.preference.DirectoryFieldEditor)3 GridData (org.eclipse.swt.layout.GridData)3 Group (org.eclipse.swt.widgets.Group)3 IPropertyChangeListener (org.eclipse.jface.util.IPropertyChangeListener)2 PropertyChangeEvent (org.eclipse.jface.util.PropertyChangeEvent)2 Control (org.eclipse.swt.widgets.Control)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 TraceType (org.csstudio.javafx.rtplot.TraceType)1 ArchiveRescale (org.csstudio.trends.databrowser3.model.ArchiveRescale)1 DefaultScope (org.eclipse.core.runtime.preferences.DefaultScope)1 IPreferenceChangeListener (org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener)1