1 19 20 package org.netbeans.modules.mdrxml.looks; 21 22 import java.util.Collection ; 23 import java.util.Iterator ; 24 import org.openide.nodes.*; 25 import org.openide.util.NbBundle; 26 import org.netbeans.api.looks.*; 27 import org.netbeans.spi.looks.*; 28 import org.netbeans.api.mdr.*; 29 import xmlmodel.RootNode; 30 34 public class RootNodeLook extends ElementNodeLook { 35 36 private static final String ICON = "org/netbeans/modules/mdrxml/resources/rootNode"; 37 38 private static class DocumentNameProperty extends PropertySupport.ReadOnly { 39 40 private RootNode node; 41 42 public DocumentNameProperty (RootNode node) { 43 super (NbBundle.getMessage(RootNodeLook.class,"TXT_DocumentName"),String .class,NbBundle.getMessage(RootNodeLook.class,"TXT_DocumentName"),NbBundle.getMessage(RootNodeLook.class,"TIP_DocumentName")); 44 this.node = node; 45 } 46 47 public Object getValue () { 48 if (this.node != null) 49 return this.node.getDocumentName (); 50 else 51 return null; 52 } 53 } 54 55 56 public RootNodeLook() { 57 super (NbBundle.getMessage (RootNodeLook.class, "TXT_RootNodeLook")); 58 } 59 60 public String iconBase (Look.NodeSubstitute substitute) { 61 return ICON; 62 } 63 64 public Node.PropertySet[] getPropertySets (Look.NodeSubstitute substitute) { 65 Node.PropertySet[] sets = super.getPropertySets (substitute); 66 ((Sheet.Set)sets[0]).put (new DocumentNameProperty ((RootNode)substitute.getRepresentedObject())); 67 return sets; 68 } 69 70 } 71 | Popular Tags |