KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > JDIDebugUIPreferenceInitializer


1 /*******************************************************************************
2  * Copyright (c) 2004, 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  * Steffan Larson - Bug 162368 Include JRockit-internal classes in the default
11  * step filters
12  *******************************************************************************/

13 package org.eclipse.jdt.internal.debug.ui;
14
15 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
16 import org.eclipse.jdt.debug.ui.IJavaDebugUIConstants;
17 import org.eclipse.jface.preference.IPreferenceStore;
18 import org.eclipse.jface.util.PropertyChangeEvent;
19
20 public class JDIDebugUIPreferenceInitializer extends AbstractPreferenceInitializer {
21
22     public JDIDebugUIPreferenceInitializer() {
23         super();
24     }
25
26     /*
27      * (non-Javadoc)
28      *
29      * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
30      */

31     public void initializeDefaultPreferences() {
32         IPreferenceStore store = JDIDebugUIPlugin.getDefault().getPreferenceStore();
33         store.setDefault(IJDIPreferencesConstants.PREF_SUSPEND_ON_COMPILATION_ERRORS, true);
34         store.setDefault(IJDIPreferencesConstants.PREF_SUSPEND_ON_UNCAUGHT_EXCEPTIONS, true);
35         store.setDefault(IJDIPreferencesConstants.PREF_ALERT_HCR_FAILED, true);
36         store.setDefault(IJDIPreferencesConstants.PREF_ALERT_HCR_NOT_SUPPORTED, true);
37         store.setDefault(IJDIPreferencesConstants.PREF_ALERT_OBSOLETE_METHODS, true);
38         store.setDefault(IJDIPreferencesConstants.PREF_ALERT_UNABLE_TO_INSTALL_BREAKPOINT, true);
39
40         store.setDefault(IJDIPreferencesConstants.PREF_SHOW_QUALIFIED_NAMES, false);
41         
42         // JavaStepFilterPreferencePage
43
store.setDefault(IJDIPreferencesConstants.PREF_ACTIVE_FILTERS_LIST, "java.lang.ClassLoader"); //$NON-NLS-1$
44
store.setDefault(IJDIPreferencesConstants.PREF_INACTIVE_FILTERS_LIST, "com.ibm.*,com.sun.*,java.*,javax.*,jrockit.*,org.omg.*,sun.*,sunw.*"); //$NON-NLS-1$
45
store.setDefault(IJDIPreferencesConstants.PREF_STEP_THRU_FILTERS, true);
46         
47         store.setDefault(IJDIPreferencesConstants.PREF_SHOW_CONSTANTS, false);
48         store.setDefault(IJDIPreferencesConstants.PREF_SHOW_STATIC_VARIALBES, false);
49         store.setDefault(IJDIPreferencesConstants.PREF_SHOW_CHAR, false);
50         store.setDefault(IJDIPreferencesConstants.PREF_SHOW_HEX, false);
51         store.setDefault(IJDIPreferencesConstants.PREF_SHOW_UNSIGNED, false);
52         store.setDefault(IJDIPreferencesConstants.PREF_SHOW_NULL_ARRAY_ENTRIES, true);
53         store.setDefault(IJDIPreferencesConstants.PREF_SHOW_DETAILS, IJDIPreferencesConstants.DETAIL_PANE);
54         
55         store.setDefault(IJavaDebugUIConstants.PREF_SHOW_SYSTEM_THREADS, false);
56         store.setDefault(IJavaDebugUIConstants.PREF_SHOW_MONITOR_THREAD_INFO, false);
57         store.setDefault(IJavaDebugUIConstants.PREF_SHOW_THREAD_GROUPS, false);
58         store.setDefault(IJDIPreferencesConstants.PREF_OPEN_INSPECT_POPUP_ON_EXCEPTION, false);
59         store.setDefault(IJavaDebugUIConstants.PREF_ALLINSTANCES_MAX_COUNT, 100);
60         store.setDefault(IJavaDebugUIConstants.PREF_ALLREFERENCES_MAX_COUNT, 100);
61     }
62     
63     /**
64      * Returns the boolean value from the given property change event.
65      *
66      * @param event property change event
67      * @return new boolean value from the event
68      */

69     public static boolean getBoolean(PropertyChangeEvent event) {
70         Object JavaDoc newValue = event.getNewValue();
71         if (newValue instanceof String JavaDoc) {
72             return ((IPreferenceStore)event.getSource()).getBoolean(event.getProperty());
73         } else {
74             return ((Boolean JavaDoc)newValue).booleanValue();
75         }
76     }
77 }
78
Popular Tags