1 19 20 package org.netbeans.modules.mdrxml.looks; 21 22 import java.util.Collection ; 23 import java.util.Iterator ; 24 import org.netbeans.api.looks.*; 25 import org.netbeans.spi.looks.*; 26 import org.netbeans.api.mdr.*; 27 import org.openide.util.NbBundle; 28 import xmlmodel.TextNode; 29 33 public class TextNodeLook extends ElementNodeLook { 34 35 private static final String ICON = "org/netbeans/modules/mdrxml/resources/textNode"; 36 37 38 39 public TextNodeLook() { 40 super(NbBundle.getMessage(TextNodeLook.class, "TXT_TextNodeLook")); 41 } 42 43 46 public String getName(Look.NodeSubstitute substitute) { 47 try { 48 String result = ((TextNode)substitute.getRepresentedObject()).getName(); 49 if (result == null) 50 result = ""; if (result.length() > 20) 52 result = result.substring(0,20)+ "..."; 53 return result; 54 }catch (javax.jmi.reflect.InvalidObjectException ioe) { 55 return new String (); 56 } 57 } 58 59 public String iconBase(Look.NodeSubstitute substitute) { 60 return ICON; 61 } 62 63 } 64 | Popular Tags |