KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > loskutov > bco > preferences > BCOPreferencePage


1
2 package de.loskutov.bco.preferences;
3
4 import org.eclipse.jface.preference.*;
5 import org.eclipse.ui.IWorkbenchPreferencePage;
6 import org.eclipse.ui.IWorkbench;
7
8 import de.loskutov.bco.BytecodeOutlinePlugin;
9
10
11 /**
12  * This class represents a preference page that is contributed to the
13  * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>,
14  * we can use the field support built into JFace that allows us to create a page
15  * that is small and knows how to save, restore and apply itself.
16  * <p>
17  * This page is used to modify preferences only. They are stored in the
18  * preference store that belongs to the main plug-in class. That way,
19  * preferences can be accessed directly via the preference store.
20  */

21 public class BCOPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
22
23   public BCOPreferencePage() {
24     super( GRID );
25     setPreferenceStore(BytecodeOutlinePlugin.getDefault()
26             .getPreferenceStore());
27     setDescription(BytecodeOutlinePlugin.getResourceString("BCOPreferencePage.defaultsGroup"));
28   }
29
30   /*
31    * Creates the field editors. Field editors are abstractions of the common GUI
32    * blocks needed to manipulate various types of preferences. Each field editor
33    * knows how to save and restore itself.
34    */

35   public void createFieldEditors() {
36
37     addField( new BooleanFieldEditor( BCOConstants.LINK_VIEW_TO_EDITOR,
38         BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.linkViewToEditor" ), //$NON-NLS-1$
39
getFieldEditorParent() ) );
40
41     addField( new BooleanFieldEditor( BCOConstants.SHOW_ONLY_SELECTED_ELEMENT,
42         BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.showOnlySelected" ), //$NON-NLS-1$
43
getFieldEditorParent() ) );
44     
45     addField( new BooleanFieldEditor( BCOConstants.SHOW_RAW_BYTECODE,
46         BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.showRawBytecode" ), //$NON-NLS-1$
47
getFieldEditorParent() ) );
48     
49     addField( new BooleanFieldEditor( BCOConstants.SHOW_ASMIFIER_CODE,
50         BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.showAsmifierCode" ), //$NON-NLS-1$
51
getFieldEditorParent() ) );
52     
53     addField( new BooleanFieldEditor( BCOConstants.SHOW_ANALYZER,
54         BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.showAnalyzer" ), //$NON-NLS-1$
55
getFieldEditorParent() ) );
56
57     //
58
addField( new BooleanFieldEditor( BCOConstants.SHOW_LINE_INFO,
59         BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.showLineInfo" ), //$NON-NLS-1$
60
getFieldEditorParent() ) );
61     
62     addField( new BooleanFieldEditor( BCOConstants.SHOW_VARIABLES,
63         BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.showVariables" ), //$NON-NLS-1$
64
getFieldEditorParent() ) );
65     
66     addField( new BooleanFieldEditor( BCOConstants.SHOW_STACKMAP,
67         BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.showStackMap" ), //$NON-NLS-1$
68
getFieldEditorParent() ) );
69     
70     addField( new BooleanFieldEditor( BCOConstants.EXPAND_STACKMAP,
71         BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.expandStackMap" ), //$NON-NLS-1$
72
getFieldEditorParent() ) );
73     
74     // addField( new BooleanFieldEditor( BCOConstants.RECALCULATE_STACKMAP,
75
// BytecodeOutlinePlugin.getResourceString( "BCOPreferencePage.recalculateStackMap" ), //$NON-NLS-1$
76
// getFieldEditorParent() ) );
77
}
78
79   /*
80    * (non-Javadoc)
81    *
82    * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
83    */

84   public void init( IWorkbench workbench ) {
85       //
86
}
87
88 }
89
Popular Tags