1 11 package org.eclipse.jdt.internal.debug.ui.monitors; 12 13 import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider; 14 import org.eclipse.debug.ui.IDebugUIConstants; 15 import org.eclipse.jdt.debug.ui.IJavaDebugUIConstants; 16 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; 17 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPreferenceInitializer; 18 import org.eclipse.jface.preference.IPreferenceStore; 19 import org.eclipse.jface.util.IPropertyChangeListener; 20 import org.eclipse.jface.util.PropertyChangeEvent; 21 22 27 public abstract class JavaElementContentProvider extends ElementContentProvider { 28 29 protected Object [] EMPTY = new Object [0]; 30 31 private static boolean fgDisplayMonitors; 32 private static boolean fgDisplayThreadGroups; 33 34 static { 35 IPreferenceStore preferenceStore = JDIDebugUIPlugin.getDefault().getPreferenceStore(); 36 preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() { 37 public void propertyChange(PropertyChangeEvent event) { 38 if (event.getProperty().equals(IJavaDebugUIConstants.PREF_SHOW_MONITOR_THREAD_INFO)) { 39 fgDisplayMonitors= JDIDebugUIPreferenceInitializer.getBoolean(event); 40 } else if (event.getProperty().equals(IJavaDebugUIConstants.PREF_SHOW_THREAD_GROUPS)) { 41 fgDisplayThreadGroups= JDIDebugUIPreferenceInitializer.getBoolean(event); 42 } 43 } 44 45 }); 46 fgDisplayMonitors= preferenceStore.getBoolean(IJavaDebugUIConstants.PREF_SHOW_MONITOR_THREAD_INFO); 47 fgDisplayThreadGroups = preferenceStore.getBoolean(IJavaDebugUIConstants.PREF_SHOW_THREAD_GROUPS); 48 } 49 50 public static boolean isDisplayThreadGroups() { 51 return fgDisplayThreadGroups; 52 } 53 54 public static boolean isDisplayMonitors() { 55 return fgDisplayMonitors; 56 } 57 58 61 protected boolean supportsContextId(String id) { 62 return IDebugUIConstants.ID_DEBUG_VIEW.equals(id); 63 } 64 65 } 66 | Popular Tags |