1 19 20 package org.netbeans.modules.xml.schema.ui.nodes.schema; 21 22 import org.netbeans.modules.xml.schema.model.MaxExclusive; 23 import org.netbeans.modules.xml.schema.model.SchemaComponentReference; 24 import org.netbeans.modules.xml.schema.ui.nodes.*; 25 import org.netbeans.modules.xml.schema.ui.nodes.schema.properties.BooleanProperty; 26 import org.openide.nodes.Children; 27 import org.openide.nodes.Node.Property; 28 import org.openide.nodes.Sheet; 29 import org.openide.util.NbBundle; 30 34 public class MaxExclusiveNode extends SchemaComponentNode<MaxExclusive> 35 { 36 40 public MaxExclusiveNode(SchemaUIContext context, 41 SchemaComponentReference<MaxExclusive> reference, 42 Children children) 43 { 44 super(context,reference,children); 45 } 46 47 48 52 protected void updateDisplayName() 53 { 54 setDisplayName("< "+getReference().get().getValue()); 55 } 56 57 58 62 @Override 63 public String getTypeDisplayName() 64 { 65 return NbBundle.getMessage(MaxExclusiveNode.class, 66 "LBL_MaxExclusiveNode_TypeDisplayName"); } 68 69 @Override 70 protected Sheet createSheet() 71 { 72 Sheet sheet = super.createSheet(); 73 Sheet.Set props = sheet.get(Sheet.PROPERTIES); 74 if (props == null) { 75 props = Sheet.createPropertiesSet(); 76 sheet.put(props); 77 } 78 try { 79 Property fixedProp = new BooleanProperty( 81 getReference().get(), MaxExclusive.FIXED_PROPERTY, NbBundle.getMessage(MaxExclusiveNode.class,"PROP_Facet_Fixed_DisplayName"), NbBundle.getMessage(MaxExclusiveNode.class,"PROP_Facet_Fixed_ShortDescription"), true ); 87 props.put(new SchemaModelFlushWrapper(getReference().get(), fixedProp)); 88 } catch (NoSuchMethodException nsme) { 89 assert false : "properties should be defined"; 90 } 91 92 return sheet; 99 } 100 } 101 | Popular Tags |