KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > preferences > DebugPreferencePage


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.internal.ui.preferences;
12
13 import org.eclipse.debug.internal.ui.DebugUIPlugin;
14 import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
15 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
16 import org.eclipse.debug.internal.ui.SWTFactory;
17 import org.eclipse.debug.ui.IDebugUIConstants;
18 import org.eclipse.jface.preference.BooleanFieldEditor;
19 import org.eclipse.jface.preference.ColorFieldEditor;
20 import org.eclipse.jface.preference.FieldEditorPreferencePage;
21 import org.eclipse.jface.preference.IPreferenceStore;
22 import org.eclipse.swt.SWT;
23 import org.eclipse.swt.widgets.Composite;
24 import org.eclipse.ui.IWorkbench;
25 import org.eclipse.ui.IWorkbenchPreferencePage;
26 import org.eclipse.ui.PlatformUI;
27
28 /**
29  * The page for setting debugger preferences. Built on the 'field editor' infrastructure.
30  */

31 public class DebugPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IDebugPreferenceConstants {
32     
33     public DebugPreferencePage() {
34         super(GRID);
35
36         IPreferenceStore store= DebugUIPlugin.getDefault().getPreferenceStore();
37         setPreferenceStore(store);
38         setDescription(DebugPreferencesMessages.DebugPreferencePage_1);
39     }
40
41     /* (non-Javadoc)
42      * @see org.eclipse.jface.preference.PreferencePage#createControl(Composite)
43      */

44     public void createControl(Composite parent) {
45         super.createControl(parent);
46         PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.DEBUG_PREFERENCE_PAGE);
47     }
48     
49     /**
50      * @see FieldEditorPreferencePage#createFieldEditors
51      */

52     protected void createFieldEditors() {
53         addField(new BooleanFieldEditor(IDebugUIConstants.PREF_REUSE_EDITOR, DebugPreferencesMessages.DebugPreferencePage_2, SWT.NONE, getFieldEditorParent()));
54         
55         SWTFactory.createHorizontalSpacer(getFieldEditorParent(), 2);
56         
57         addField(new BooleanFieldEditor(IDebugUIConstants.PREF_ACTIVATE_WORKBENCH, DebugPreferencesMessages.DebugPreferencePage_3, SWT.NONE, getFieldEditorParent()));
58         addField(new BooleanFieldEditor(IInternalDebugUIConstants.PREF_ACTIVATE_DEBUG_VIEW, DebugPreferencesMessages.DebugPreferencePage_26, SWT.NONE, getFieldEditorParent()));
59
60         SWTFactory.createHorizontalSpacer(getFieldEditorParent(), 2);
61         
62         addField(new BooleanFieldEditor(IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE, DebugPreferencesMessages.DebugPreferencePage_25, SWT.NONE, getFieldEditorParent()));
63         addField(new BooleanFieldEditor(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_ALL_BREAKPOINTS, DebugPreferencesMessages.DebugPreferencePage_29, SWT.NONE, getFieldEditorParent()));
64         addField(new BooleanFieldEditor(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_BREAKPOINTS_FROM_CONTAINER, DebugPreferencesMessages.DebugPreferencePage_30, SWT.NONE, getFieldEditorParent()));
65         
66         SWTFactory.createHorizontalSpacer(getFieldEditorParent(), 2);
67         ColorFieldEditor mem= new ColorFieldEditor(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR, DebugPreferencesMessages.DebugPreferencePage_4, getFieldEditorParent());
68         addField(mem);
69         mem = new ColorFieldEditor(IInternalDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND, DebugPreferencesMessages.DebugPreferencePage_28, getFieldEditorParent());
70         addField(mem);
71         mem= new ColorFieldEditor(IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR, DebugPreferencesMessages.DebugPreferencePage_0, getFieldEditorParent());
72         addField(mem);
73         mem= new ColorFieldEditor(IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR, DebugPreferencesMessages.DebugPreferencePage_27, getFieldEditorParent());
74         addField(mem);
75     }
76
77     /**
78      * @see IWorkbenchPreferencePage#init(IWorkbench)
79      */

80     public void init(IWorkbench workbench) {}
81                 
82 }
83
Popular Tags