1 11 package org.eclipse.jdt.internal.debug.ui.actions; 12 13 14 import org.eclipse.debug.core.DebugException; 15 import org.eclipse.jdt.debug.core.IJavaVariable; 16 import org.eclipse.jdt.internal.debug.ui.IJDIPreferencesConstants; 17 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; 18 import org.eclipse.jface.viewers.Viewer; 19 20 23 public class ShowConstantsAction extends ViewFilterAction { 24 25 public ShowConstantsAction() { 26 super(); 27 } 28 29 32 protected String getPreferenceKey() { 33 return IJDIPreferencesConstants.PREF_SHOW_CONSTANTS; 34 } 35 36 39 public boolean select(Viewer viewer, Object parentElement, Object element) { 40 if (element instanceof IJavaVariable) { 41 IJavaVariable variable = (IJavaVariable)element; 42 try { 43 if (!getValue()) { 44 return !(variable.isStatic() && variable.isFinal()); 46 } 47 } catch (DebugException e) { 48 JDIDebugUIPlugin.log(e); 49 } 50 } 51 return true; 52 } 53 } 54 | Popular Tags |