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.IJavaDebugTarget; 16 import org.eclipse.jdt.internal.debug.core.model.JDIArrayEntryVariable; 17 import org.eclipse.jdt.internal.debug.ui.IJDIPreferencesConstants; 18 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; 19 import org.eclipse.jface.viewers.Viewer; 20 21 24 public class ShowNullArrayEntriesAction extends ViewFilterAction { 25 26 public ShowNullArrayEntriesAction() { 27 super(); 28 } 29 30 33 protected String getPreferenceKey() { 34 return IJDIPreferencesConstants.PREF_SHOW_NULL_ARRAY_ENTRIES; 35 } 36 37 40 public boolean select(Viewer viewer, Object parentElement, Object element) { 41 if (getValue()) { 42 return true; 44 } 45 if (element instanceof JDIArrayEntryVariable) { 46 JDIArrayEntryVariable variable = (JDIArrayEntryVariable)element; 47 try { 48 return !variable.getValue().equals(((IJavaDebugTarget)variable.getDebugTarget()).nullValue()); 49 } catch (DebugException e) { 50 JDIDebugUIPlugin.log(e); 51 } 52 } 53 return true; 54 } 55 } 56 | Popular Tags |