1 17 package org.eclipse.emf.edit.tree.impl; 18 19 20 import org.eclipse.emf.ecore.EClass; 21 import org.eclipse.emf.ecore.EPackage; 22 import org.eclipse.emf.ecore.EReference; 23 import org.eclipse.emf.ecore.EcorePackage; 24 import org.eclipse.emf.ecore.impl.EPackageImpl; 25 import org.eclipse.emf.ecore.impl.EcorePackageImpl; 26 import org.eclipse.emf.edit.tree.TreeFactory; 27 import org.eclipse.emf.edit.tree.TreeNode; 28 import org.eclipse.emf.edit.tree.TreePackage; 29 30 31 37 public class TreePackageImpl extends EPackageImpl implements TreePackage 38 { 39 44 private EClass treeNodeEClass = null; 45 46 61 private TreePackageImpl() 62 { 63 super(eNS_URI, TreeFactory.eINSTANCE); 64 } 65 66 71 private static boolean isInited = false; 72 73 95 public static TreePackage init() 96 { 97 if (isInited) return (TreePackage)EPackage.Registry.INSTANCE.getEPackage(TreePackage.eNS_URI); 98 99 TreePackageImpl theTreePackage = (TreePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof TreePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new TreePackageImpl()); 101 102 isInited = true; 103 104 EcorePackageImpl.init(); 106 107 theTreePackage.createPackageContents(); 109 110 theTreePackage.initializePackageContents(); 112 113 theTreePackage.freeze(); 115 116 return theTreePackage; 117 } 118 119 124 public EClass getTreeNode() 125 { 126 return treeNodeEClass; 127 } 128 129 134 public EReference getTreeNode_Parent() 135 { 136 return (EReference)treeNodeEClass.getEStructuralFeatures().get(0); 137 } 138 139 144 public EReference getTreeNode_Children() 145 { 146 return (EReference)treeNodeEClass.getEStructuralFeatures().get(1); 147 } 148 149 154 public EReference getTreeNode_Data() 155 { 156 return (EReference)treeNodeEClass.getEStructuralFeatures().get(2); 157 } 158 159 164 public TreeFactory getTreeFactory() 165 { 166 return (TreeFactory)getEFactoryInstance(); 167 } 168 169 174 private boolean isCreated = false; 175 176 183 public void createPackageContents() 184 { 185 if (isCreated) return; 186 isCreated = true; 187 188 treeNodeEClass = createEClass(TREE_NODE); 190 createEReference(treeNodeEClass, TREE_NODE__PARENT); 191 createEReference(treeNodeEClass, TREE_NODE__CHILDREN); 192 createEReference(treeNodeEClass, TREE_NODE__DATA); 193 } 194 195 200 private boolean isInitialized = false; 201 202 209 public void initializePackageContents() 210 { 211 if (isInitialized) return; 212 isInitialized = true; 213 214 setName(eNAME); 216 setNsPrefix(eNS_PREFIX); 217 setNsURI(eNS_URI); 218 219 EcorePackageImpl theEcorePackage = (EcorePackageImpl)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); 221 222 224 initEClass(treeNodeEClass, TreeNode.class, "TreeNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 226 initEReference(getTreeNode_Parent(), this.getTreeNode(), this.getTreeNode_Children(), "parent", null, 0, 1, TreeNode.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 227 initEReference(getTreeNode_Children(), this.getTreeNode(), this.getTreeNode_Parent(), "children", null, 0, -1, TreeNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 228 initEReference(getTreeNode_Data(), theEcorePackage.getEObject(), null, "data", null, 1, 1, TreeNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 229 230 createResource(eNS_URI); 232 } 233 234 } | Popular Tags |