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()));
}
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;
}
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);
}
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;
}
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));
}
Aggregations