package net.mograsim.plugin;
import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.ComboFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.swt.widgets.Composite;
public class MainPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage
{
+ private static final String[][] MOUSE_BUTTONS = { { "left", "1" }, { "middle", "2" }, { "right", "3" }, { "4th", "4" },
+ { "5th", "5" } };
+
public MainPreferencePage()
{
super(GRID);
Composite parent = getFieldEditorParent();
addField(new BooleanFieldEditor("net.mograsim.logic.model.debug.openhlsshell", "Open the debug HLS shell", parent));
addField(new IntegerFieldEditor("net.mograsim.logic.model.debug.hlsshelldepth",
- "Depth of components to list in the debug HLS shell", parent));
- IntegerFieldEditor editor;
- editor = new IntegerFieldEditor("net.mograsim.logic.model.button.action", "Mouse button for actions", parent);
- editor.setValidRange(1, 5);
- addField(editor);
- editor = new IntegerFieldEditor("net.mograsim.logic.model.button.drag", "Mouse button for dragging", parent);
- editor.setValidRange(1, 5);
- addField(editor);
- editor = new IntegerFieldEditor("net.mograsim.logic.model.button.zoom", "Mouse button for zooming", parent);
- editor.setValidRange(1, 5);
- addField(editor);
+ "Depth of components to list in the debug HLS shell (0: unbounded)", parent));
+ addField(new ComboFieldEditor("net.mograsim.logic.model.button.action", "Mouse button for actions", MOUSE_BUTTONS, parent));
+ addField(new ComboFieldEditor("net.mograsim.logic.model.button.drag", "Mouse button for dragging", MOUSE_BUTTONS, parent));
+ addField(new ComboFieldEditor("net.mograsim.logic.model.button.zoom", "Mouse button for zooming", MOUSE_BUTTONS, parent));
// TODO add other preferences
}
}
\ No newline at end of file