1 11 package org.eclipse.jdt.internal.debug.ui.actions; 12 13 14 import org.eclipse.debug.ui.IDebugModelPresentation; 15 import org.eclipse.debug.ui.IDebugView; 16 import org.eclipse.jdt.debug.core.JDIDebugModel; 17 import org.eclipse.jdt.internal.debug.ui.IJDIPreferencesConstants; 18 import org.eclipse.jdt.internal.debug.ui.JDIModelPresentation; 19 import org.eclipse.jface.action.IAction; 20 import org.eclipse.jface.preference.IPreferenceStore; 21 import org.eclipse.jface.viewers.StructuredViewer; 22 import org.eclipse.jface.viewers.Viewer; 23 import org.eclipse.swt.custom.BusyIndicator; 24 25 29 public class ShowQualifiedAction extends ViewFilterAction { 30 31 34 protected String getPreferenceKey() { 35 return IJDIPreferencesConstants.PREF_SHOW_QUALIFIED_NAMES; 36 } 37 38 44 public boolean select(Viewer viewer, Object parentElement, Object element) { 45 return true; 46 } 47 48 51 public void run(IAction action) { 52 final StructuredViewer viewer = getStructuredViewer(); 53 IDebugView view = (IDebugView)getView().getAdapter(IDebugView.class); 54 if (view != null) { 55 IDebugModelPresentation pres = view.getPresentation(JDIDebugModel.getPluginIdentifier()); 56 if (pres != null) { 57 pres.setAttribute(JDIModelPresentation.DISPLAY_QUALIFIED_NAMES, (getValue() ? Boolean.TRUE : Boolean.FALSE)); 58 BusyIndicator.showWhile(viewer.getControl().getDisplay(), new Runnable () { 59 public void run() { 60 viewer.refresh(); 61 IPreferenceStore store = getPreferenceStore(); 62 String key = getView().getSite().getId() + "." + getPreferenceKey(); store.setValue(key, getValue()); 64 } 65 }); 66 } 67 } 68 } 69 } 70 | Popular Tags |