001: package de.loskutov.bco.preferences;
002:
003: import org.eclipse.jface.preference.*;
004: import org.eclipse.ui.IWorkbenchPreferencePage;
005: import org.eclipse.ui.IWorkbench;
006:
007: import de.loskutov.bco.BytecodeOutlinePlugin;
008:
009: /**
010: * This class represents a preference page that is contributed to the
011: * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>,
012: * we can use the field support built into JFace that allows us to create a page
013: * that is small and knows how to save, restore and apply itself.
014: * <p>
015: * This page is used to modify preferences only. They are stored in the
016: * preference store that belongs to the main plug-in class. That way,
017: * preferences can be accessed directly via the preference store.
018: */
019: public class BCOPreferencePage extends FieldEditorPreferencePage
020: implements IWorkbenchPreferencePage {
021:
022: public BCOPreferencePage() {
023: super (GRID);
024: setPreferenceStore(BytecodeOutlinePlugin.getDefault()
025: .getPreferenceStore());
026: setDescription(BytecodeOutlinePlugin
027: .getResourceString("BCOPreferencePage.defaultsGroup"));
028: }
029:
030: /*
031: * Creates the field editors. Field editors are abstractions of the common GUI
032: * blocks needed to manipulate various types of preferences. Each field editor
033: * knows how to save and restore itself.
034: */
035: public void createFieldEditors() {
036:
037: addField(new BooleanFieldEditor(
038: BCOConstants.LINK_VIEW_TO_EDITOR,
039: BytecodeOutlinePlugin
040: .getResourceString("BCOPreferencePage.linkViewToEditor"), //$NON-NLS-1$
041: getFieldEditorParent()));
042:
043: addField(new BooleanFieldEditor(
044: BCOConstants.SHOW_ONLY_SELECTED_ELEMENT,
045: BytecodeOutlinePlugin
046: .getResourceString("BCOPreferencePage.showOnlySelected"), //$NON-NLS-1$
047: getFieldEditorParent()));
048:
049: addField(new BooleanFieldEditor(
050: BCOConstants.SHOW_RAW_BYTECODE,
051: BytecodeOutlinePlugin
052: .getResourceString("BCOPreferencePage.showRawBytecode"), //$NON-NLS-1$
053: getFieldEditorParent()));
054:
055: addField(new BooleanFieldEditor(
056: BCOConstants.SHOW_ASMIFIER_CODE,
057: BytecodeOutlinePlugin
058: .getResourceString("BCOPreferencePage.showAsmifierCode"), //$NON-NLS-1$
059: getFieldEditorParent()));
060:
061: addField(new BooleanFieldEditor(
062: BCOConstants.SHOW_ANALYZER,
063: BytecodeOutlinePlugin
064: .getResourceString("BCOPreferencePage.showAnalyzer"), //$NON-NLS-1$
065: getFieldEditorParent()));
066:
067: //
068: addField(new BooleanFieldEditor(
069: BCOConstants.SHOW_LINE_INFO,
070: BytecodeOutlinePlugin
071: .getResourceString("BCOPreferencePage.showLineInfo"), //$NON-NLS-1$
072: getFieldEditorParent()));
073:
074: addField(new BooleanFieldEditor(
075: BCOConstants.SHOW_VARIABLES,
076: BytecodeOutlinePlugin
077: .getResourceString("BCOPreferencePage.showVariables"), //$NON-NLS-1$
078: getFieldEditorParent()));
079:
080: addField(new BooleanFieldEditor(
081: BCOConstants.SHOW_STACKMAP,
082: BytecodeOutlinePlugin
083: .getResourceString("BCOPreferencePage.showStackMap"), //$NON-NLS-1$
084: getFieldEditorParent()));
085:
086: addField(new BooleanFieldEditor(
087: BCOConstants.EXPAND_STACKMAP,
088: BytecodeOutlinePlugin
089: .getResourceString("BCOPreferencePage.expandStackMap"), //$NON-NLS-1$
090: getFieldEditorParent()));
091:
092: // addField( new BooleanFieldEditor( BCOConstants.RECALCULATE_STACKMAP,
093: // BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.recalculateStackMap" ), //$NON-NLS-1$
094: // getFieldEditorParent() ) );
095: }
096:
097: /*
098: * (non-Javadoc)
099: *
100: * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
101: */
102: public void init(IWorkbench workbench) {
103: //
104: }
105:
106: }
|