1 19 20 package org.netbeans.modules.xml.schema.ui.nodes.schema; 21 22 import java.lang.reflect.InvocationTargetException ; 23 import org.netbeans.modules.xml.schema.model.Redefine; 24 import org.netbeans.modules.xml.schema.model.SchemaComponentReference; 25 import org.netbeans.modules.xml.schema.ui.nodes.*; 26 import org.openide.nodes.Children; 27 import org.openide.nodes.PropertySupport; 28 import org.openide.nodes.Sheet; 29 import org.openide.util.NbBundle; 30 34 public class RedefineNode extends SchemaComponentNode<Redefine> 35 { 36 40 public RedefineNode(SchemaUIContext context, 41 SchemaComponentReference<Redefine> reference, 42 Children children) 43 { 44 super(context,reference,children); 45 setIconBaseWithExtension( 46 "org/netbeans/modules/xml/schema/ui/nodes/resources/import-include-redefine.png"); 47 } 48 49 @Override 50 protected Sheet createSheet() 51 { 52 Sheet sheet = super.createSheet(); 53 Sheet.Set props = sheet.get(Sheet.PROPERTIES); 54 if (props == null) { 55 props = Sheet.createPropertiesSet(); 56 sheet.put(props); 57 } 58 59 Property slProp = new PropertySupport.ReadOnly( 61 Redefine.SCHEMA_LOCATION_PROPERTY, String .class, 62 NbBundle.getMessage(RedefineNode.class,"PROP_SchemaLocation_DisplayName"), 63 NbBundle.getMessage(RedefineNode.class,"HINT_SchemaLocation_ShortDesc") 64 ) 65 { 66 public Object getValue() throws 67 IllegalAccessException ,InvocationTargetException 68 { 69 return getReference().get().getSchemaLocation(); 70 } 71 }; 72 props.put(slProp); 73 return sheet; 74 } 75 76 77 81 @Override 82 public String getTypeDisplayName() 83 { 84 return NbBundle.getMessage(RedefineNode.class, 85 "LBL_RedefineNode_TypeDisplayName"); } 87 88 protected boolean allowReordering() { 89 return false; 94 } 95 } 96 | Popular Tags |