1 19 20 package org.netbeans.modules.xml.schema.abe.nodes; 21 22 import java.awt.event.ActionEvent ; 23 import java.io.IOException ; 24 import javax.swing.AbstractAction ; 25 import org.netbeans.modules.xml.axi.AXIModel; 26 import org.netbeans.modules.xml.axi.AbstractElement; 27 import org.netbeans.modules.xml.axi.AnyElement; 28 import org.netbeans.modules.xml.axi.Element; 29 import org.netbeans.modules.xml.schema.abe.InstanceUIContext; 30 import org.netbeans.modules.xml.schema.abe.nodes.properties.*; 31 import org.openide.actions.DeleteAction; 32 import org.openide.nodes.Node.Property; 33 import org.openide.nodes.Sheet; 34 import org.openide.util.NbBundle; 35 import org.openide.util.actions.CallbackSystemAction; 36 import org.openide.util.actions.SystemAction; 37 import org.openide.windows.TopComponent; 38 39 43 public class AnyElementNode extends ABEAbstractNode { 44 45 46 49 public AnyElementNode(AbstractElement element, InstanceUIContext context) { 50 super(element, context); 51 } 52 53 public AnyElementNode(AbstractElement element) { 54 super(element, new ABENodeChildren(element)); 55 setIconBaseWithExtension( 56 "org/netbeans/modules/xml/schema/abe/resources/element.png"); 57 58 } 59 60 protected void populateProperties(Sheet sheet) { 61 Sheet.Set set = sheet.get(Sheet.PROPERTIES); 62 if(set == null) { 63 set = sheet.createPropertiesSet(); 64 } 65 66 try { 67 Property minOccursProp = new MinOccursProperty( 69 getAXIComponent(), 70 String .class, 71 Element.PROP_MINOCCURS, 72 NbBundle.getMessage(ElementNode.class,"PROP_MinOccurs_DisplayName"), NbBundle.getMessage(ElementNode.class,"PROP_MinOccurs_ShortDescription") ); 75 set.put(new SchemaModelFlushWrapper(getAXIComponent(), minOccursProp, getContext())); 76 77 Property maxOccursProp = new BaseABENodeProperty( 79 getAXIComponent(), 80 String .class, 81 Element.PROP_MAXOCCURS, 82 NbBundle.getMessage(ElementNode.class,"PROP_MaxOccurs_DisplayName"), NbBundle.getMessage(ElementNode.class,"PROP_MaxOccurs_ShortDescription"), MaxOccursEditor.class 85 ); 86 set.put(new SchemaModelFlushWrapper(getAXIComponent(), maxOccursProp, getContext())); 87 88 Property processContentsProp = new BaseABENodeProperty( 90 getAXIComponent(), org.netbeans.modules.xml.schema.model.AnyElement.ProcessContents.class, AnyElement.PROP_PROCESSCONTENTS, 93 NbBundle.getMessage(AnyElementNode.class,"PROP_ProcessContentsProp_DisplayName"), NbBundle.getMessage(AnyElementNode.class,"PROP_ProcessContentsProp_ShortDescription"), ProcessContentsEditor.class); 96 set.put(new SchemaModelFlushWrapper(getAXIComponent(), processContentsProp, getContext())); 97 98 } catch (Exception ex) { 99 } 100 101 sheet.put(set); 102 } 103 104 public String getName(){ 105 if((AbstractElement) super.getAXIComponent() != null) 106 return ((AbstractElement) super.getAXIComponent()).getName(); 107 else 108 return ""; 109 } 110 111 protected String getTypeDisplayName() { 112 return NbBundle.getMessage(AttributeNode.class,"LBL_Any"); 113 } 114 115 } 116 | Popular Tags |