1 19 20 package org.netbeans.modules.debugger.ui.models; 21 22 import java.util.Vector ; 23 24 import org.netbeans.api.debugger.Watch; 25 import org.netbeans.spi.viewmodel.NodeModel; 26 import org.netbeans.spi.viewmodel.TreeModel; 27 import org.netbeans.spi.viewmodel.ModelListener; 28 import org.netbeans.spi.viewmodel.UnknownTypeException; 29 import org.openide.util.NbBundle; 30 31 34 public class WatchesNodeModel implements NodeModel { 35 36 public static final String WATCH = 37 "org/netbeans/modules/debugger/resources/watchesView/Watch"; 38 39 private Vector listeners = new Vector (); 40 41 42 public String getDisplayName (Object o) throws UnknownTypeException { 43 if (o == TreeModel.ROOT) 44 return NbBundle.getBundle(WatchesNodeModel.class).getString("CTL_WatchesModel_Column_Name_Name"); 45 if (o instanceof Watch) 46 return ((Watch) o).getExpression (); 47 throw new UnknownTypeException (o); 48 } 49 50 public String getShortDescription (Object o) throws UnknownTypeException { 51 if (o == TreeModel.ROOT) 52 return TreeModel.ROOT; 53 if (o instanceof Watch) { 54 Watch w = (Watch) o; 55 return w.getExpression () + NbBundle.getBundle(WatchesNodeModel.class).getString("CTL_WatchesModel_Column_NameNoContext_Desc"); 56 } 57 throw new UnknownTypeException (o); 58 } 59 60 public String getIconBase (Object o) throws UnknownTypeException { 61 if (o == TreeModel.ROOT) 62 return WATCH; 63 if (o instanceof Watch) 64 return WATCH; 65 throw new UnknownTypeException (o); 66 } 67 68 72 public void addModelListener (ModelListener l) { 73 listeners.add (l); 74 } 75 76 80 public void removeModelListener (ModelListener l) { 81 listeners.remove (l); 82 } 83 84 } 85 | Popular Tags |