You can subscribe to this list here.
| 2006 |
Jan
(30) |
Feb
(15) |
Mar
(1) |
Apr
(14) |
May
(31) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
(53) |
Nov
(6) |
Dec
|
|---|
|
From: jistrawn <jis...@us...> - 2006-11-14 14:32:29
|
Update of /cvsroot/modelwizard/source/Chameleon Plugin/META-INF In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26903/META-INF Modified Files: MANIFEST.MF Log Message: version 4.0.29 Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Plugin/META-INF/MANIFEST.MF,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** MANIFEST.MF 3 Nov 2006 18:17:15 -0000 1.21 --- MANIFEST.MF 14 Nov 2006 14:32:14 -0000 1.22 *************** *** 2,6 **** Bundle-Name: Chameleon UML Model Plugin Bundle-SymbolicName: net.sourceforge.modelWizard.chameleon;singleton=true ! Bundle-Version: 4.0.28 Bundle-Vendor: Cisco Bundle-Localization: plugin --- 2,6 ---- Bundle-Name: Chameleon UML Model Plugin Bundle-SymbolicName: net.sourceforge.modelWizard.chameleon;singleton=true ! Bundle-Version: 4.0.29 Bundle-Vendor: Cisco Bundle-Localization: plugin |
|
From: jistrawn <jis...@us...> - 2006-11-14 14:31:55
|
Update of /cvsroot/modelwizard/source/Chameleon Feature In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26545 Modified Files: feature.xml Log Message: Version 4.0.29 Index: feature.xml =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Feature/feature.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** feature.xml 3 Nov 2006 18:19:09 -0000 1.18 --- feature.xml 14 Nov 2006 14:31:51 -0000 1.19 *************** *** 3,7 **** id="net.sourceforge.modelWizard.chameleon" label="Chameleon Model" ! version="4.0.28" provider-name="Cisco"> --- 3,7 ---- id="net.sourceforge.modelWizard.chameleon" label="Chameleon Model" ! version="4.0.29" provider-name="Cisco"> |
|
From: jistrawn <jis...@us...> - 2006-11-14 05:27:49
|
Update of /cvsroot/modelwizard/source/Chameleon Plugin/src/net/sourceforge/modelWizard/chameleon/exporters In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22491/src/net/sourceforge/modelWizard/chameleon/exporters Modified Files: SubModelGenerator.java Log Message: Added Class list check for Generalizations Index: SubModelGenerator.java =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Plugin/src/net/sourceforge/modelWizard/chameleon/exporters/SubModelGenerator.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SubModelGenerator.java 3 Nov 2006 18:16:05 -0000 1.11 --- SubModelGenerator.java 14 Nov 2006 05:27:45 -0000 1.12 *************** *** 48,51 **** --- 48,52 ---- import org.eclipse.uml2.DataType; import org.eclipse.uml2.Enumeration; + import org.eclipse.uml2.Generalization; import org.eclipse.uml2.Implementation; import org.eclipse.uml2.Interface; *************** *** 116,121 **** EObject eObject; EObject next = (EObject) i.next(); ! if (next instanceof Implementation) { ! if (!isInterfaceInSubModel((Implementation) next)) { continue; } --- 117,122 ---- EObject eObject; EObject next = (EObject) i.next(); ! if (next instanceof Implementation || next instanceof Generalization) { ! if (!isInterfaceInSubModel(next)) { continue; } *************** *** 166,172 **** } ! private boolean isInterfaceInSubModel(Implementation theElement) { ! if (classList.contains(theElement.getRealizingClassifier().getName())) { ! return true; } return false; --- 167,180 ---- } ! private boolean isInterfaceInSubModel(EObject theElement) { ! ! if (theElement instanceof Implementation) { ! if (classList.contains(((Implementation) theElement).getRealizingClassifier().getName())) { ! return true; ! } ! } else if (theElement instanceof Generalization) { ! if (classList.contains(((Generalization) theElement).getGeneral().getName())) { ! return true; ! } } return false; *************** *** 244,249 **** for (Iterator p = model.getRealModel().getPackageImports().iterator(); p.hasNext();) { PackageImport pi = (PackageImport) p.next(); ! if (!pi.getImportedPackage().eIsProxy() ! && !pList.contains(pi.getImportedPackage().eResource().getURI().toString())) { EObject o = copier.copy(pi); newModel.getPackageImports().add(o); --- 252,256 ---- for (Iterator p = model.getRealModel().getPackageImports().iterator(); p.hasNext();) { PackageImport pi = (PackageImport) p.next(); ! if (!pi.getImportedPackage().eIsProxy() && !pList.contains(pi.getImportedPackage().eResource().getURI().toString())) { EObject o = copier.copy(pi); newModel.getPackageImports().add(o); *************** *** 452,462 **** if (p.getAssociation() != null) { ! ! // remove the copying of any abstract associations (including dependencies, here...) Association assoc = p.getAssociation(); ! if(assoc.isAbstract()) { continue; } ! addDependencies(rqdElements, (Classifier) assoc, false); } --- 459,470 ---- if (p.getAssociation() != null) { ! ! // remove the copying of any abstract associations ! // (including dependencies, here...) Association assoc = p.getAssociation(); ! if (assoc.isAbstract()) { continue; } ! addDependencies(rqdElements, (Classifier) assoc, false); } |
|
From: jistrawn <jis...@us...> - 2006-11-03 18:19:16
|
Update of /cvsroot/modelwizard/source/Chameleon Feature In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30245 Modified Files: feature.xml Log Message: Feature v4.0.28 Index: feature.xml =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Feature/feature.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** feature.xml 30 Oct 2006 15:36:55 -0000 1.17 --- feature.xml 3 Nov 2006 18:19:09 -0000 1.18 *************** *** 3,7 **** id="net.sourceforge.modelWizard.chameleon" label="Chameleon Model" ! version="4.0.27" provider-name="Cisco"> --- 3,7 ---- id="net.sourceforge.modelWizard.chameleon" label="Chameleon Model" ! version="4.0.28" provider-name="Cisco"> |
|
From: jistrawn <jis...@us...> - 2006-11-03 18:17:26
|
Update of /cvsroot/modelwizard/source/Chameleon Plugin/META-INF In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29402/META-INF Modified Files: MANIFEST.MF Log Message: v4.0.28 Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Plugin/META-INF/MANIFEST.MF,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MANIFEST.MF 30 Oct 2006 15:25:47 -0000 1.20 --- MANIFEST.MF 3 Nov 2006 18:17:15 -0000 1.21 *************** *** 2,6 **** Bundle-Name: Chameleon UML Model Plugin Bundle-SymbolicName: net.sourceforge.modelWizard.chameleon;singleton=true ! Bundle-Version: 4.0.27 Bundle-Vendor: Cisco Bundle-Localization: plugin --- 2,6 ---- Bundle-Name: Chameleon UML Model Plugin Bundle-SymbolicName: net.sourceforge.modelWizard.chameleon;singleton=true ! Bundle-Version: 4.0.28 Bundle-Vendor: Cisco Bundle-Localization: plugin |
|
From: jistrawn <jis...@us...> - 2006-11-03 18:16:12
|
Update of /cvsroot/modelwizard/source/Chameleon Plugin/src/net/sourceforge/modelWizard/chameleon/exporters In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28762/src/net/sourceforge/modelWizard/chameleon/exporters Modified Files: SubModelGenerator.java Log Message: Removed abstract associations from sub-model Index: SubModelGenerator.java =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Plugin/src/net/sourceforge/modelWizard/chameleon/exporters/SubModelGenerator.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SubModelGenerator.java 31 Oct 2006 22:50:15 -0000 1.10 --- SubModelGenerator.java 3 Nov 2006 18:16:05 -0000 1.11 *************** *** 452,456 **** if (p.getAssociation() != null) { ! addDependencies(rqdElements, (Classifier) p.getAssociation(), false); } --- 452,463 ---- if (p.getAssociation() != null) { ! ! // remove the copying of any abstract associations (including dependencies, here...) ! Association assoc = p.getAssociation(); ! if(assoc.isAbstract()) { ! continue; ! } ! ! addDependencies(rqdElements, (Classifier) assoc, false); } |
|
From: jistrawn <jis...@us...> - 2006-10-31 22:51:35
|
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/META-INF In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21948/META-INF Modified Files: MANIFEST.MF Log Message: Added back Provide-Package for compatibility with RSM Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/META-INF/MANIFEST.MF,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MANIFEST.MF 30 Oct 2006 15:13:20 -0000 1.16 --- MANIFEST.MF 31 Oct 2006 22:51:32 -0000 1.17 *************** *** 26,27 **** --- 26,29 ---- Bundle-Vendor: Cisco Eclipse-AutoStart: true + Provide-Package: net.sourceforge.modelWizard.backingModelAbstraction, + net.sourceforge.modelWizard.utilities |
|
From: jistrawn <jis...@us...> - 2006-10-31 22:50:19
|
Update of /cvsroot/modelwizard/source/Chameleon Plugin/src/net/sourceforge/modelWizard/chameleon/exporters In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21465/src/net/sourceforge/modelWizard/chameleon/exporters Modified Files: SubModelGenerator.java Log Message: Added hack to get around version conflicts with RSM (emf/uml2) Index: SubModelGenerator.java =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Plugin/src/net/sourceforge/modelWizard/chameleon/exporters/SubModelGenerator.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SubModelGenerator.java 30 Oct 2006 15:36:06 -0000 1.9 --- SubModelGenerator.java 31 Oct 2006 22:50:15 -0000 1.10 *************** *** 22,25 **** --- 22,26 ---- import java.util.Iterator; import java.util.List; + import java.util.Map; import java.util.TreeMap; *************** *** 38,41 **** --- 39,44 ---- import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + import org.eclipse.emf.ecore.util.FeatureMap; + import org.eclipse.emf.ecore.util.FeatureMapUtil; import org.eclipse.emf.ecore.util.EcoreUtil.Copier; import org.eclipse.uml2.Association; *************** *** 74,78 **** /** - * Override super * Returns a copy of the given eObject. * --- 77,80 ---- *************** *** 82,99 **** */ public EObject copy(EObject eObject) { - - // do not include the class interfaces that are not included in the sub-model. - // throwing a runtime so if this - if (eObject instanceof Implementation) { - if (!isInterfaceInSubModel((Implementation) eObject)) { - throw new RuntimeException(); - } - } - EObject copyEObject = createCopy(eObject); put(eObject, copyEObject); ! EClass eClass = eObject.eClass(); ! for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) { ! EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) { if (eStructuralFeature instanceof EAttribute) { --- 84,91 ---- */ public EObject copy(EObject eObject) { EObject copyEObject = createCopy(eObject); put(eObject, copyEObject); ! for (Iterator i = eObject.eClass().getEAllStructuralFeatures().iterator(); i.hasNext();) { ! EStructuralFeature eStructuralFeature = (EStructuralFeature) i.next(); if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) { if (eStructuralFeature instanceof EAttribute) { *************** *** 112,118 **** /** ! * Override super ! * Returns a collection containing a copy of each EObject in the given ! * collection. * * @param eObjects --- 104,109 ---- /** ! * Override super Returns a collection containing a copy of each EObject ! * in the given collection. * * @param eObjects *************** *** 124,132 **** for (Iterator i = eObjects.iterator(); i.hasNext();) { EObject eObject; ! try { ! eObject = copy((EObject) i.next()); ! } catch (RuntimeException e) { ! continue; } result.add(eObject); } --- 115,125 ---- for (Iterator i = eObjects.iterator(); i.hasNext();) { EObject eObject; ! EObject next = (EObject) i.next(); ! if (next instanceof Implementation) { ! if (!isInterfaceInSubModel((Implementation) next)) { ! continue; ! } } + eObject = copy(next); result.add(eObject); } *************** *** 134,137 **** --- 127,169 ---- } + /** + * Hooks up cross references; it delegates to + * {@link #copyReference copyReference}. + */ + public void copyReferences() { + for (Iterator i = entrySet().iterator(); i.hasNext();) { + Map.Entry entry = (Map.Entry) i.next(); + EObject eObject = (EObject) entry.getKey(); + EObject copyEObject = (EObject) entry.getValue(); + EClass eClass = eObject.eClass(); + for (Iterator j = eClass.getEAllStructuralFeatures().iterator(); j.hasNext();) { + EStructuralFeature eStructuralFeature = (EStructuralFeature) j.next(); + if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) { + if (eStructuralFeature instanceof EReference) { + EReference eReference = (EReference) eStructuralFeature; + if (!eReference.isContainment()) { + copyReference(eReference, eObject, copyEObject); + } + } else if (FeatureMapUtil.isFeatureMap(eStructuralFeature)) { + FeatureMap featureMap = (FeatureMap) eObject.eGet(eStructuralFeature); + FeatureMap copyFeatureMap = (FeatureMap) copyEObject.eGet(getTarget(eStructuralFeature)); + for (Iterator k = featureMap.iterator(); k.hasNext();) { + FeatureMap.Entry featureMapEntry = (FeatureMap.Entry) k.next(); + EStructuralFeature feature = featureMapEntry.getEStructuralFeature(); + if (feature instanceof EReference) { + Object referencedEObject = featureMapEntry.getValue(); + Object copyReferencedEObject = get(referencedEObject); + copyFeatureMap.add(feature, copyReferencedEObject == null ? referencedEObject + : copyReferencedEObject); + } else { + copyFeatureMap.add(featureMapEntry); + } + } + } + } + } + } + } + private boolean isInterfaceInSubModel(Implementation theElement) { if (classList.contains(theElement.getRealizingClassifier().getName())) { |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:37:02
|
Update of /cvsroot/modelwizard/source/Chameleon Feature In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31911 Modified Files: feature.xml Log Message: version 4.0.27 Index: feature.xml =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Feature/feature.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** feature.xml 13 Oct 2006 20:30:17 -0000 1.16 --- feature.xml 30 Oct 2006 15:36:55 -0000 1.17 *************** *** 3,7 **** id="net.sourceforge.modelWizard.chameleon" label="Chameleon Model" ! version="4.0.26" provider-name="Cisco"> --- 3,7 ---- id="net.sourceforge.modelWizard.chameleon" label="Chameleon Model" ! version="4.0.27" provider-name="Cisco"> |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:36:11
|
Update of /cvsroot/modelwizard/source/Chameleon Plugin/src/net/sourceforge/modelWizard/chameleon/exporters In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31665/src/net/sourceforge/modelWizard/chameleon/exporters Modified Files: SubModelGenerator.java Log Message: support for raisedException dependencies and sub-model interface issue resolved Index: SubModelGenerator.java =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Plugin/src/net/sourceforge/modelWizard/chameleon/exporters/SubModelGenerator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SubModelGenerator.java 13 Oct 2006 20:31:34 -0000 1.8 --- SubModelGenerator.java 30 Oct 2006 15:36:06 -0000 1.9 *************** *** 19,23 **** --- 19,25 ---- import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; + import java.util.Collection; import java.util.Iterator; + import java.util.List; import java.util.TreeMap; *************** *** 29,33 **** --- 31,39 ---- import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.emf.common.util.URI; + import org.eclipse.emf.ecore.EAttribute; + import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; + import org.eclipse.emf.ecore.EReference; + import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; *************** *** 39,42 **** --- 45,49 ---- import org.eclipse.uml2.DataType; import org.eclipse.uml2.Enumeration; + import org.eclipse.uml2.Implementation; import org.eclipse.uml2.Interface; import org.eclipse.uml2.Model; *************** *** 55,62 **** public class SubModelGenerator { - public static SubModelGenerator INSTANCE = new SubModelGenerator(); private TreeMap rqdElements; /** * This method returns a new model that is a subset of --- 62,145 ---- public class SubModelGenerator { private TreeMap rqdElements; + private List classList; + + public static SubModelGenerator INSTANCE = new SubModelGenerator(); + + class MyCopier extends Copier { + + private static final long serialVersionUID = 1L; + + /** + * Override super + * Returns a copy of the given eObject. + * + * @param eObject + * the object to copy. + * @return the copy. + */ + public EObject copy(EObject eObject) { + + // do not include the class interfaces that are not included in the sub-model. + // throwing a runtime so if this + if (eObject instanceof Implementation) { + if (!isInterfaceInSubModel((Implementation) eObject)) { + throw new RuntimeException(); + } + } + + EObject copyEObject = createCopy(eObject); + put(eObject, copyEObject); + EClass eClass = eObject.eClass(); + for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) { + EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); + if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) { + if (eStructuralFeature instanceof EAttribute) { + copyAttribute((EAttribute) eStructuralFeature, eObject, copyEObject); + } else { + EReference eReference = (EReference) eStructuralFeature; + if (eReference.isContainment()) { + copyContainment(eReference, eObject, copyEObject); + } + } + } + } + + return copyEObject; + } + + /** + * Override super + * Returns a collection containing a copy of each EObject in the given + * collection. + * + * @param eObjects + * the collection of objects to copy. + * @return the collection of copies. + */ + public Collection copyAll(Collection eObjects) { + Collection result = new ArrayList(eObjects.size()); + for (Iterator i = eObjects.iterator(); i.hasNext();) { + EObject eObject; + try { + eObject = copy((EObject) i.next()); + } catch (RuntimeException e) { + continue; + } + result.add(eObject); + } + return result; + } + + private boolean isInterfaceInSubModel(Implementation theElement) { + if (classList.contains(theElement.getRealizingClassifier().getName())) { + return true; + } + return false; + } + } + /** * This method returns a new model that is a subset of *************** *** 71,97 **** * @throws ModelTransformationException */ ! public Model getSubModel(Iterator classNames, ! IProgressMonitor parentMonitor, ModelModel model, String modelName, ! String modelDesc, String basePackageName) throws IOException, ! InvocationTargetException, InterruptedException, ModelTransformationException { IProgressMonitor monitor = new SubProgressMonitor(parentMonitor, 2); monitor.beginTask("Creating sub model", 3); ! rqdElements = new TreeMap(); // for each class add the class and any superclasses to the rqdClasses // treemap int n = 0; ! ! while (classNames.hasNext()) { n++; ! String cN = (String) classNames.next(); Classifier theElement = (Classifier) model.findRealElement(cN); if (theElement == null) { ! throw new ModelTransformationException(cN ! + " does not exist in model!"); } addDependencies(rqdElements, theElement, false); --- 154,180 ---- * @throws ModelTransformationException */ ! public Model getSubModel(Iterator classNames, IProgressMonitor parentMonitor, ModelModel model, String modelName, ! String modelDesc, String basePackageName) throws IOException, InvocationTargetException, InterruptedException, ModelTransformationException { + IProgressMonitor monitor = new SubProgressMonitor(parentMonitor, 2); monitor.beginTask("Creating sub model", 3); ! classList = initClassesList(classNames); ! // for each class add the class and any superclasses to the rqdClasses // treemap + rqdElements = new TreeMap(); int n = 0; ! for (int i = 0; i < classList.size(); i++) { n++; ! String cN = (String) classList.get(i); Classifier theElement = (Classifier) model.findRealElement(cN); if (theElement == null) { ! throw new ModelTransformationException(cN + " does not exist in model!"); } + addDependencies(rqdElements, theElement, false); *************** *** 104,108 **** // now create the new model with the required elements. ! Copier copier = new Copier(); Model newModel = UML2Factory.eINSTANCE.createModel(); newModel.setName(modelName); --- 187,191 ---- // now create the new model with the required elements. ! Copier copier = new MyCopier(); Model newModel = UML2Factory.eINSTANCE.createModel(); newModel.setName(modelName); *************** *** 115,129 **** // add profile applications... ArrayList pList = new ArrayList(); ! for (Iterator p = model.getRealModel().getAppliedProfiles().iterator(); p ! .hasNext();) { ProfileApplication pa = (ProfileApplication) p.next(); if (!pa.getImportedProfile().eIsProxy()) { EObject o = copier.copy(pa); newModel.getAppliedProfiles().add(o); ! pList.add(pa.getImportedProfile().eResource().getURI() ! .toString()); } else { - // System.out.println("Ignoring - // "+((InternalEObject)pa.getImportedProfile()).eProxyURI().toString()); continue; } --- 198,208 ---- // add profile applications... ArrayList pList = new ArrayList(); ! for (Iterator p = model.getRealModel().getAppliedProfiles().iterator(); p.hasNext();) { ProfileApplication pa = (ProfileApplication) p.next(); if (!pa.getImportedProfile().eIsProxy()) { EObject o = copier.copy(pa); newModel.getAppliedProfiles().add(o); ! pList.add(pa.getImportedProfile().eResource().getURI().toString()); } else { continue; } *************** *** 131,145 **** // add packageImports... ! for (Iterator p = model.getRealModel().getPackageImports().iterator(); p ! .hasNext();) { PackageImport pi = (PackageImport) p.next(); if (!pi.getImportedPackage().eIsProxy() ! && !pList.contains(pi.getImportedPackage().eResource() ! .getURI().toString())) { EObject o = copier.copy(pi); newModel.getPackageImports().add(o); } else { - // System.out.println("Ignoring - // "+((InternalEObject)pi.getImportedPackage()).eProxyURI().toString()); continue; } --- 210,220 ---- // add packageImports... ! for (Iterator p = model.getRealModel().getPackageImports().iterator(); p.hasNext();) { PackageImport pi = (PackageImport) p.next(); if (!pi.getImportedPackage().eIsProxy() ! && !pList.contains(pi.getImportedPackage().eResource().getURI().toString())) { EObject o = copier.copy(pi); newModel.getPackageImports().add(o); } else { continue; } *************** *** 147,156 **** if ((modelDesc != null) & !modelDesc.equals("")) { ! Comment newComment = newModel ! .createOwnedComment(UML2Package.eINSTANCE.getComment()); newComment.setBody(modelDesc); ! Stereotype s = newComment ! .getApplicableStereotype("Default::documentation"); if (s != null) { --- 222,229 ---- if ((modelDesc != null) & !modelDesc.equals("")) { ! Comment newComment = newModel.createOwnedComment(UML2Package.eINSTANCE.getComment()); newComment.setBody(modelDesc); ! Stereotype s = newComment.getApplicableStereotype("Default::documentation"); if (s != null) { *************** *** 162,170 **** Iterator keys = rqdElements.keySet().iterator(); - while (keys.hasNext()) { NamedElement el = (NamedElement) rqdElements.get(keys.next()); Package owner = addPackageHierarchy(basePackage, el); ! EObject o = copier.copy(el); deleteUnneededAssocEnds(el, o, rqdElements); owner.getOwnedMembers().add(o); --- 235,243 ---- Iterator keys = rqdElements.keySet().iterator(); while (keys.hasNext()) { NamedElement el = (NamedElement) rqdElements.get(keys.next()); Package owner = addPackageHierarchy(basePackage, el); ! EObject o; ! o = copier.copy(el); deleteUnneededAssocEnds(el, o, rqdElements); owner.getOwnedMembers().add(o); *************** *** 174,182 **** Stereotype stereo = newModel.getApplicableStereotype("MODEL::Version"); ! String version = (String) model.getRealModel() ! .getValue(stereo, "value"); String derived = "Derived from " + version.replaceAll("\\$", ""); - // newModel.apply(stereo); newModel.setValue(stereo, "value", derived); --- 247,253 ---- Stereotype stereo = newModel.getApplicableStereotype("MODEL::Version"); ! String version = (String) model.getRealModel().getValue(stereo, "value"); String derived = "Derived from " + version.replaceAll("\\$", ""); newModel.setValue(stereo, "value", derived); *************** *** 187,206 **** } private Package createPackageHierachy(String basePackage, Package parent) { String top = basePackage.split("\\.")[0]; ! Package newPackage = (Package) parent ! .createOwnedMember(UML2Package.eINSTANCE.getPackage()); newPackage.setName(top); if (top.equals(basePackage)) { return newPackage; } else { ! String rest = basePackage.substring(top.length() + 1, basePackage ! .length()); return createPackageHierachy(rest, newPackage); } } ! private void deleteUnneededAssocEnds(NamedElement sourceEl, ! EObject targetEl, TreeMap rqdElements) { if (sourceEl instanceof Class) { Class src = (Class) sourceEl; --- 258,283 ---- } + // put classes into a list so we can use the list in helper methods. + private List initClassesList(Iterator classNames) { + List classList = new ArrayList(); + while (classNames.hasNext()) { + classList.add(classNames.next()); + } + return classList; + } + private Package createPackageHierachy(String basePackage, Package parent) { String top = basePackage.split("\\.")[0]; ! Package newPackage = (Package) parent.createOwnedMember(UML2Package.eINSTANCE.getPackage()); newPackage.setName(top); if (top.equals(basePackage)) { return newPackage; } else { ! String rest = basePackage.substring(top.length() + 1, basePackage.length()); return createPackageHierachy(rest, newPackage); } } ! private void deleteUnneededAssocEnds(NamedElement sourceEl, EObject targetEl, TreeMap rqdElements) { if (sourceEl instanceof Class) { Class src = (Class) sourceEl; *************** *** 211,216 **** continue; } ! if (!rqdElements.containsKey(p.getAssociation() ! .getQualifiedName())) { Property excessProp = tgt.getAttribute(p.getName()); tgt.getOwnedAttributes().remove(excessProp); --- 288,292 ---- continue; } ! if (!rqdElements.containsKey(p.getAssociation().getQualifiedName())) { Property excessProp = tgt.getAttribute(p.getName()); tgt.getOwnedAttributes().remove(excessProp); *************** *** 226,231 **** continue; } ! if (!rqdElements.containsKey(p.getAssociation() ! .getQualifiedName())) { Property excessProp = tgt.getAttribute(p.getName()); tgt.getOwnedAttributes().remove(excessProp); --- 302,306 ---- continue; } ! if (!rqdElements.containsKey(p.getAssociation().getQualifiedName())) { Property excessProp = tgt.getAttribute(p.getName()); tgt.getOwnedAttributes().remove(excessProp); *************** *** 292,299 **** * @throws ModelTransformationException */ ! private void addDependencies(TreeMap rqdElements, Classifier theElement, ! boolean ignoreSuper) throws ModelTransformationException { ! String qName = theElement.getQualifiedName(); if (!rqdElements.containsKey(qName)) { rqdElements.put(qName, theElement); --- 367,374 ---- * @throws ModelTransformationException */ ! private void addDependencies(TreeMap rqdElements, Classifier theElement, boolean ignoreSuper) ! throws ModelTransformationException { + String qName = theElement.getQualifiedName(); if (!rqdElements.containsKey(qName)) { rqdElements.put(qName, theElement); *************** *** 317,324 **** if (theElement instanceof Class || theElement instanceof Interface) { // add the superclass if (!ignoreSuper) { ! Classifier sc = (Classifier) UmlUtilities ! .getGeneral(theElement); if (sc != null) { --- 392,399 ---- if (theElement instanceof Class || theElement instanceof Interface) { + // add the superclass if (!ignoreSuper) { ! Classifier sc = (Classifier) UmlUtilities.getGeneral(theElement); if (sc != null) { *************** *** 331,346 **** if (theElement instanceof Class) { Class c = (Class) theElement; ! props = UmlUtilities.getProperties(c.getAttributes(), c ! .getInheritedMembers(), false); ! methods = UmlUtilities.getMethods(c.getOwnedOperations(), c ! .getInheritedMembers(), false); } if (theElement instanceof Interface) { Interface intfc = (Interface) theElement; ! props = UmlUtilities.getProperties(intfc.getAttributes(), intfc ! .getInheritedMembers(), false); ! methods = UmlUtilities.getMethods(intfc.getOwnedOperations(), ! intfc.getInheritedMembers(), false); } --- 406,417 ---- if (theElement instanceof Class) { Class c = (Class) theElement; ! props = UmlUtilities.getProperties(c.getAttributes(), c.getInheritedMembers(), false, true); ! methods = UmlUtilities.getMethods(c.getOwnedOperations(), c.getInheritedMembers(), false); } if (theElement instanceof Interface) { Interface intfc = (Interface) theElement; ! props = UmlUtilities.getProperties(intfc.getAttributes(), intfc.getInheritedMembers(), false); ! methods = UmlUtilities.getMethods(intfc.getOwnedOperations(), intfc.getInheritedMembers(), false); } *************** *** 348,354 **** Property p = (Property) props.next(); - // ignore associations for now. if (p.getAssociation() != null) { ! continue; } --- 419,424 ---- Property p = (Property) props.next(); if (p.getAssociation() != null) { ! addDependencies(rqdElements, (Classifier) p.getAssociation(), false); } *************** *** 358,370 **** } if (t == null) ! throw new ModelTransformationException("Type of " ! + p.getQualifiedName() + " is null"); String tQname = t.getQualifiedName(); if (t instanceof Classifier) { - // if (!rqdElements.containsKey(tQname)) { - // rqdElements.put(tQname, t); - // } addDependencies(rqdElements, (Classifier) t, false); } --- 428,436 ---- } if (t == null) ! throw new ModelTransformationException("Type of " + p.getQualifiedName() + " is null"); String tQname = t.getQualifiedName(); if (t instanceof Classifier) { addDependencies(rqdElements, (Classifier) t, false); } *************** *** 385,403 **** } } - - // if (t instanceof DataType) { - // if (!rqdElements.containsKey(tQname)) { - // rqdElements.put(tQname, t); - // } - // } } while (methods.hasNext()) { Operation theMethod = (Operation) methods.next(); - Type mt = theMethod.getType(); if (mt != null && !(mt instanceof PrimitiveType)) { ! if (mt instanceof Enumeration ! && !rqdElements.containsKey(mt.getQualifiedName())) { rqdElements.put(mt.getQualifiedName(), mt); } --- 451,463 ---- } } } while (methods.hasNext()) { Operation theMethod = (Operation) methods.next(); + // get return type dependencies + Type mt = theMethod.getType(); if (mt != null && !(mt instanceof PrimitiveType)) { ! if (mt instanceof Enumeration && !rqdElements.containsKey(mt.getQualifiedName())) { rqdElements.put(mt.getQualifiedName(), mt); } *************** *** 408,413 **** } ! Iterator p = theMethod.getOwnedParameters().iterator(); while (p.hasNext()) { Parameter param = (Parameter) p.next(); --- 468,479 ---- } ! // get exception dependencies ! Iterator r = theMethod.getRaisedExceptions().iterator(); ! while (r.hasNext()) { ! Class re = (Class) r.next(); ! addDependencies(rqdElements, (Classifier) re, false); ! } + Iterator p = theMethod.getOwnedParameters().iterator(); while (p.hasNext()) { Parameter param = (Parameter) p.next(); *************** *** 420,430 **** if (t instanceof Class) { - // if (!rqdElements.containsKey(pQname)) - // { - // rqdElements.put( - // pQname, - // t); - // } - addDependencies(rqdElements, (Class) t, false); } --- 486,489 ---- *************** *** 450,455 **** // and finally look at the MemberEnds if it is an association if (theElement instanceof Association) { ! Iterator ends = ((Association) theElement).getMemberEnds() ! .iterator(); while (ends.hasNext()) { --- 509,513 ---- // and finally look at the MemberEnds if it is an association if (theElement instanceof Association) { ! Iterator ends = ((Association) theElement).getMemberEnds().iterator(); while (ends.hasNext()) { *************** *** 459,476 **** if (t instanceof Classifier) { - // if (!rqdElements.containsKey(pQname)) - // { - // rqdElements.put( - // pQname, - // t); - // } - addDependencies(rqdElements, (Classifier) t, false); } else { ! throw new ModelTransformationException("AssociationEnd " ! + pQname + " not a class"); } } } } } \ No newline at end of file --- 517,527 ---- if (t instanceof Classifier) { addDependencies(rqdElements, (Classifier) t, false); } else { ! throw new ModelTransformationException("AssociationEnd " + pQname + " not a class"); } } } } + } \ No newline at end of file |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:28:55
|
Update of /cvsroot/modelwizard/source/Chameleon Plugin/src/net/sourceforge/modelWizard/chameleon/ModelAbstraction In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28054/src/net/sourceforge/modelWizard/chameleon/ModelAbstraction Modified Files: UmlUtilities.java Log Message: added support for associations Index: UmlUtilities.java =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Plugin/src/net/sourceforge/modelWizard/chameleon/ModelAbstraction/UmlUtilities.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UmlUtilities.java 2 Oct 2006 17:26:37 -0000 1.6 --- UmlUtilities.java 30 Oct 2006 15:28:46 -0000 1.7 *************** *** 133,137 **** } - /** * Return a string array containing all of the properties (UML attributes) --- 133,136 ---- *************** *** 143,146 **** --- 142,150 ---- */ public static Iterator getProperties(Collection local, Collection inherited, boolean fromSuper) { + return getProperties(local, inherited, fromSuper, false); + } + + + public static Iterator getProperties(Collection local, Collection inherited, boolean fromSuper, boolean includeAssociations) { ArrayList classProperties = new ArrayList(); *************** *** 150,156 **** if (p.getAssociation() != null) { ! continue; } - classProperties.add(p); } --- 154,161 ---- if (p.getAssociation() != null) { ! if(!includeAssociations) { ! continue; ! } } classProperties.add(p); } |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:27:55
|
Update of /cvsroot/modelwizard/source/Chameleon Plugin/umlProfile In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27648/umlProfile Modified Files: Model.Profile.uml2 Log Message: updated Index: Model.Profile.uml2 =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Plugin/umlProfile/Model.Profile.uml2,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Model.Profile.uml2 2 Oct 2006 17:36:25 -0000 1.19 --- Model.Profile.uml2 30 Oct 2006 15:27:52 -0000 1.20 *************** *** 252,255 **** --- 252,258 ---- <eAnnotations xmi:id="_pDqDYU4rEdunmouyEGOmDA" source="stereotype" references="_mOfCgE4qEdunmouyEGOmDA"/> </eClassifiers> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_LMr3sFSOEduqdK4Cd2EdZg" name="MODEL__AsRef"> + <eAnnotations xmi:id="_LMr3sVSOEduqdK4Cd2EdZg" source="stereotype" references="_xmZaAFSNEduqdK4Cd2EdZg"/> + </eClassifiers> </contents> <contents xmi:type="ecore:EPackage" xmi:id="_PG2JhfVfEdmX2r2IirNfog" name="MODEL_24" nsURI="http:///_iEIkYPVdEdmX2r2IirNfog.profile.uml2" nsPrefix="MODEL_24"> *************** *** 2932,2939 **** </ownedAttribute> <nestedClassifier xmi:type="uml:Extension" xmi:id="_mOfCgk4qEdunmouyEGOmDA" name="Interface_Stateful" memberEnd="_mOfCg04qEdunmouyEGOmDA _mOfCgU4qEdunmouyEGOmDA"> ! <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_mOfCg04qEdunmouyEGOmDA" name="extension$Interface" type="_mOfCgE4qEdunmouyEGOmDA" association="_mOfCgk4qEdunmouyEGOmDA" aggregation="composite"> <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_mOfChE4qEdunmouyEGOmDA"/> </ownedEnd> </nestedClassifier> </ownedMember> </uml:Profile> --- 2935,2952 ---- </ownedAttribute> <nestedClassifier xmi:type="uml:Extension" xmi:id="_mOfCgk4qEdunmouyEGOmDA" name="Interface_Stateful" memberEnd="_mOfCg04qEdunmouyEGOmDA _mOfCgU4qEdunmouyEGOmDA"> ! <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_mOfCg04qEdunmouyEGOmDA" name="extension$Stateful" type="_mOfCgE4qEdunmouyEGOmDA" association="_mOfCgk4qEdunmouyEGOmDA" aggregation="composite"> <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_mOfChE4qEdunmouyEGOmDA"/> </ownedEnd> </nestedClassifier> </ownedMember> + <ownedMember xmi:type="uml:Stereotype" xmi:id="_xmZaAFSNEduqdK4Cd2EdZg" name="AsRef"> + <ownedAttribute xmi:id="_xmZaAVSNEduqdK4Cd2EdZg" name="base$Property" association="_xmZaAlSNEduqdK4Cd2EdZg"> + <type xmi:type="uml:Class" href="pathmap://UML2_METAMODELS/UML2.metamodel.uml2#_m9C1la86EdiEh75YJ_3n8g"/> + </ownedAttribute> + <nestedClassifier xmi:type="uml:Extension" xmi:id="_xmZaAlSNEduqdK4Cd2EdZg" name="Property_AsRef" memberEnd="_xmZaA1SNEduqdK4Cd2EdZg _xmZaAVSNEduqdK4Cd2EdZg"> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_xmZaA1SNEduqdK4Cd2EdZg" name="extension$AsRef" type="_xmZaAFSNEduqdK4Cd2EdZg" association="_xmZaAlSNEduqdK4Cd2EdZg" aggregation="composite"> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_xmZaBFSNEduqdK4Cd2EdZg"/> + </ownedEnd> + </nestedClassifier> + </ownedMember> </uml:Profile> |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:27:14
|
Update of /cvsroot/modelwizard/source/Chameleon Plugin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27558 Modified Files: plugin.xml Log Message: modified model path (newmodel/merge/merged.emx) Index: plugin.xml =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Plugin/plugin.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** plugin.xml 13 Oct 2006 20:32:42 -0000 1.11 --- plugin.xml 30 Oct 2006 15:27:10 -0000 1.12 *************** *** 8,12 **** id="Abstract.model1" menu="menu" ! modelFile="newModel/Merged.emx" name="Chameleon" primary="true" --- 8,12 ---- id="Abstract.model1" menu="menu" ! modelFile="newModel/merge/Merged.emx" name="Chameleon" primary="true" |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:25:59
|
Update of /cvsroot/modelwizard/source/Chameleon Plugin/META-INF In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26806/META-INF Modified Files: MANIFEST.MF Log Message: version 4.0.27 Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/modelwizard/source/Chameleon Plugin/META-INF/MANIFEST.MF,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** MANIFEST.MF 13 Oct 2006 20:30:49 -0000 1.19 --- MANIFEST.MF 30 Oct 2006 15:25:47 -0000 1.20 *************** *** 2,6 **** Bundle-Name: Chameleon UML Model Plugin Bundle-SymbolicName: net.sourceforge.modelWizard.chameleon;singleton=true ! Bundle-Version: 4.0.26 Bundle-Vendor: Cisco Bundle-Localization: plugin --- 2,6 ---- Bundle-Name: Chameleon UML Model Plugin Bundle-SymbolicName: net.sourceforge.modelWizard.chameleon;singleton=true ! Bundle-Version: 4.0.27 Bundle-Vendor: Cisco Bundle-Localization: plugin |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:20:51
|
Update of /cvsroot/modelwizard/source/Model Wizard Feature In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24663 Modified Files: feature.xml Log Message: v2.0.19 Index: feature.xml =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Feature/feature.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** feature.xml 13 Oct 2006 20:34:31 -0000 1.15 --- feature.xml 30 Oct 2006 15:20:38 -0000 1.16 *************** *** 3,7 **** id="net.sourceforge.modelWizard" label="Model Wizard" ! version="2.0.18" provider-name="Cisco"> --- 3,7 ---- id="net.sourceforge.modelWizard" label="Model Wizard" ! version="2.0.19" provider-name="Cisco"> |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:19:16
|
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/wizards In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24123/src/net/sourceforge/modelWizard/wizards Modified Files: NewProjectWizard.java Log Message: reformatted Index: NewProjectWizard.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/wizards/NewProjectWizard.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NewProjectWizard.java 24 Oct 2006 23:13:00 -0000 1.4 --- NewProjectWizard.java 30 Oct 2006 15:19:13 -0000 1.5 *************** *** 98,103 **** final IFile file = project.getFile("ShoppingCart.crt"); ShoppingCartSchemaModelWizard.createNewCart(file); ! IWorkbenchPage page = ! PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IDE.openEditor(page, file, true); MessageBox mb = new MessageBox(new Shell(Display.getDefault()), --- 98,102 ---- final IFile file = project.getFile("ShoppingCart.crt"); ShoppingCartSchemaModelWizard.createNewCart(file); ! IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IDE.openEditor(page, file, true); MessageBox mb = new MessageBox(new Shell(Display.getDefault()), |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:18:46
|
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/wizards In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23766/src/net/sourceforge/modelWizard/wizards Modified Files: ModelExtractWizardPage2.java Log Message: reformatted Index: ModelExtractWizardPage2.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/wizards/ModelExtractWizardPage2.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ModelExtractWizardPage2.java 24 Oct 2006 23:13:00 -0000 1.6 --- ModelExtractWizardPage2.java 30 Oct 2006 15:18:33 -0000 1.7 *************** *** 50,317 **** import org.eclipse.ui.help.WorkbenchHelp; - public class ModelExtractWizardPage2 - extends WizardPage - { - - private Text fileText; - private Text containerText; - ModelAccess model = ModelAccess.INSTANCE; - ArrayList fields = new ArrayList(); - private int modelAccessKey; - private Composite holder; - private IContainer container; - private IPath filePath; - private Label fileLabel; private Group exporterSpecificParametersGroup; private Map params; ! public ModelExtractWizardPage2(IContainer container) ! { ! super("Model Exporter"); ! setTitle("Model Exporter"); ! setDescription("Specify the required parameters."); ! setImageDescriptor(ModelWizardPlugin.getIconPath("wizardIcon.gif")); ! this.container = container; ! } ! public void createControl(Composite parent) ! { ! holder = new Composite( ! parent, ! SWT.NULL); ! holder.setLayout(new GridLayout()); ! WorkbenchHelp.setHelp(holder, ! "net.sourceforge.modelwizard.documentation.exportWizardHelpId"); ! // ! setControl(holder); ! final Group destinationGroup = new Group(holder, SWT.NONE); ! destinationGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); ! destinationGroup.setLayout(new FormLayout()); ! destinationGroup.setText("Destination "); ! final Label containerLabel = new Label(destinationGroup, SWT.NONE); ! final FormData formData_1 = new FormData(); ! formData_1.top = new FormAttachment( ! 0, ! 5); ! formData_1.left = new FormAttachment( ! 0, ! 5); ! containerLabel.setLayoutData(formData_1); ! containerLabel.setText("Container"); ! final Button containerBrowseButton = new Button(destinationGroup, SWT.PUSH); ! final FormData formData_2 = new FormData(); ! formData_2.top = new FormAttachment( ! containerLabel, ! 0, ! SWT.CENTER); ! formData_2.right = new FormAttachment( ! 100, ! -5); ! containerBrowseButton.setLayoutData(formData_2); ! containerBrowseButton.setText("Browse..."); ! containerBrowseButton.addSelectionListener( ! new SelectionAdapter() ! { ! public void widgetSelected(SelectionEvent e) ! { ! handleBrowse(); ! checkFilename(); ! } ! }); ! containerText = new Text( ! destinationGroup, ! SWT.BORDER); ! final FormData formData = new FormData(); ! formData.top = new FormAttachment( ! containerLabel, ! 0, ! SWT.CENTER); ! formData.right = new FormAttachment( ! containerBrowseButton, ! -5, ! SWT.DEFAULT); ! formData.left = new FormAttachment( ! containerLabel, ! 5, ! SWT.DEFAULT); ! containerText.setLayoutData(formData); ! containerText.setEditable(false); ! containerText.setText(container.getFullPath().toOSString()); ! final String defFileName = "export"; ! fileLabel = new Label( ! destinationGroup, ! SWT.NONE); ! final FormData formData_3 = new FormData(); ! formData_3.top = new FormAttachment( ! containerBrowseButton, ! 10, ! SWT.DEFAULT); ! formData_3.left = new FormAttachment( ! 0, ! 5); ! fileLabel.setLayoutData(formData_3); ! fileLabel.setText("File"); ! fileText = new Text( ! destinationGroup, ! SWT.BORDER); ! final FormData formData_4 = new FormData(); ! formData_4.right = new FormAttachment( ! 100, ! -5); ! formData_4.top = new FormAttachment( ! fileLabel, ! 0, ! SWT.CENTER); ! formData_4.left = new FormAttachment( ! containerText, ! 0, ! SWT.LEFT); ! fileText.setLayoutData(formData_4); ! fileText.addModifyListener( ! new ModifyListener() ! { ! public void modifyText(ModifyEvent e) ! { ! checkFilename(); ! } ! }); ! fileText.setText(defFileName); ! checkFilename(); ! createExporterSpecificControls(holder); ! } ! /** ! * Uses the standard container st election dialog to ! * choose the new value for the container field. ! */ ! private void handleBrowse() ! { ! ContainerSelectionDialog dialog = ! new ContainerSelectionDialog( ! getShell(), ! ResourcesPlugin.getWorkspace().getRoot(), ! false, ! "Select new file container"); ! if (dialog.open() == ContainerSelectionDialog.OK) ! { ! Object[] result = dialog.getResult(); ! if (result.length == 1) ! { ! containerText.setText(((Path)result[0]).toOSString()); ! } ! } ! } ! private void updateStatus(String message) ! { ! setErrorMessage(message); ! setPageComplete(message == null); ! } ! /** ! * ! */ ! protected void checkFilename() ! { ! if (containerText.getText().length() == 0) ! { ! updateStatus("File container must be specified"); ! return; ! } ! filePath = new Path(containerText.getText()); ! if (fileText.isEnabled()) ! { ! if (fileText.getText().length() == 0) ! { ! updateStatus("File name must be specified"); ! return; ! } ! IPath f = new Path(fileText.getText()); ! f = f.removeFileExtension().addFileExtension(model.getExporterFileExt(modelAccessKey)); ! filePath = filePath.addTrailingSeparator().append(f); ! IStatus s = ResourcesPlugin.getWorkspace().validatePath( ! filePath.toString(), ! IResource.FILE); ! if (!s.isOK()) ! { ! updateStatus("Not a valid file path :" + s.getMessage()); ! return; ! } ! } ! updateStatus(null); ! } ! /** ! * @return Returns the filePath. ! */ ! public IPath getFilePath() ! { ! return filePath; ! } ! private void createExporterSpecificControls(Composite container) ! { ! if (exporterSpecificParametersGroup != null) { ! exporterSpecificParametersGroup.dispose(); ! exporterSpecificParametersGroup = null; ! } ! params = model.getModelExporter(modelAccessKey).getParameters(model.getCurrentModel()); ! if (params != null) ! { ! exporterSpecificParametersGroup = new Group(container, SWT.NONE); exporterSpecificParametersGroup.setText("Exporter Specific Parameters"); ! exporterSpecificParametersGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); ! final GridLayout gridLayout_1 = new GridLayout(); ! gridLayout_1.numColumns = 3; ! exporterSpecificParametersGroup.setLayout(gridLayout_1); ! for (Iterator i = params.values().iterator(); i.hasNext();) ! { ! ExportParameter param = (ExportParameter)i.next(); ! param.addWidgets(exporterSpecificParametersGroup); ! } ! } // Compute the new window size. ! container.layout(true); getShell().layout(true); ! Point p = getShell().computeSize(500,SWT.DEFAULT,true); getShell().setSize(p); - - } ! public int getModelAccessKey() ! { ! return modelAccessKey; ! } ! public void setModelAccessKey(int modelAccessKey) ! { ! this.modelAccessKey = modelAccessKey; ! fields.clear(); ! createExporterSpecificControls(holder); ! if (model.isFile(modelAccessKey)) ! { ! fileLabel.setEnabled(true); ! fileText.setEnabled(true); ! } ! else ! { ! fileLabel.setEnabled(false); ! fileText.setEnabled(false); ! } ! checkFilename(); ! } ! public Map getParameters() ! { ! return params; ! } } \ No newline at end of file --- 50,250 ---- import org.eclipse.ui.help.WorkbenchHelp; + public class ModelExtractWizardPage2 extends WizardPage { + + private Text fileText; + + private Text containerText; + + ModelAccess model = ModelAccess.INSTANCE; + + ArrayList fields = new ArrayList(); + + private int modelAccessKey; + + private Composite holder; + + private IContainer container; + + private IPath filePath; + + private Label fileLabel; private Group exporterSpecificParametersGroup; + private Map params; ! public ModelExtractWizardPage2(IContainer container) { ! super("Model Exporter"); ! setTitle("Model Exporter"); ! setDescription("Specify the required parameters."); ! setImageDescriptor(ModelWizardPlugin.getIconPath("wizardIcon.gif")); ! this.container = container; ! } ! public void createControl(Composite parent) { ! holder = new Composite(parent, SWT.NULL); ! holder.setLayout(new GridLayout()); ! WorkbenchHelp.setHelp(holder, "net.sourceforge.modelwizard.documentation.exportWizardHelpId"); ! setControl(holder); ! final Group destinationGroup = new Group(holder, SWT.NONE); ! destinationGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); ! destinationGroup.setLayout(new FormLayout()); ! destinationGroup.setText("Destination "); ! final Label containerLabel = new Label(destinationGroup, SWT.NONE); ! final FormData formData_1 = new FormData(); ! formData_1.top = new FormAttachment(0, 5); ! formData_1.left = new FormAttachment(0, 5); ! containerLabel.setLayoutData(formData_1); ! containerLabel.setText("Container"); ! final Button containerBrowseButton = new Button(destinationGroup, SWT.PUSH); ! final FormData formData_2 = new FormData(); ! formData_2.top = new FormAttachment(containerLabel, 0, SWT.CENTER); ! formData_2.right = new FormAttachment(100, -5); ! containerBrowseButton.setLayoutData(formData_2); ! containerBrowseButton.setText("Browse..."); ! containerBrowseButton.addSelectionListener(new SelectionAdapter() { ! public void widgetSelected(SelectionEvent e) { ! handleBrowse(); ! checkFilename(); ! } ! }); ! containerText = new Text(destinationGroup, SWT.BORDER); ! final FormData formData = new FormData(); ! formData.top = new FormAttachment(containerLabel, 0, SWT.CENTER); ! formData.right = new FormAttachment(containerBrowseButton, -5, SWT.DEFAULT); ! formData.left = new FormAttachment(containerLabel, 5, SWT.DEFAULT); ! containerText.setLayoutData(formData); ! containerText.setEditable(false); ! containerText.setText(container.getFullPath().toOSString()); ! final String defFileName = "export"; ! fileLabel = new Label(destinationGroup, SWT.NONE); ! final FormData formData_3 = new FormData(); ! formData_3.top = new FormAttachment(containerBrowseButton, 10, SWT.DEFAULT); ! formData_3.left = new FormAttachment(0, 5); ! fileLabel.setLayoutData(formData_3); ! fileLabel.setText("File"); ! fileText = new Text(destinationGroup, SWT.BORDER); ! final FormData formData_4 = new FormData(); ! formData_4.right = new FormAttachment(100, -5); ! formData_4.top = new FormAttachment(fileLabel, 0, SWT.CENTER); ! formData_4.left = new FormAttachment(containerText, 0, SWT.LEFT); ! fileText.setLayoutData(formData_4); ! fileText.addModifyListener(new ModifyListener() { ! public void modifyText(ModifyEvent e) { ! checkFilename(); ! } ! }); ! fileText.setText(defFileName); ! checkFilename(); ! createExporterSpecificControls(holder); ! } ! /** ! * Uses the standard container st election dialog to choose the new value ! * for the container field. ! */ ! private void handleBrowse() { ! ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), ! false, "Select new file container"); ! if (dialog.open() == ContainerSelectionDialog.OK) { ! Object[] result = dialog.getResult(); ! if (result.length == 1) { ! containerText.setText(((Path) result[0]).toOSString()); ! } ! } ! } ! private void updateStatus(String message) { ! setErrorMessage(message); ! setPageComplete(message == null); ! } ! /** ! * ! */ ! protected void checkFilename() { ! if (containerText.getText().length() == 0) { ! updateStatus("File container must be specified"); ! return; ! } ! filePath = new Path(containerText.getText()); ! if (fileText.isEnabled()) { ! if (fileText.getText().length() == 0) { ! updateStatus("File name must be specified"); ! return; ! } ! IPath f = new Path(fileText.getText()); ! f = f.removeFileExtension().addFileExtension(model.getExporterFileExt(modelAccessKey)); ! filePath = filePath.addTrailingSeparator().append(f); ! IStatus s = ResourcesPlugin.getWorkspace().validatePath(filePath.toString(), IResource.FILE); ! if (!s.isOK()) { ! updateStatus("Not a valid file path :" + s.getMessage()); ! return; ! } ! } ! updateStatus(null); ! } ! /** ! * @return Returns the filePath. ! */ ! public IPath getFilePath() { ! return filePath; ! } ! private void createExporterSpecificControls(Composite container) { ! if (exporterSpecificParametersGroup != null) { ! exporterSpecificParametersGroup.dispose(); ! exporterSpecificParametersGroup = null; ! } ! params = model.getModelExporter(modelAccessKey).getParameters(model.getCurrentModel()); ! if (params != null) { ! exporterSpecificParametersGroup = new Group(container, SWT.NONE); exporterSpecificParametersGroup.setText("Exporter Specific Parameters"); ! exporterSpecificParametersGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); ! final GridLayout gridLayout_1 = new GridLayout(); ! gridLayout_1.numColumns = 3; ! exporterSpecificParametersGroup.setLayout(gridLayout_1); ! for (Iterator i = params.values().iterator(); i.hasNext();) { ! ExportParameter param = (ExportParameter) i.next(); ! param.addWidgets(exporterSpecificParametersGroup); ! } ! } // Compute the new window size. ! container.layout(true); getShell().layout(true); ! Point p = getShell().computeSize(500, SWT.DEFAULT, true); getShell().setSize(p); ! } ! public int getModelAccessKey() { ! return modelAccessKey; ! } ! public void setModelAccessKey(int modelAccessKey) { ! this.modelAccessKey = modelAccessKey; ! fields.clear(); ! createExporterSpecificControls(holder); ! if (model.isFile(modelAccessKey)) { ! fileLabel.setEnabled(true); ! fileText.setEnabled(true); ! } else { ! fileLabel.setEnabled(false); ! fileText.setEnabled(false); ! } ! checkFilename(); ! } ! ! public Map getParameters() { ! return params; ! } } \ No newline at end of file |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:16:17
|
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/wizards In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22838/src/net/sourceforge/modelWizard/wizards Modified Files: ModelExtractWizard.java Log Message: reformatted Index: ModelExtractWizard.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/wizards/ModelExtractWizard.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ModelExtractWizard.java 24 Oct 2006 23:13:00 -0000 1.4 --- ModelExtractWizard.java 30 Oct 2006 15:16:08 -0000 1.5 *************** *** 43,54 **** public class ModelExtractWizard extends Wizard { ! IStructuredSelection selection; ModelExtractWizardPage2 page2; private Iterator classes; public ModelExtractWizard(IContainer container, Iterator iterator) { super(); ! if (ModelAccess.INSTANCE.getNumberOfModelExporters()==0) { MessageBox mb = new MessageBox(new Shell(Display.getDefault()), SWT.ICON_INFORMATION | SWT.OK); mb.setMessage("There are no exporters configured for the current Model."); --- 43,56 ---- public class ModelExtractWizard extends Wizard { ! IStructuredSelection selection; + ModelExtractWizardPage2 page2; + private Iterator classes; public ModelExtractWizard(IContainer container, Iterator iterator) { super(); ! if (ModelAccess.INSTANCE.getNumberOfModelExporters() == 0) { MessageBox mb = new MessageBox(new Shell(Display.getDefault()), SWT.ICON_INFORMATION | SWT.OK); mb.setMessage("There are no exporters configured for the current Model."); *************** *** 70,81 **** public boolean performFinish() { ! IRunnableWithProgress op = new ExportOperation(page2.getFilePath(), page2.getModelAccessKey(), page2.getParameters(), classes, getContainer()); try { ! getContainer().run(false,true,op); } catch (InvocationTargetException e) { ! ExceptionDetailsDialog dialog = new ExceptionDetailsDialog( ! new Shell(Display.getDefault()), ! "Encountered error during export.", ! null, null, e); dialog.open(); ModelWizardPlugin.logError(e); --- 72,82 ---- public boolean performFinish() { ! IRunnableWithProgress op = new ExportOperation(page2.getFilePath(), page2.getModelAccessKey(), ! page2.getParameters(), classes, getContainer()); try { ! getContainer().run(false, true, op); } catch (InvocationTargetException e) { ! ExceptionDetailsDialog dialog = new ExceptionDetailsDialog(new Shell(Display.getDefault()), ! "Encountered error during export.", null, null, e); dialog.open(); ModelWizardPlugin.logError(e); *************** *** 87,100 **** } ! class ExportOperation extends WorkspaceModifyOperation{ private Map parameters; private IPath filePath; private IModelExporter exporter; private IModel model; private Iterator classes; IRunnableContext runnableContext; ! ! public ExportOperation(IPath path, int modelAccessKey, Map parameters, Iterator classes, IRunnableContext runnableContext) { super(); this.parameters = parameters; --- 88,107 ---- } ! class ExportOperation extends WorkspaceModifyOperation { private Map parameters; + private IPath filePath; + private IModelExporter exporter; + private IModel model; + private Iterator classes; + IRunnableContext runnableContext; ! ! public ExportOperation(IPath path, int modelAccessKey, Map parameters, ! Iterator classes, IRunnableContext runnableContext) { super(); this.parameters = parameters; *************** *** 103,117 **** this.runnableContext = runnableContext; exporter = ModelAccess.INSTANCE.getModelExporter(modelAccessKey); ! model = ModelAccess.INSTANCE.getCurrentModel(); } protected void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { ! exporter.exportModel(model,classes,parameters,filePath,monitor,runnableContext); } catch (ModelTransformationException e) { throw new InvocationTargetException(e); } } ! } } --- 110,124 ---- this.runnableContext = runnableContext; exporter = ModelAccess.INSTANCE.getModelExporter(modelAccessKey); ! model = ModelAccess.INSTANCE.getCurrentModel(); } protected void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { ! exporter.exportModel(model, classes, parameters, filePath, monitor, runnableContext); } catch (ModelTransformationException e) { throw new InvocationTargetException(e); } } ! } } |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:15:04
|
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/modelAbstraction In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22048/src/net/sourceforge/modelWizard/modelAbstraction Modified Files: ModelAccess.java Log Message: reformatted Index: ModelAccess.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/modelAbstraction/ModelAccess.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ModelAccess.java 24 Oct 2006 21:41:30 -0000 1.8 --- ModelAccess.java 30 Oct 2006 15:14:59 -0000 1.9 *************** *** 69,82 **** private URI currentMenuFolder = null; ! private ArrayList listeners = new ArrayList(); private class ModelExporter { ! private IModelExporter exporter; private String name; private String fileExt; private String targetType; ! public ModelExporter(IConfigurationElement element) { Object o = null; --- 69,85 ---- private URI currentMenuFolder = null; ! private ArrayList listeners = new ArrayList(); private class ModelExporter { ! private IModelExporter exporter; + private String name; + private String fileExt; + private String targetType; ! public ModelExporter(IConfigurationElement element) { Object o = null; *************** *** 84,95 **** o = element.createExecutableExtension("class"); } catch (CoreException e) { ! throw new ModelAbstractionError( ! "Cannot instantiate Model Exporter", e); } if (o instanceof IModelExporter) exporter = (IModelExporter) o; else ! throw new ModelAbstractionError( ! "Did not get an instance of IModelExporter"); name = element.getAttribute("name"); fileExt = element.getAttribute("fileExtension"); --- 87,96 ---- o = element.createExecutableExtension("class"); } catch (CoreException e) { ! throw new ModelAbstractionError("Cannot instantiate Model Exporter", e); } if (o instanceof IModelExporter) exporter = (IModelExporter) o; else ! throw new ModelAbstractionError("Did not get an instance of IModelExporter"); name = element.getAttribute("name"); fileExt = element.getAttribute("fileExtension"); *************** *** 108,113 **** return name; } ! ! public boolean isFile(){ if (targetType == null || targetType.equalsIgnoreCase("file")) return true; --- 109,114 ---- return name; } ! ! public boolean isFile() { if (targetType == null || targetType.equalsIgnoreCase("file")) return true; *************** *** 116,120 **** } } ! /** * Container for model abstraction information. --- 117,121 ---- } } ! /** * Container for model abstraction information. *************** *** 125,128 **** --- 126,130 ---- private IConfigurationElement ce; + private ArrayList modelExporters = new ArrayList(); *************** *** 130,134 **** this.ce = ce; IConfigurationElement[] exports = ce.getChildren("modelExport"); ! for (int i = 0;i<exports.length;i++){ modelExporters.add(new ModelExporter(exports[i])); } --- 132,136 ---- this.ce = ce; IConfigurationElement[] exports = ce.getChildren("modelExport"); ! for (int i = 0; i < exports.length; i++) { modelExporters.add(new ModelExporter(exports[i])); } *************** *** 140,151 **** o = ce.createExecutableExtension("class"); } catch (CoreException e) { ! throw new ModelAbstractionError( ! "Cannot instantiate Model Abstraction", e); } if (o instanceof IModel) return (IModel) o; else ! throw new ModelAbstractionError( ! "Did not get an instance of IModel"); } --- 142,151 ---- o = ce.createExecutableExtension("class"); } catch (CoreException e) { ! throw new ModelAbstractionError("Cannot instantiate Model Abstraction", e); } if (o instanceof IModel) return (IModel) o; else ! throw new ModelAbstractionError("Did not get an instance of IModel"); } *************** *** 155,160 **** URL folderUrl = Platform.find(b, new Path(folder)); if (folderUrl == null) ! throw new ModelAbstractionError( ! "Invalid or non-existant folder directory:"+folder); URL resolved = Platform.resolve(folderUrl); URI fUri = URI.createFileURI(resolved.getFile()); --- 155,159 ---- URL folderUrl = Platform.find(b, new Path(folder)); if (folderUrl == null) ! throw new ModelAbstractionError("Invalid or non-existant folder directory:" + folder); URL resolved = Platform.resolve(folderUrl); URI fUri = URI.createFileURI(resolved.getFile()); *************** *** 167,172 **** URL folderUrl = Platform.find(b, new Path(folder)); if (folderUrl == null) ! throw new ModelAbstractionError( ! "Invalid or non-existant menu directory:"+folder); URL resolved = Platform.resolve(folderUrl); URI fUri = URI.createFileURI(resolved.getFile()); --- 166,170 ---- URL folderUrl = Platform.find(b, new Path(folder)); if (folderUrl == null) ! throw new ModelAbstractionError("Invalid or non-existant menu directory:" + folder); URL resolved = Platform.resolve(folderUrl); URI fUri = URI.createFileURI(resolved.getFile()); *************** *** 174,178 **** } ! public boolean isPrimary(){ String pri = ce.getAttribute("primary"); if (pri == null) --- 172,176 ---- } ! public boolean isPrimary() { String pri = ce.getAttribute("primary"); if (pri == null) *************** *** 182,191 **** return false; } ! ! public String getPluginId(){ Bundle b = Platform.getBundle(ce.getDeclaringExtension().getNamespace()); return b.getSymbolicName(); } ! public URI getDefaultModelFile() throws IOException { Bundle b = Platform.getBundle(ce.getDeclaringExtension().getNamespace()); --- 180,189 ---- return false; } ! ! public String getPluginId() { Bundle b = Platform.getBundle(ce.getDeclaringExtension().getNamespace()); return b.getSymbolicName(); } ! public URI getDefaultModelFile() throws IOException { Bundle b = Platform.getBundle(ce.getDeclaringExtension().getNamespace()); *************** *** 203,225 **** return ce.getAttribute("name"); } ! ! public int getNumberOfExporters(){ return modelExporters.size(); } ! ! public IModelExporter getExporter(int n){ ModelExporter m = (ModelExporter) modelExporters.get(n); return m.getExporter(); } ! public String getExporterFileExt(int n){ ModelExporter m = (ModelExporter) modelExporters.get(n); return m.getFileExt(); } ! public String getExporterName(int n){ ModelExporter m = (ModelExporter) modelExporters.get(n); return m.getName(); } ! public boolean isFile(int n){ ModelExporter m = (ModelExporter) modelExporters.get(n); return m.isFile(); --- 201,225 ---- return ce.getAttribute("name"); } ! ! public int getNumberOfExporters() { return modelExporters.size(); } ! ! public IModelExporter getExporter(int n) { ModelExporter m = (ModelExporter) modelExporters.get(n); return m.getExporter(); } ! public String getExporterFileExt(int n) { ModelExporter m = (ModelExporter) modelExporters.get(n); return m.getFileExt(); } ! ! public String getExporterName(int n) { ModelExporter m = (ModelExporter) modelExporters.get(n); return m.getName(); } ! ! public boolean isFile(int n) { ModelExporter m = (ModelExporter) modelExporters.get(n); return m.isFile(); *************** *** 243,271 **** * same do nothing. - If model is different, - Just change the profile (no * performance impact. - Need to trigger notification of changes... ! * @throws IOException */ public void updateCurrentSetting() throws IOException { URI candidateModelFile; ! String newKey = preferences ! .getString(PreferencesInitializer.MODEL_PLUGIN); if (newKey.equals("") || !definitions.containsKey(newKey)) { newKey = getPrimary(); preferences.setValue(PreferencesInitializer.MODEL_PLUGIN, newKey); } ! ModelDefinition newMd = (ModelDefinition) definitions.get(newKey); ! boolean useDefaultModel = preferences ! .getBoolean(PreferencesInitializer.USE_DEFAULT_MODEL); String model = preferences.getString(PreferencesInitializer.MODEL); ! boolean useProfileDefault = preferences ! .getBoolean(PreferencesInitializer.USE_DEFAULT_PROFILES); ! String profileFolder = preferences ! .getString(PreferencesInitializer.PROFILE_FOLDER); ! boolean useMenuDefault = preferences ! .getBoolean(PreferencesInitializer.USE_DEFAULT_MENU); ! String menuFolder = preferences ! .getString(PreferencesInitializer.MENU_FOLDER); ! if (useDefaultModel) candidateModelFile = newMd.getDefaultModelFile(); --- 243,266 ---- * same do nothing. - If model is different, - Just change the profile (no * performance impact. - Need to trigger notification of changes... ! * ! * @throws IOException */ public void updateCurrentSetting() throws IOException { URI candidateModelFile; ! String newKey = preferences.getString(PreferencesInitializer.MODEL_PLUGIN); if (newKey.equals("") || !definitions.containsKey(newKey)) { newKey = getPrimary(); preferences.setValue(PreferencesInitializer.MODEL_PLUGIN, newKey); } ! ModelDefinition newMd = (ModelDefinition) definitions.get(newKey); ! boolean useDefaultModel = preferences.getBoolean(PreferencesInitializer.USE_DEFAULT_MODEL); String model = preferences.getString(PreferencesInitializer.MODEL); ! boolean useProfileDefault = preferences.getBoolean(PreferencesInitializer.USE_DEFAULT_PROFILES); ! String profileFolder = preferences.getString(PreferencesInitializer.PROFILE_FOLDER); ! boolean useMenuDefault = preferences.getBoolean(PreferencesInitializer.USE_DEFAULT_MENU); ! String menuFolder = preferences.getString(PreferencesInitializer.MENU_FOLDER); ! if (useDefaultModel) candidateModelFile = newMd.getDefaultModelFile(); *************** *** 285,292 **** notifyProfileChanges(); notifyMenuChanges(); ! if (key == null || !newKey.equalsIgnoreCase(key)) { // set up all defaults and open model ... ! currentModel = null; key = newKey; currentModelFile = candidateModelFile; --- 280,287 ---- notifyProfileChanges(); notifyMenuChanges(); ! if (key == null || !newKey.equalsIgnoreCase(key)) { // set up all defaults and open model ... ! currentModel = null; key = newKey; currentModelFile = candidateModelFile; *************** *** 312,330 **** private void getAbstractionInterfaces() { IExtensionRegistry registry = Platform.getExtensionRegistry(); ! IExtensionPoint point = registry ! .getExtensionPoint("net.sourceforge.modelWizard.modelAbstraction"); if (point == null) return; IExtension[] extensions = point.getExtensions(); for (int n = 0; n < extensions.length; n++) { ! IConfigurationElement[] ce = extensions[n] ! .getConfigurationElements(); for (int m = 0; m < ce.length; m++) { ! definitions.put(ce[m].getAttribute("name"), ! new ModelDefinition(ce[m])); } } } ! /** * Use by preferences only ... --- 307,322 ---- private void getAbstractionInterfaces() { IExtensionRegistry registry = Platform.getExtensionRegistry(); ! IExtensionPoint point = registry.getExtensionPoint("net.sourceforge.modelWizard.modelAbstraction"); if (point == null) return; IExtension[] extensions = point.getExtensions(); for (int n = 0; n < extensions.length; n++) { ! IConfigurationElement[] ce = extensions[n].getConfigurationElements(); for (int m = 0; m < ce.length; m++) { ! definitions.put(ce[m].getAttribute("name"), new ModelDefinition(ce[m])); } } } ! /** * Use by preferences only ... *************** *** 346,352 **** /** ! * Use by preferences only ... ! * It will return the key for the primary model. If multiple primaries are set the first one will be return, ! * if none then the first key will be returned. * * @return --- 338,344 ---- /** ! * Use by preferences only ... It will return the key for the primary model. ! * If multiple primaries are set the first one will be return, if none then ! * the first key will be returned. * * @return *************** *** 368,372 **** * * @return ! * @throws IOException */ public URI getDefaultModel(String key) throws IOException { --- 360,364 ---- * * @return ! * @throws IOException */ public URI getDefaultModel(String key) throws IOException { *************** *** 379,383 **** * * @return ! * @throws IOException */ public URI getDefaultProfileDirectory(String key) throws IOException { --- 371,375 ---- * * @return ! * @throws IOException */ public URI getDefaultProfileDirectory(String key) throws IOException { *************** *** 462,468 **** public String getPluginId(String key) { ! return ((ModelDefinition)definitions.get(key)).getPluginId(); } ! /** * Get the number of exporters for the current model --- 454,460 ---- public String getPluginId(String key) { ! return ((ModelDefinition) definitions.get(key)).getPluginId(); } ! /** * Get the number of exporters for the current model *************** *** 470,474 **** * @return */ ! public int getNumberOfModelExporters(){ ModelDefinition md = (ModelDefinition) definitions.get(key); return md.getNumberOfExporters(); --- 462,466 ---- * @return */ ! public int getNumberOfModelExporters() { ModelDefinition md = (ModelDefinition) definitions.get(key); return md.getNumberOfExporters(); *************** *** 477,484 **** /** * Get one of the exporter classes ! * @param n the index for the exporter element * @return */ ! public IModelExporter getModelExporter(int n){ ModelDefinition md = (ModelDefinition) definitions.get(key); return md.getExporter(n); --- 469,478 ---- /** * Get one of the exporter classes ! * ! * @param n ! * the index for the exporter element * @return */ ! public IModelExporter getModelExporter(int n) { ModelDefinition md = (ModelDefinition) definitions.get(key); return md.getExporter(n); *************** *** 487,512 **** /** * Get the name of an Exporter ! * @param n the index for the exporter element * @return */ ! public String getExporterName(int n){ ModelDefinition md = (ModelDefinition) definitions.get(key); return md.getExporterName(n); } /** * Get the file extension for an Exporter ! * @param n the index for the exporter element * @return */ ! public String getExporterFileExt(int n){ ModelDefinition md = (ModelDefinition) definitions.get(key); return md.getExporterFileExt(n); } /** * Does this exporter output to a file or a folder? ! * @param n the index for the exporter element * @return */ ! public boolean isFile(int n){ ModelDefinition md = (ModelDefinition) definitions.get(key); return md.isFile(n); --- 481,514 ---- /** * Get the name of an Exporter ! * ! * @param n ! * the index for the exporter element * @return */ ! public String getExporterName(int n) { ModelDefinition md = (ModelDefinition) definitions.get(key); return md.getExporterName(n); } + /** * Get the file extension for an Exporter ! * ! * @param n ! * the index for the exporter element * @return */ ! public String getExporterFileExt(int n) { ModelDefinition md = (ModelDefinition) definitions.get(key); return md.getExporterFileExt(n); } + /** * Does this exporter output to a file or a folder? ! * ! * @param n ! * the index for the exporter element * @return */ ! public boolean isFile(int n) { ModelDefinition md = (ModelDefinition) definitions.get(key); return md.isFile(n); |
|
From: jistrawn <jis...@us...> - 2006-10-30 15:13:29
|
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/META-INF In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21549/META-INF Modified Files: MANIFEST.MF Log Message: v2.0.19 Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/META-INF/MANIFEST.MF,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** MANIFEST.MF 13 Oct 2006 20:35:05 -0000 1.15 --- MANIFEST.MF 30 Oct 2006 15:13:20 -0000 1.16 *************** *** 3,7 **** Bundle-Name: Model Wizard Bundle-SymbolicName: net.sourceforge.modelWizard; singleton:=true ! Bundle-Version: 2.0.18 Bundle-Localization: plugin Bundle-ClassPath: modelWizard.jar, --- 3,7 ---- Bundle-Name: Model Wizard Bundle-SymbolicName: net.sourceforge.modelWizard; singleton:=true ! Bundle-Version: 2.0.19 Bundle-Localization: plugin Bundle-ClassPath: modelWizard.jar, *************** *** 26,29 **** Bundle-Vendor: Cisco Eclipse-AutoStart: true - Provide-Package: net.sourceforge.modelWizard.backingModelAbstraction, - net.sourceforge.modelWizard.utilities --- 26,27 ---- |
|
From: jistrawn <jis...@us...> - 2006-10-24 21:45:22
|
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/utilities In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4368/src/net/sourceforge/modelWizard/utilities Modified Files: ProfileUtilities.java PathUtilties.java XslTransformer.java Log Message: removed unused imports or reformatted import order (ctrl-shift-o) Index: PathUtilties.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/utilities/PathUtilties.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PathUtilties.java 6 Oct 2005 15:59:05 -0000 1.2 --- PathUtilties.java 24 Oct 2006 21:45:18 -0000 1.3 *************** *** 1,49 **** ! /* ! * Created on Sep 29, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.utilities; ! ! import net.sourceforge.modelWizard.modelAbstraction.ModelAccess; ! ! import org.eclipse.core.resources.IResource; ! import org.eclipse.core.resources.ResourcesPlugin; ! import org.eclipse.core.runtime.Path; ! import org.eclipse.emf.common.util.URI; ! ! /** ! * @author stjerman ! * Date: Sep 29, 2005 ! */ ! public class PathUtilties { ! ! /** ! * converts a *local* resource ot File URI to a File path ! */ ! public static String convertLocalURItoFile(URI folder) { ! String f = ""; ! ! if (folder.isFile()) { ! return folder.toFileString(); ! } ! if (folder.scheme().equals("platform")) { ! IResource c = ResourcesPlugin.getWorkspace().getRoot().findMember( ! new Path(folder.path()).removeFirstSegments(1)); ! f = c.getLocation().toOSString(); ! } ! return f; ! ! } ! ! } --- 1,47 ---- ! /* ! * Created on Sep 29, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.utilities; ! ! import org.eclipse.core.resources.IResource; ! import org.eclipse.core.resources.ResourcesPlugin; ! import org.eclipse.core.runtime.Path; ! import org.eclipse.emf.common.util.URI; ! ! /** ! * @author stjerman ! * Date: Sep 29, 2005 ! */ ! public class PathUtilties { ! ! /** ! * converts a *local* resource ot File URI to a File path ! */ ! public static String convertLocalURItoFile(URI folder) { ! String f = ""; ! ! if (folder.isFile()) { ! return folder.toFileString(); ! } ! if (folder.scheme().equals("platform")) { ! IResource c = ResourcesPlugin.getWorkspace().getRoot().findMember( ! new Path(folder.path()).removeFirstSegments(1)); ! f = c.getLocation().toOSString(); ! } ! return f; ! ! } ! ! } Index: ProfileUtilities.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/utilities/ProfileUtilities.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ProfileUtilities.java 6 May 2006 22:47:33 -0000 1.7 --- ProfileUtilities.java 24 Oct 2006 21:45:17 -0000 1.8 *************** *** 44,47 **** --- 44,48 ---- import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; + import org.eclipse.emf.common.ui.URIEditorInput; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.TreeIterator; *************** *** 63,67 **** import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.WorkbenchPlugin; - import org.eclipse.emf.common.ui.URIEditorInput; ; --- 64,67 ---- Index: XslTransformer.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/utilities/XslTransformer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XslTransformer.java 7 Dec 2005 18:19:17 -0000 1.2 --- XslTransformer.java 24 Oct 2006 21:45:18 -0000 1.3 *************** *** 1,172 **** ! /* ! * Created on Sep 27, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.utilities; ! ! import java.io.File; ! import java.io.IOException; ! import java.io.InputStream; ! import java.net.URL; ! import java.text.SimpleDateFormat; ! import java.util.Calendar; ! ! import javax.xml.transform.Result; ! import javax.xml.transform.Source; ! import javax.xml.transform.Transformer; ! import javax.xml.transform.TransformerConfigurationException; ! import javax.xml.transform.TransformerException; ! import javax.xml.transform.TransformerFactory; ! import javax.xml.transform.stream.StreamResult; ! import javax.xml.transform.stream.StreamSource; ! ! import net.sourceforge.modelWizard.ModelWizardPlugin; ! ! import org.eclipse.core.runtime.Path; ! import org.eclipse.emf.common.util.URI; ! import org.eclipse.emf.ecore.resource.impl.URIConverterImpl; ! ! public class XslTransformer { ! ! private TransformerFactory factory; ! ! private Transformer transform; ! ! private URIConverterImpl conv = new URIConverterImpl(); ! ! private void createTransformer(URL xsl) throws IOException, ! TransformerConfigurationException { ! factory = TransformerFactory.newInstance(); ! Source xslSource; ! xslSource = new StreamSource(xsl.openStream()); ! transform = factory.newTransformer(xslSource); ! } ! ! /** ! * Constructor. Pass in a URL for an XSL file. ! * ! * @param xsl ! * @throws IOException ! * @throws TransformerConfigurationException ! * @throws CimWizardTransformException ! * @throws IOException ! * @throws TransformerConfigurationException ! */ ! public XslTransformer(URL xsl) throws TransformerConfigurationException, ! IOException { ! createTransformer(xsl); ! } ! ! /** ! * Change the XSL for the transformation. ! * ! * @param xsl ! * @throws CimWizardTransformException ! * @throws IOException ! * @throws TransformerConfigurationException ! */ ! public void setXsl(URL xsl) throws IOException, ! TransformerConfigurationException { ! Source xslSource; ! xslSource = new StreamSource(xsl.openStream()); ! transform = null; ! transform = factory.newTransformer(xslSource); ! } ! ! /** ! * Clear the parameters for the XSL tranformation. ! * ! */ ! public void clearParameters() { ! transform.clearParameters(); ! } ! ! private void transform(URI resultFile, Source source) throws IOException, ! TransformerException { ! Result result; ! result = new StreamResult(conv.createOutputStream(resultFile)); ! transform.transform(source, result); ! result = null; ! } ! ! /** ! * Transform an input stream. Put result at URI ! * (org.eclipse.emf.common.util.URI) specified by resultFile. ! * ! * @param resultFile ! * @param in ! * @throws TransformerException ! * @throws IOException ! * @throws CimWizardTransformException ! */ ! public void transformStream(URI resultFile, InputStream in) ! throws IOException, TransformerException { ! Source xmlSource = new StreamSource(in); ! transform(resultFile, xmlSource); ! } ! ! /** ! * Set a parameter 'name' for the transformation to value. ! * ! * @param name ! * @param value ! */ ! public void setParameter(String name, String value) { ! transform.setParameter(name, value); ! } ! ! /** ! * Transform a File. Put result at URI (org.eclipse.emf.common.util.URI) ! * specified by resultFile. ! * ! * @param resultFile ! * @param in ! * @throws TransformerException ! * @throws IOException ! * @throws CimWizardTransformException ! */ ! public void transformFile(URI resultFile, File in) throws IOException, ! TransformerException { ! Source source = new StreamSource(in); ! transform(resultFile, source); ! } ! ! /** ! * Transform the contents of a File. Put result at URI ! * (org.eclipse.emf.common.util.URI) specified by resultFile. ! * ! * @param resultFile ! * @param in ! * @throws CimWizardTransformException ! * @throws IOException ! * @throws TransformerException ! */ ! public void transformUri(URI resultFile, URI in) throws IOException, ! TransformerException { ! Source source; ! source = new StreamSource(conv.createInputStream(in)); ! transform(resultFile, source); ! } ! ! /** ! * Set a parameter for the transformation called version. The format for the ! * parameter is "'3.0.'yyyyMMdd" ! * ! */ ! public void setVersionParameter() { ! SimpleDateFormat sd = new SimpleDateFormat("'3.0.'yyyyMMdd"); ! String v = sd.format(Calendar.getInstance().getTime()); ! transform.setParameter("version", v); ! } ! } --- 1,169 ---- ! /* ! * Created on Sep 27, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.utilities; ! ! import java.io.File; ! import java.io.IOException; ! import java.io.InputStream; ! import java.net.URL; ! import java.text.SimpleDateFormat; ! import java.util.Calendar; ! ! import javax.xml.transform.Result; ! import javax.xml.transform.Source; ! import javax.xml.transform.Transformer; ! import javax.xml.transform.TransformerConfigurationException; ! import javax.xml.transform.TransformerException; ! import javax.xml.transform.TransformerFactory; ! import javax.xml.transform.stream.StreamResult; ! import javax.xml.transform.stream.StreamSource; ! ! import org.eclipse.emf.common.util.URI; ! import org.eclipse.emf.ecore.resource.impl.URIConverterImpl; ! ! public class XslTransformer { ! ! private TransformerFactory factory; ! ! private Transformer transform; ! ! private URIConverterImpl conv = new URIConverterImpl(); ! ! private void createTransformer(URL xsl) throws IOException, ! TransformerConfigurationException { ! factory = TransformerFactory.newInstance(); ! Source xslSource; ! xslSource = new StreamSource(xsl.openStream()); ! transform = factory.newTransformer(xslSource); ! } ! ! /** ! * Constructor. Pass in a URL for an XSL file. ! * ! * @param xsl ! * @throws IOException ! * @throws TransformerConfigurationException ! * @throws CimWizardTransformException ! * @throws IOException ! * @throws TransformerConfigurationException ! */ ! public XslTransformer(URL xsl) throws TransformerConfigurationException, ! IOException { ! createTransformer(xsl); ! } ! ! /** ! * Change the XSL for the transformation. ! * ! * @param xsl ! * @throws CimWizardTransformException ! * @throws IOException ! * @throws TransformerConfigurationException ! */ ! public void setXsl(URL xsl) throws IOException, ! TransformerConfigurationException { ! Source xslSource; ! xslSource = new StreamSource(xsl.openStream()); ! transform = null; ! transform = factory.newTransformer(xslSource); ! } ! ! /** ! * Clear the parameters for the XSL tranformation. ! * ! */ ! public void clearParameters() { ! transform.clearParameters(); ! } ! ! private void transform(URI resultFile, Source source) throws IOException, ! TransformerException { ! Result result; ! result = new StreamResult(conv.createOutputStream(resultFile)); ! transform.transform(source, result); ! result = null; ! } ! ! /** ! * Transform an input stream. Put result at URI ! * (org.eclipse.emf.common.util.URI) specified by resultFile. ! * ! * @param resultFile ! * @param in ! * @throws TransformerException ! * @throws IOException ! * @throws CimWizardTransformException ! */ ! public void transformStream(URI resultFile, InputStream in) ! throws IOException, TransformerException { ! Source xmlSource = new StreamSource(in); ! transform(resultFile, xmlSource); ! } ! ! /** ! * Set a parameter 'name' for the transformation to value. ! * ! * @param name ! * @param value ! */ ! public void setParameter(String name, String value) { ! transform.setParameter(name, value); ! } ! ! /** ! * Transform a File. Put result at URI (org.eclipse.emf.common.util.URI) ! * specified by resultFile. ! * ! * @param resultFile ! * @param in ! * @throws TransformerException ! * @throws IOException ! * @throws CimWizardTransformException ! */ ! public void transformFile(URI resultFile, File in) throws IOException, ! TransformerException { ! Source source = new StreamSource(in); ! transform(resultFile, source); ! } ! ! /** ! * Transform the contents of a File. Put result at URI ! * (org.eclipse.emf.common.util.URI) specified by resultFile. ! * ! * @param resultFile ! * @param in ! * @throws CimWizardTransformException ! * @throws IOException ! * @throws TransformerException ! */ ! public void transformUri(URI resultFile, URI in) throws IOException, ! TransformerException { ! Source source; ! source = new StreamSource(conv.createInputStream(in)); ! transform(resultFile, source); ! } ! ! /** ! * Set a parameter for the transformation called version. The format for the ! * parameter is "'3.0.'yyyyMMdd" ! * ! */ ! public void setVersionParameter() { ! SimpleDateFormat sd = new SimpleDateFormat("'3.0.'yyyyMMdd"); ! String v = sd.format(Calendar.getInstance().getTime()); ! transform.setParameter("version", v); ! } ! } |
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/ShoppingCartSchema/util In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3970/src/net/sourceforge/modelWizard/ShoppingCartSchema/util Modified Files: ShoppingCartSchemaResourceImpl.java ShoppingCartSchemaResourceFactoryImpl.java ShoppingCartSchemaAdapterFactory.java Log Message: removed unused imports or reformatted import order (ctrl-shift-o) Index: ShoppingCartSchemaAdapterFactory.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/ShoppingCartSchema/util/ShoppingCartSchemaAdapterFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ShoppingCartSchemaAdapterFactory.java 6 Oct 2005 15:59:06 -0000 1.1 --- ShoppingCartSchemaAdapterFactory.java 24 Oct 2006 21:45:01 -0000 1.2 *************** *** 1,192 **** ! /** ! * <copyright> ! * </copyright> ! * ! * $Id$ ! */ ! package net.sourceforge.modelWizard.ShoppingCartSchema.util; ! ! import net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot; ! import net.sourceforge.modelWizard.ShoppingCartSchema.Profile; ! import net.sourceforge.modelWizard.ShoppingCartSchema.ProfilePointer; ! import net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage; ! import net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartType; ! ! import org.eclipse.emf.common.notify.Adapter; ! import org.eclipse.emf.common.notify.Notifier; ! ! import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; ! ! import org.eclipse.emf.ecore.EObject; ! ! /** ! * <!-- begin-user-doc --> ! * The <b>Adapter Factory</b> for the model. ! * It provides an adapter <code>createXXX</code> method for each class of the model. ! * <!-- end-user-doc --> ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage ! * @generated ! */ ! public class ShoppingCartSchemaAdapterFactory extends AdapterFactoryImpl { ! /** ! * The cached model package. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! protected static ShoppingCartSchemaPackage modelPackage; ! ! /** ! * Creates an instance of the adapter factory. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! public ShoppingCartSchemaAdapterFactory() { ! if (modelPackage == null) { ! modelPackage = ShoppingCartSchemaPackage.eINSTANCE; ! } ! } ! ! /** ! * Returns whether this factory is applicable for the type of the object. ! * <!-- begin-user-doc --> ! * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. ! * <!-- end-user-doc --> ! * @return whether this factory is applicable for the type of the object. ! * @generated ! */ ! public boolean isFactoryForType(Object object) { ! if (object == modelPackage) { ! return true; ! } ! if (object instanceof EObject) { ! return ((EObject)object).eClass().getEPackage() == modelPackage; ! } ! return false; ! } ! ! /** ! * The switch the delegates to the <code>createXXX</code> methods. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! protected ShoppingCartSchemaSwitch modelSwitch = ! new ShoppingCartSchemaSwitch() { ! public Object caseClass(net.sourceforge.modelWizard.ShoppingCartSchema.Class object) { ! return createClassAdapter(); ! } ! public Object caseDocumentRoot(DocumentRoot object) { ! return createDocumentRootAdapter(); ! } ! public Object caseProfile(Profile object) { ! return createProfileAdapter(); ! } ! public Object caseProfilePointer(ProfilePointer object) { ! return createProfilePointerAdapter(); ! } ! public Object caseShoppingCartType(ShoppingCartType object) { ! return createShoppingCartTypeAdapter(); ! } ! public Object defaultCase(EObject object) { ! return createEObjectAdapter(); ! } ! }; ! ! /** ! * Creates an adapter for the <code>target</code>. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @param target the object to adapt. ! * @return the adapter for the <code>target</code>. ! * @generated ! */ ! public Adapter createAdapter(Notifier target) { ! return (Adapter)modelSwitch.doSwitch((EObject)target); ! } ! ! ! /** ! * Creates a new adapter for an object of class '{@link net.sourceforge.modelWizard.ShoppingCartSchema.Class <em>Class</em>}'. ! * <!-- begin-user-doc --> ! * This default implementation returns null so that we can easily ignore cases; ! * it's useful to ignore a case when inheritance will catch all the cases anyway. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.Class ! * @generated ! */ ! public Adapter createClassAdapter() { ! return null; ! } ! ! /** ! * Creates a new adapter for an object of class '{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot <em>Document Root</em>}'. ! * <!-- begin-user-doc --> ! * This default implementation returns null so that we can easily ignore cases; ! * it's useful to ignore a case when inheritance will catch all the cases anyway. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot ! * @generated ! */ ! public Adapter createDocumentRootAdapter() { ! return null; ! } ! ! /** ! * Creates a new adapter for an object of class '{@link net.sourceforge.modelWizard.ShoppingCartSchema.Profile <em>Profile</em>}'. ! * <!-- begin-user-doc --> ! * This default implementation returns null so that we can easily ignore cases; ! * it's useful to ignore a case when inheritance will catch all the cases anyway. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.Profile ! * @generated ! */ ! public Adapter createProfileAdapter() { ! return null; ! } ! ! /** ! * Creates a new adapter for an object of class '{@link net.sourceforge.modelWizard.ShoppingCartSchema.ProfilePointer <em>Profile Pointer</em>}'. ! * <!-- begin-user-doc --> ! * This default implementation returns null so that we can easily ignore cases; ! * it's useful to ignore a case when inheritance will catch all the cases anyway. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ProfilePointer ! * @generated ! */ ! public Adapter createProfilePointerAdapter() { ! return null; ! } ! ! /** ! * Creates a new adapter for an object of class '{@link net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartType <em>Shopping Cart Type</em>}'. ! * <!-- begin-user-doc --> ! * This default implementation returns null so that we can easily ignore cases; ! * it's useful to ignore a case when inheritance will catch all the cases anyway. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartType ! * @generated ! */ ! public Adapter createShoppingCartTypeAdapter() { ! return null; ! } ! ! /** ! * Creates a new adapter for the default case. ! * <!-- begin-user-doc --> ! * This default implementation returns null. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @generated ! */ ! public Adapter createEObjectAdapter() { ! return null; ! } ! ! } //ShoppingCartSchemaAdapterFactory --- 1,190 ---- ! /** ! * <copyright> ! * </copyright> ! * ! * $Id$ ! */ ! package net.sourceforge.modelWizard.ShoppingCartSchema.util; ! ! import net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot; ! import net.sourceforge.modelWizard.ShoppingCartSchema.Profile; ! import net.sourceforge.modelWizard.ShoppingCartSchema.ProfilePointer; ! import net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage; ! import net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartType; ! ! import org.eclipse.emf.common.notify.Adapter; ! import org.eclipse.emf.common.notify.Notifier; ! import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; ! import org.eclipse.emf.ecore.EObject; ! ! /** ! * <!-- begin-user-doc --> ! * The <b>Adapter Factory</b> for the model. ! * It provides an adapter <code>createXXX</code> method for each class of the model. ! * <!-- end-user-doc --> ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage ! * @generated ! */ ! public class ShoppingCartSchemaAdapterFactory extends AdapterFactoryImpl { ! /** ! * The cached model package. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! protected static ShoppingCartSchemaPackage modelPackage; ! ! /** ! * Creates an instance of the adapter factory. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! public ShoppingCartSchemaAdapterFactory() { ! if (modelPackage == null) { ! modelPackage = ShoppingCartSchemaPackage.eINSTANCE; ! } ! } ! ! /** ! * Returns whether this factory is applicable for the type of the object. ! * <!-- begin-user-doc --> ! * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. ! * <!-- end-user-doc --> ! * @return whether this factory is applicable for the type of the object. ! * @generated ! */ ! public boolean isFactoryForType(Object object) { ! if (object == modelPackage) { ! return true; ! } ! if (object instanceof EObject) { ! return ((EObject)object).eClass().getEPackage() == modelPackage; ! } ! return false; ! } ! ! /** ! * The switch the delegates to the <code>createXXX</code> methods. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! protected ShoppingCartSchemaSwitch modelSwitch = ! new ShoppingCartSchemaSwitch() { ! public Object caseClass(net.sourceforge.modelWizard.ShoppingCartSchema.Class object) { ! return createClassAdapter(); ! } ! public Object caseDocumentRoot(DocumentRoot object) { ! return createDocumentRootAdapter(); ! } ! public Object caseProfile(Profile object) { ! return createProfileAdapter(); ! } ! public Object caseProfilePointer(ProfilePointer object) { ! return createProfilePointerAdapter(); ! } ! public Object caseShoppingCartType(ShoppingCartType object) { ! return createShoppingCartTypeAdapter(); ! } ! public Object defaultCase(EObject object) { ! return createEObjectAdapter(); ! } ! }; ! ! /** ! * Creates an adapter for the <code>target</code>. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @param target the object to adapt. ! * @return the adapter for the <code>target</code>. ! * @generated ! */ ! public Adapter createAdapter(Notifier target) { ! return (Adapter)modelSwitch.doSwitch((EObject)target); ! } ! ! ! /** ! * Creates a new adapter for an object of class '{@link net.sourceforge.modelWizard.ShoppingCartSchema.Class <em>Class</em>}'. ! * <!-- begin-user-doc --> ! * This default implementation returns null so that we can easily ignore cases; ! * it's useful to ignore a case when inheritance will catch all the cases anyway. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.Class ! * @generated ! */ ! public Adapter createClassAdapter() { ! return null; ! } ! ! /** ! * Creates a new adapter for an object of class '{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot <em>Document Root</em>}'. ! * <!-- begin-user-doc --> ! * This default implementation returns null so that we can easily ignore cases; ! * it's useful to ignore a case when inheritance will catch all the cases anyway. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot ! * @generated ! */ ! public Adapter createDocumentRootAdapter() { ! return null; ! } ! ! /** ! * Creates a new adapter for an object of class '{@link net.sourceforge.modelWizard.ShoppingCartSchema.Profile <em>Profile</em>}'. ! * <!-- begin-user-doc --> ! * This default implementation returns null so that we can easily ignore cases; ! * it's useful to ignore a case when inheritance will catch all the cases anyway. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.Profile ! * @generated ! */ ! public Adapter createProfileAdapter() { ! return null; ! } ! ! /** ! * Creates a new adapter for an object of class '{@link net.sourceforge.modelWizard.ShoppingCartSchema.ProfilePointer <em>Profile Pointer</em>}'. ! * <!-- begin-user-doc --> ! * This default implementation returns null so that we can easily ignore cases; ! * it's useful to ignore a case when inheritance will catch all the cases anyway. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ProfilePointer ! * @generated ! */ ! public Adapter createProfilePointerAdapter() { ! return null; ! } ! ! /** ! * Creates a new adapter for an object of class '{@link net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartType <em>Shopping Cart Type</em>}'. ! * <!-- begin-user-doc --> ! * This default implementation returns null so that we can easily ignore cases; ! * it's useful to ignore a case when inheritance will catch all the cases anyway. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartType ! * @generated ! */ ! public Adapter createShoppingCartTypeAdapter() { ! return null; ! } ! ! /** ! * Creates a new adapter for the default case. ! * <!-- begin-user-doc --> ! * This default implementation returns null. ! * <!-- end-user-doc --> ! * @return the new adapter. ! * @generated ! */ ! public Adapter createEObjectAdapter() { ! return null; ! } ! ! } //ShoppingCartSchemaAdapterFactory Index: ShoppingCartSchemaResourceImpl.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/ShoppingCartSchema/util/ShoppingCartSchemaResourceImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ShoppingCartSchemaResourceImpl.java 6 Oct 2005 15:59:06 -0000 1.1 --- ShoppingCartSchemaResourceImpl.java 24 Oct 2006 21:45:01 -0000 1.2 *************** *** 1,32 **** ! /** ! * <copyright> ! * </copyright> ! * ! * $Id$ ! */ ! package net.sourceforge.modelWizard.ShoppingCartSchema.util; ! ! import org.eclipse.emf.common.util.URI; ! ! import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; ! ! /** ! * <!-- begin-user-doc --> ! * The <b>Resource </b> associated with the package. ! * <!-- end-user-doc --> ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.util.ShoppingCartSchemaResourceFactoryImpl ! * @generated ! */ ! public class ShoppingCartSchemaResourceImpl extends XMLResourceImpl { ! /** ! * Creates an instance of the resource. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @param uri the URI of the new resource. ! * @generated ! */ ! public ShoppingCartSchemaResourceImpl(URI uri) { ! super(uri); ! } ! ! } //ShoppingCartSchemaResourceImpl --- 1,31 ---- ! /** ! * <copyright> ! * </copyright> ! * ! * $Id$ ! */ ! package net.sourceforge.modelWizard.ShoppingCartSchema.util; ! ! import org.eclipse.emf.common.util.URI; ! import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; ! ! /** ! * <!-- begin-user-doc --> ! * The <b>Resource </b> associated with the package. ! * <!-- end-user-doc --> ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.util.ShoppingCartSchemaResourceFactoryImpl ! * @generated ! */ ! public class ShoppingCartSchemaResourceImpl extends XMLResourceImpl { ! /** ! * Creates an instance of the resource. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @param uri the URI of the new resource. ! * @generated ! */ ! public ShoppingCartSchemaResourceImpl(URI uri) { ! super(uri); ! } ! ! } //ShoppingCartSchemaResourceImpl Index: ShoppingCartSchemaResourceFactoryImpl.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/ShoppingCartSchema/util/ShoppingCartSchemaResourceFactoryImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ShoppingCartSchemaResourceFactoryImpl.java 6 Oct 2005 15:59:06 -0000 1.1 --- ShoppingCartSchemaResourceFactoryImpl.java 24 Oct 2006 21:45:01 -0000 1.2 *************** *** 1,71 **** ! /** ! * <copyright> ! * </copyright> ! * ! * $Id$ ! */ ! package net.sourceforge.modelWizard.ShoppingCartSchema.util; ! ! import net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage; ! ! import org.eclipse.emf.common.util.URI; ! ! import org.eclipse.emf.ecore.EPackage; ! ! import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; ! ! import org.eclipse.emf.ecore.resource.Resource; ! ! import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; ! ! import org.eclipse.emf.ecore.util.BasicExtendedMetaData; ! import org.eclipse.emf.ecore.util.ExtendedMetaData; ! ! import org.eclipse.emf.ecore.xmi.XMLResource; ! ! /** ! * <!-- begin-user-doc --> ! * The <b>Resource Factory</b> associated with the package. ! * <!-- end-user-doc --> ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.util.ShoppingCartSchemaResourceImpl ! * @generated ! */ ! public class ShoppingCartSchemaResourceFactoryImpl extends ResourceFactoryImpl { ! /** ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! protected ExtendedMetaData extendedMetaData; ! ! /** ! * Creates an instance of the resource factory. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! public ShoppingCartSchemaResourceFactoryImpl() { ! super(); ! extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); ! extendedMetaData.putPackage(null, ShoppingCartSchemaPackage.eINSTANCE); ! } ! ! /** ! * Creates an instance of the resource. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! public Resource createResource(URI uri) { ! XMLResource result = new ShoppingCartSchemaResourceImpl(uri); ! result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData); ! result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData); ! ! result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); ! result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); ! ! result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); ! return result; ! } ! ! } //ShoppingCartSchemaResourceFactoryImpl --- 1,65 ---- ! /** ! * <copyright> ! * </copyright> ! * ! * $Id$ ! */ ! package net.sourceforge.modelWizard.ShoppingCartSchema.util; ! ! import net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage; ! ! import org.eclipse.emf.common.util.URI; ! import org.eclipse.emf.ecore.EPackage; ! import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; ! import org.eclipse.emf.ecore.resource.Resource; ! import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; ! import org.eclipse.emf.ecore.util.BasicExtendedMetaData; ! import org.eclipse.emf.ecore.util.ExtendedMetaData; ! import org.eclipse.emf.ecore.xmi.XMLResource; ! ! /** ! * <!-- begin-user-doc --> ! * The <b>Resource Factory</b> associated with the package. ! * <!-- end-user-doc --> ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.util.ShoppingCartSchemaResourceImpl ! * @generated ! */ ! public class ShoppingCartSchemaResourceFactoryImpl extends ResourceFactoryImpl { ! /** ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! protected ExtendedMetaData extendedMetaData; ! ! /** ! * Creates an instance of the resource factory. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! public ShoppingCartSchemaResourceFactoryImpl() { ! super(); ! extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); ! extendedMetaData.putPackage(null, ShoppingCartSchemaPackage.eINSTANCE); ! } ! ! /** ! * Creates an instance of the resource. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @generated ! */ ! public Resource createResource(URI uri) { ! XMLResource result = new ShoppingCartSchemaResourceImpl(uri); ! result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData); ! result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData); ! ! result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); ! result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); ! ! result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); ! return result; ! } ! ! } //ShoppingCartSchemaResourceFactoryImpl |
|
From: jistrawn <jis...@us...> - 2006-10-24 21:44:30
|
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/ShoppingCartSchema In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3866/src/net/sourceforge/modelWizard/ShoppingCartSchema Modified Files: ShoppingCartType.java DocumentRoot.java Profile.java Log Message: removed unused imports or reformatted import order (ctrl-shift-o) Index: ShoppingCartType.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/ShoppingCartSchema/ShoppingCartType.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ShoppingCartType.java 6 Oct 2005 15:59:05 -0000 1.1 --- ShoppingCartType.java 24 Oct 2006 21:44:26 -0000 1.2 *************** *** 1,66 **** ! /** ! * <copyright> ! * </copyright> ! * ! * $Id$ ! */ ! package net.sourceforge.modelWizard.ShoppingCartSchema; ! ! import org.eclipse.emf.common.util.EList; ! ! import org.eclipse.emf.ecore.EObject; ! ! import org.eclipse.emf.ecore.util.FeatureMap; ! ! /** ! * <!-- begin-user-doc --> ! * A representation of the model object '<em><b>Shopping Cart Type</b></em>'. ! * <!-- end-user-doc --> ! * ! * <p> ! * The following features are supported: ! * <ul> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartType#getGroup <em>Group</em>}</li> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartType#getProfile <em>Profile</em>}</li> ! * </ul> ! * </p> ! * ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getShoppingCartType() ! * @model extendedMetaData="name='ShoppingCart_._type' kind='elementOnly'" ! * @generated ! */ ! public interface ShoppingCartType extends EObject { ! /** ! * Returns the value of the '<em><b>Group</b></em>' attribute list. ! * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. ! * <!-- begin-user-doc --> ! * <p> ! * If the meaning of the '<em>Group</em>' attribute list isn't clear, ! * there really should be more of a description here... ! * </p> ! * <!-- end-user-doc --> ! * @return the value of the '<em>Group</em>' attribute list. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getShoppingCartType_Group() ! * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" ! * extendedMetaData="kind='group' name='group:0'" ! * @generated ! */ ! FeatureMap getGroup(); ! ! /** ! * Returns the value of the '<em><b>Profile</b></em>' containment reference list. ! * The list contents are of type {@link net.sourceforge.modelWizard.ShoppingCartSchema.Profile}. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * <!-- begin-model-doc --> ! * One per profile in the cart ! * <!-- end-model-doc --> ! * @return the value of the '<em>Profile</em>' containment reference list. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getShoppingCartType_Profile() ! * @model type="net.sourceforge.modelWizard.ShoppingCartSchema.Profile" containment="true" resolveProxies="false" transient="true" volatile="true" derived="true" ! * extendedMetaData="kind='element' name='Profile' namespace='##targetNamespace' group='group:0'" ! * @generated ! */ ! EList getProfile(); ! ! } // ShoppingCartType --- 1,64 ---- ! /** ! * <copyright> ! * </copyright> ! * ! * $Id$ ! */ ! package net.sourceforge.modelWizard.ShoppingCartSchema; ! ! import org.eclipse.emf.common.util.EList; ! import org.eclipse.emf.ecore.EObject; ! import org.eclipse.emf.ecore.util.FeatureMap; ! ! /** ! * <!-- begin-user-doc --> ! * A representation of the model object '<em><b>Shopping Cart Type</b></em>'. ! * <!-- end-user-doc --> ! * ! * <p> ! * The following features are supported: ! * <ul> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartType#getGroup <em>Group</em>}</li> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartType#getProfile <em>Profile</em>}</li> ! * </ul> ! * </p> ! * ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getShoppingCartType() ! * @model extendedMetaData="name='ShoppingCart_._type' kind='elementOnly'" ! * @generated ! */ ! public interface ShoppingCartType extends EObject { ! /** ! * Returns the value of the '<em><b>Group</b></em>' attribute list. ! * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. ! * <!-- begin-user-doc --> ! * <p> ! * If the meaning of the '<em>Group</em>' attribute list isn't clear, ! * there really should be more of a description here... ! * </p> ! * <!-- end-user-doc --> ! * @return the value of the '<em>Group</em>' attribute list. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getShoppingCartType_Group() ! * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" ! * extendedMetaData="kind='group' name='group:0'" ! * @generated ! */ ! FeatureMap getGroup(); ! ! /** ! * Returns the value of the '<em><b>Profile</b></em>' containment reference list. ! * The list contents are of type {@link net.sourceforge.modelWizard.ShoppingCartSchema.Profile}. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * <!-- begin-model-doc --> ! * One per profile in the cart ! * <!-- end-model-doc --> ! * @return the value of the '<em>Profile</em>' containment reference list. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getShoppingCartType_Profile() ! * @model type="net.sourceforge.modelWizard.ShoppingCartSchema.Profile" containment="true" resolveProxies="false" transient="true" volatile="true" derived="true" ! * extendedMetaData="kind='element' name='Profile' namespace='##targetNamespace' group='group:0'" ! * @generated ! */ ! EList getProfile(); ! ! } // ShoppingCartType Index: DocumentRoot.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/ShoppingCartSchema/DocumentRoot.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DocumentRoot.java 6 Oct 2005 15:59:05 -0000 1.1 --- DocumentRoot.java 24 Oct 2006 21:44:26 -0000 1.2 *************** *** 1,114 **** ! /** ! * <copyright> ! * </copyright> ! * ! * $Id$ ! */ ! package net.sourceforge.modelWizard.ShoppingCartSchema; ! ! import org.eclipse.emf.common.util.EMap; ! ! import org.eclipse.emf.ecore.EObject; ! ! import org.eclipse.emf.ecore.util.FeatureMap; ! ! /** ! * <!-- begin-user-doc --> ! * A representation of the model object '<em><b>Document Root</b></em>'. ! * <!-- end-user-doc --> ! * ! * <p> ! * The following features are supported: ! * <ul> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot#getMixed <em>Mixed</em>}</li> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}</li> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot#getXSISchemaLocation <em>XSI Schema Location</em>}</li> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot#getShoppingCart <em>Shopping Cart</em>}</li> ! * </ul> ! * </p> ! * ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getDocumentRoot() ! * @model extendedMetaData="name='' kind='mixed'" ! * @generated ! */ ! public interface DocumentRoot extends EObject { ! /** ! * Returns the value of the '<em><b>Mixed</b></em>' attribute list. ! * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. ! * <!-- begin-user-doc --> ! * <p> ! * If the meaning of the '<em>Mixed</em>' attribute list isn't clear, ! * there really should be more of a description here... ! * </p> ! * <!-- end-user-doc --> ! * @return the value of the '<em>Mixed</em>' attribute list. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getDocumentRoot_Mixed() ! * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" ! * extendedMetaData="kind='elementWildcard' name=':mixed'" ! * @generated ! */ ! FeatureMap getMixed(); ! ! /** ! * Returns the value of the '<em><b>XMLNS Prefix Map</b></em>' map. ! * The key is of type {@link java.lang.String}, ! * and the value is of type {@link java.lang.String}, ! * <!-- begin-user-doc --> ! * <p> ! * If the meaning of the '<em>XMLNS Prefix Map</em>' map isn't clear, ! * there really should be more of a description here... ! * </p> ! * <!-- end-user-doc --> ! * @return the value of the '<em>XMLNS Prefix Map</em>' map. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getDocumentRoot_XMLNSPrefixMap() ! * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry" keyType="java.lang.String" valueType="java.lang.String" transient="true" ! * extendedMetaData="kind='attribute' name='xmlns:prefix'" ! * @generated ! */ ! EMap getXMLNSPrefixMap(); ! ! /** ! * Returns the value of the '<em><b>XSI Schema Location</b></em>' map. ! * The key is of type {@link java.lang.String}, ! * and the value is of type {@link java.lang.String}, ! * <!-- begin-user-doc --> ! * <p> ! * If the meaning of the '<em>XSI Schema Location</em>' map isn't clear, ! * there really should be more of a description here... ! * </p> ! * <!-- end-user-doc --> ! * @return the value of the '<em>XSI Schema Location</em>' map. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getDocumentRoot_XSISchemaLocation() ! * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry" keyType="java.lang.String" valueType="java.lang.String" transient="true" ! * extendedMetaData="kind='attribute' name='xsi:schemaLocation'" ! * @generated ! */ ! EMap getXSISchemaLocation(); ! ! /** ! * Returns the value of the '<em><b>Shopping Cart</b></em>' containment reference. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * <!-- begin-model-doc --> ! * The top level elemnt. The shopping cart itself. ! * <!-- end-model-doc --> ! * @return the value of the '<em>Shopping Cart</em>' containment reference. ! * @see #setShoppingCart(ShoppingCartType) ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getDocumentRoot_ShoppingCart() ! * @model containment="true" resolveProxies="false" upper="-2" transient="true" volatile="true" derived="true" ! * extendedMetaData="kind='element' name='ShoppingCart' namespace='##targetNamespace'" ! * @generated ! */ ! ShoppingCartType getShoppingCart(); ! ! /** ! * Sets the value of the '{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot#getShoppingCart <em>Shopping Cart</em>}' containment reference. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @param value the new value of the '<em>Shopping Cart</em>' containment reference. ! * @see #getShoppingCart() ! * @generated ! */ ! void setShoppingCart(ShoppingCartType value); ! ! } // DocumentRoot --- 1,112 ---- ! /** ! * <copyright> ! * </copyright> ! * ! * $Id$ ! */ ! package net.sourceforge.modelWizard.ShoppingCartSchema; ! ! import org.eclipse.emf.common.util.EMap; ! import org.eclipse.emf.ecore.EObject; ! import org.eclipse.emf.ecore.util.FeatureMap; ! ! /** ! * <!-- begin-user-doc --> ! * A representation of the model object '<em><b>Document Root</b></em>'. ! * <!-- end-user-doc --> ! * ! * <p> ! * The following features are supported: ! * <ul> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot#getMixed <em>Mixed</em>}</li> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}</li> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot#getXSISchemaLocation <em>XSI Schema Location</em>}</li> ! * <li>{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot#getShoppingCart <em>Shopping Cart</em>}</li> ! * </ul> ! * </p> ! * ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getDocumentRoot() ! * @model extendedMetaData="name='' kind='mixed'" ! * @generated ! */ ! public interface DocumentRoot extends EObject { ! /** ! * Returns the value of the '<em><b>Mixed</b></em>' attribute list. ! * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. ! * <!-- begin-user-doc --> ! * <p> ! * If the meaning of the '<em>Mixed</em>' attribute list isn't clear, ! * there really should be more of a description here... ! * </p> ! * <!-- end-user-doc --> ! * @return the value of the '<em>Mixed</em>' attribute list. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getDocumentRoot_Mixed() ! * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" ! * extendedMetaData="kind='elementWildcard' name=':mixed'" ! * @generated ! */ ! FeatureMap getMixed(); ! ! /** ! * Returns the value of the '<em><b>XMLNS Prefix Map</b></em>' map. ! * The key is of type {@link java.lang.String}, ! * and the value is of type {@link java.lang.String}, ! * <!-- begin-user-doc --> ! * <p> ! * If the meaning of the '<em>XMLNS Prefix Map</em>' map isn't clear, ! * there really should be more of a description here... ! * </p> ! * <!-- end-user-doc --> ! * @return the value of the '<em>XMLNS Prefix Map</em>' map. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getDocumentRoot_XMLNSPrefixMap() ! * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry" keyType="java.lang.String" valueType="java.lang.String" transient="true" ! * extendedMetaData="kind='attribute' name='xmlns:prefix'" ! * @generated ! */ ! EMap getXMLNSPrefixMap(); ! ! /** ! * Returns the value of the '<em><b>XSI Schema Location</b></em>' map. ! * The key is of type {@link java.lang.String}, ! * and the value is of type {@link java.lang.String}, ! * <!-- begin-user-doc --> ! * <p> ! * If the meaning of the '<em>XSI Schema Location</em>' map isn't clear, ! * there really should be more of a description here... ! * </p> ! * <!-- end-user-doc --> ! * @return the value of the '<em>XSI Schema Location</em>' map. ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getDocumentRoot_XSISchemaLocation() ! * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry" keyType="java.lang.String" valueType="java.lang.String" transient="true" ! * extendedMetaData="kind='attribute' name='xsi:schemaLocation'" ! * @generated ! */ ! EMap getXSISchemaLocation(); ! ! /** ! * Returns the value of the '<em><b>Shopping Cart</b></em>' containment reference. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * <!-- begin-model-doc --> ! * The top level elemnt. The shopping cart itself. ! * <!-- end-model-doc --> ! * @return the value of the '<em>Shopping Cart</em>' containment reference. ! * @see #setShoppingCart(ShoppingCartType) ! * @see net.sourceforge.modelWizard.ShoppingCartSchema.ShoppingCartSchemaPackage#getDocumentRoot_ShoppingCart() ! * @model containment="true" resolveProxies="false" upper="-2" transient="true" volatile="true" derived="true" ! * extendedMetaData="kind='element' name='ShoppingCart' namespace='##targetNamespace'" ! * @generated ! */ ! ShoppingCartType getShoppingCart(); ! ! /** ! * Sets the value of the '{@link net.sourceforge.modelWizard.ShoppingCartSchema.DocumentRoot#getShoppingCart <em>Shopping Cart</em>}' containment reference. ! * <!-- begin-user-doc --> ! * <!-- end-user-doc --> ! * @param value the new value of the '<em>Shopping Cart</em>' containment reference. ! * @see #getShoppingCart() ! * @generated ! */ ! void setShoppingCart(ShoppingCartType value); ! ! } // DocumentRoot Index: Profile.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/ShoppingCartSchema/Profile.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Profile.java 1 Feb 2006 09:26:38 -0000 1.2 --- Profile.java 24 Oct 2006 21:44:26 -0000 1.3 *************** *** 8,14 **** import org.eclipse.emf.common.util.EList; - import org.eclipse.emf.ecore.EObject; - import org.eclipse.emf.ecore.util.FeatureMap; --- 8,12 ---- |
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/profileViewer/drawingInformation In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3484/src/net/sourceforge/modelWizard/profileViewer/drawingInformation Modified Files: ClassInformation.java AssociationInformation.java DrawingInformation.java Log Message: removed unused imports or reformatted import order (ctrl-shift-o) Index: DrawingInformation.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/profileViewer/drawingInformation/DrawingInformation.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DrawingInformation.java 5 May 2006 15:34:25 -0000 1.4 --- DrawingInformation.java 24 Oct 2006 21:43:59 -0000 1.5 *************** *** 30,34 **** import net.sourceforge.modelWizard.Profile.util.ProfileSwitch; import net.sourceforge.modelWizard.backingModelAbstraction.IAssociation; - import net.sourceforge.modelWizard.backingModelAbstraction.IAssociationClass; import net.sourceforge.modelWizard.backingModelAbstraction.IClass; import net.sourceforge.modelWizard.backingModelAbstraction.IMethod; --- 30,33 ---- Index: ClassInformation.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/profileViewer/drawingInformation/ClassInformation.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ClassInformation.java 7 Nov 2005 16:19:15 -0000 1.3 --- ClassInformation.java 24 Oct 2006 21:43:59 -0000 1.4 *************** *** 1,157 **** ! /* ! * Created on Sep 27, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.profileViewer.drawingInformation; ! ! import java.util.ArrayList; ! ! import net.sourceforge.modelWizard.Profile.Diagram; ! import net.sourceforge.modelWizard.backingModelAbstraction.IAssociation; ! import net.sourceforge.modelWizard.backingModelAbstraction.IAssociationClass; ! import net.sourceforge.modelWizard.backingModelAbstraction.IClass; ! import net.sourceforge.modelWizard.backingModelAbstraction.INamedElement; ! ! public class ClassInformation { ! ! private String name; ! ! private ArrayList props = new ArrayList(); ! ! private ArrayList methods = new ArrayList(); ! ! private String comment; ! ! private INamedElement modelElement; ! ! private boolean isAssoc = false; ! ! private ArrayList ends = new ArrayList(); ! ! private boolean isStub = false; ! ! private Diagram diagram; ! ! private ElementInfo elementInfo; ! ! ClassInformation(INamedElement element, String description, Diagram diagram, ! ElementInfo info) { ! name = element.getName(); ! elementInfo = info; ! this.modelElement = element; ! this.diagram = diagram; ! comment = TextUtilities.wordWrap(description, 40); ! if (element instanceof IAssociation) ! isAssoc = true; ! } ! ! ClassInformation(INamedElement element) { ! this.name = element.getName(); ! this.modelElement = element; ! elementInfo = new ElementInfo(ElementInfo.NORMAL, name); ! comment = null; ! isStub = true; ! } ! ! public boolean isStub() { ! return isStub; ! } ! ! public String getComment() { ! return comment; ! } ! ! public boolean isAssoc() { ! return isAssoc; ! } ! ! public boolean isAbstract() { ! boolean isAbstract = false; ! if (modelElement instanceof IClass ) ! isAbstract = ((IClass) modelElement).isAbstract(); ! return isAbstract; ! } ! ! public ArrayList getDisplayMethods() { ! if (diagram == null || diagram.isShowDetail()) ! return methods; ! else ! return new ArrayList(); ! } ! ! public ArrayList getMethods() { ! return methods; ! } ! ! public ArrayList getProps() { ! return props; ! } ! ! public String getName() { ! return name; ! } ! ! public ArrayList getDisplayProperties() { ! if (diagram == null || diagram.isShowDetail()) ! return props; ! else ! return new ArrayList(); ! } ! ! public ElementInfo getDisplayName() { ! return elementInfo; ! } ! ! public INamedElement getModelElement() { ! return modelElement; ! } ! ! public ArrayList getEnds() { ! return ends; ! } ! ! public short getPageNo() { ! if (diagram == null) ! return 1; ! return diagram.getDiagramPageNumber(); ! } ! ! public int getSuperClass() { ! if (diagram == null) ! return 0; ! if (!diagram.isSetShowSuperClasses()) ! return 0; ! else ! return diagram.getShowSuperClasses(); ! } ! ! public String getAlias() { ! if (diagram == null) ! return null; ! return diagram.getAlias(); ! } ! ! public String toString() { ! String ret = "Class " + getName() + "\n"; ! ret += " Props:" + props.toString() + "\n"; ! ret += " Methods:" + methods.toString() + "\n"; ! return ret; ! } ! ! public boolean isShowDetail() { ! if (diagram == null) ! return true; ! return diagram.isShowDetail(); ! } ! } --- 1,156 ---- ! /* ! * Created on Sep 27, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.profileViewer.drawingInformation; ! ! import java.util.ArrayList; ! ! import net.sourceforge.modelWizard.Profile.Diagram; ! import net.sourceforge.modelWizard.backingModelAbstraction.IAssociation; ! import net.sourceforge.modelWizard.backingModelAbstraction.IClass; ! import net.sourceforge.modelWizard.backingModelAbstraction.INamedElement; ! ! public class ClassInformation { ! ! private String name; ! ! private ArrayList props = new ArrayList(); ! ! private ArrayList methods = new ArrayList(); ! ! private String comment; ! ! private INamedElement modelElement; ! ! private boolean isAssoc = false; ! ! private ArrayList ends = new ArrayList(); ! ! private boolean isStub = false; ! ! private Diagram diagram; ! ! private ElementInfo elementInfo; ! ! ClassInformation(INamedElement element, String description, Diagram diagram, ! ElementInfo info) { ! name = element.getName(); ! elementInfo = info; ! this.modelElement = element; ! this.diagram = diagram; ! comment = TextUtilities.wordWrap(description, 40); ! if (element instanceof IAssociation) ! isAssoc = true; ! } ! ! ClassInformation(INamedElement element) { ! this.name = element.getName(); ! this.modelElement = element; ! elementInfo = new ElementInfo(ElementInfo.NORMAL, name); ! comment = null; ! isStub = true; ! } ! ! public boolean isStub() { ! return isStub; ! } ! ! public String getComment() { ! return comment; ! } ! ! public boolean isAssoc() { ! return isAssoc; ! } ! ! public boolean isAbstract() { ! boolean isAbstract = false; ! if (modelElement instanceof IClass ) ! isAbstract = ((IClass) modelElement).isAbstract(); ! return isAbstract; ! } ! ! public ArrayList getDisplayMethods() { ! if (diagram == null || diagram.isShowDetail()) ! return methods; ! else ! return new ArrayList(); ! } ! ! public ArrayList getMethods() { ! return methods; ! } ! ! public ArrayList getProps() { ! return props; ! } ! ! public String getName() { ! return name; ! } ! ! public ArrayList getDisplayProperties() { ! if (diagram == null || diagram.isShowDetail()) ! return props; ! else ! return new ArrayList(); ! } ! ! public ElementInfo getDisplayName() { ! return elementInfo; ! } ! ! public INamedElement getModelElement() { ! return modelElement; ! } ! ! public ArrayList getEnds() { ! return ends; ! } ! ! public short getPageNo() { ! if (diagram == null) ! return 1; ! return diagram.getDiagramPageNumber(); ! } ! ! public int getSuperClass() { ! if (diagram == null) ! return 0; ! if (!diagram.isSetShowSuperClasses()) ! return 0; ! else ! return diagram.getShowSuperClasses(); ! } ! ! public String getAlias() { ! if (diagram == null) ! return null; ! return diagram.getAlias(); ! } ! ! public String toString() { ! String ret = "Class " + getName() + "\n"; ! ret += " Props:" + props.toString() + "\n"; ! ret += " Methods:" + methods.toString() + "\n"; ! return ret; ! } ! ! public boolean isShowDetail() { ! if (diagram == null) ! return true; ! return diagram.isShowDetail(); ! } ! } Index: AssociationInformation.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/profileViewer/drawingInformation/AssociationInformation.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AssociationInformation.java 7 Nov 2005 16:19:15 -0000 1.3 --- AssociationInformation.java 24 Oct 2006 21:43:59 -0000 1.4 *************** *** 1,370 **** ! /* ! * Created on Sep 27, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.profileViewer.drawingInformation; ! ! import java.util.ArrayList; ! import java.util.Collection; ! import java.util.Iterator; ! ! import net.sourceforge.modelWizard.Profile.Reference; ! import net.sourceforge.modelWizard.backingModelAbstraction.AssociationEndKind; ! import net.sourceforge.modelWizard.backingModelAbstraction.IAssociation; ! import net.sourceforge.modelWizard.backingModelAbstraction.IAssociationClass; ! import net.sourceforge.modelWizard.backingModelAbstraction.IClass; ! import net.sourceforge.modelWizard.backingModelAbstraction.IEndProperty; ! import net.sourceforge.modelWizard.backingModelAbstraction.IProperty; ! import net.sourceforge.modelWizard.modelAbstraction.ModelAccess; ! import net.sourceforge.modelWizard.profileViewer.ProfileParsingException; ! ! public class AssociationInformation { ! ! private class AssocInfo { ! private boolean isThreeWay = false; ! ! private AssociationEndKind kind; ! ! private ArrayList ends = new ArrayList(); ! ! private ArrayList refs = new ArrayList(); ! ! private IProperty primary, secondary; ! ! AssocInfo(IAssociation ac, Collection refs) { ! ends.addAll(ac.getEnds().values()); ! if (ends.size() != 2 && ends.size() != 3) ! throw new ProfileParsingException(ac.getName() + " has " ! + ends.size() + " ends!"); ! this.refs.addAll(refs); ! // note that all 3 ways are simple associations. ! if (ends.size() == 3) { ! isThreeWay = true; ! kind = AssociationEndKind.NONE_LITERAL; ! } else { ! // first of all check the first prperty ! IEndProperty tmp = (IEndProperty) ends.get(0); ! if (!tmp.getAggregationKind().equals( ! AssociationEndKind.NONE_LITERAL)) { ! secondary = tmp; ! primary = (IProperty) ends.get(1); ! kind = tmp.getAggregationKind(); ! } else { ! tmp = (IEndProperty) ends.get(1); ! if (!tmp.getAggregationKind().equals( ! AssociationEndKind.NONE_LITERAL)) { ! secondary = tmp; ! kind = tmp.getAggregationKind(); ! primary = (IProperty) ends.get(0); ! } else { ! primary = tmp; ! kind = tmp.getAggregationKind(); ! secondary = (IProperty) ends.get(0); ! } ! } ! } ! } ! ! public Collection getEnds() { ! return ends; ! } ! ! public IProperty getEnd(String name) { ! Iterator i = ends.iterator(); ! while (i.hasNext()) { ! IProperty p = (IProperty) i.next(); ! if (p.getName().equalsIgnoreCase(name)) ! return p; ! } ! throw new ProfileParsingException("can't find end: " + name); ! } ! ! public boolean isThreeWay() { ! return isThreeWay; ! } ! ! public AssociationEndKind getKind() { ! return kind; ! } ! ! public IProperty getPrimary() { ! if (isThreeWay) ! throw new ProfileParsingException( ! "Primary not valid for a three way association."); ! return primary; ! } ! ! public IProperty getSecondary() { ! if (isThreeWay) ! throw new ProfileParsingException( ! "Secondary not valid for a three way association."); ! return secondary; ! } ! ! // for a passed property (one of those in this AssocType), find the ! // right reference and return the min cardinality. ! public int getProfileMinCardinality(IProperty property) { ! if (refs == null) ! return 0; ! String propName = property.getName(); ! Reference thisRef = null; ! Iterator i = refs.iterator(); ! while (i.hasNext()) { ! Reference tmp = (Reference) i.next(); ! if (tmp.getEndRole().equalsIgnoreCase(propName)) { ! thisRef = tmp; ! break; ! } ! } ! if (thisRef != null) ! if (thisRef.isSetMinCardinality()) ! return thisRef.getMinCardinality(); ! return 0; ! } ! ! // for a passed property (one of those in this AssocType), find the ! // right reference and return the min cardinality. ! public int getProfileMaxCardinality(IProperty property) { ! if (refs == null) ! return -1; ! String propName = property.getName(); ! Reference thisRef = null; ! Iterator i = refs.iterator(); ! while (i.hasNext()) { ! Reference tmp = (Reference) i.next(); ! if (tmp.getEndRole().equalsIgnoreCase(propName)) { ! thisRef = tmp; ! break; ! } ! } ! if (thisRef != null) ! if (thisRef.isSetMaxCardinality()) ! return thisRef.getMaxCardinality(); ! return -1; ! } ! ! } ! ! private String name; ! ! private IAssociation realAssoc; ! ! private String containingClassKey; ! ! private String comment; ! ! private ArrayList referenceList = new ArrayList(); ! ! private short pageNo; ! ! private AssocInfo ac; ! ! static ModelAccess model = ModelAccess.INSTANCE; ! ! public AssociationInformation(IAssociation thisClass, String description, ! short pageNo, Collection references, String classKey) { ! name = thisClass.getName(); ! realAssoc = thisClass; ! comment = description; ! referenceList.addAll(references); ! this.pageNo = pageNo; ! ac = new AssocInfo(thisClass, references); ! this.containingClassKey = classKey; ! } ! ! private String getMultiplicity(AssocInfo acType, IProperty property) { ! int modelUpper = property.getUpper(); ! if (modelUpper == -1) ! modelUpper = Integer.MAX_VALUE; ! int modelLower = property.getLower(); ! int profileUpper = acType.getProfileMaxCardinality(property); ! if (profileUpper == -1) ! profileUpper = Integer.MAX_VALUE; ! int profileLower = acType.getProfileMinCardinality(property); ! String ret = ""; ! ! int u = modelUpper; ! if (modelUpper == Integer.MAX_VALUE) { ! u = profileUpper; ! } else if (profileUpper < modelUpper) ! u = profileUpper; ! ! int l = modelLower; ! if (profileLower > modelLower) ! l = profileLower; ! ! if (u == l) ! return Integer.toString(l); ! ! ret = l + ".."; ! ! if (u == Integer.MAX_VALUE) ! ret += "*"; ! else ! ret += u; ! return ret; ! } ! ! public IAssociation getCimCxClass() { ! return realAssoc; ! } ! ! public String getComment() { ! return comment; ! } ! ! public String getName() { ! return name; ! } ! ! public short getPageNo() { ! return pageNo; ! } ! ! public String toString() { ! String ret = "Assoc " + getName() + "\n"; ! ret += " Page No:" + pageNo + "\n"; ! Iterator i = referenceList.iterator(); ! while (i.hasNext()) { ! Reference r = (Reference) i.next(); ! ret += " Ref:" + r.toString(); ! } ! return ret; ! } ! ! /** ! * Return the contents of the reference list. ! * ! * @return ArrayList of Strings. ! */ ! public ArrayList getReferences() { ! ArrayList ret = new ArrayList(); ! Iterator i = referenceList.iterator(); ! while (i.hasNext()) { ! Reference r = (Reference) i.next(); ! // check that the roleName exists. ! Iterator n = ac.ends.iterator(); ! boolean found = false; ! while (n.hasNext()) { ! IProperty p = (IProperty) n.next(); ! if (p.getName().equalsIgnoreCase(r.getEndRole())) { ! found = true; ! break; ! } ! } ! if (!found) ! throw new ProfileParsingException("The end role '" ! + r.getEndRole() + "' does not exist in " ! + this.getName()); ! ret ! .add(DrawingInformation.getKey(r.getEndClass(), r ! .getEndAlias())); ! } ! ret.add(containingClassKey); ! return ret; ! } ! ! public String getPrimaryKey() { ! if (ac.isThreeWay()) ! throw new ProfileParsingException( ! "Primary not valid for a three way association."); ! ! String priRoleName = ac.getPrimary().getName(); ! Reference one = (Reference) referenceList.get(0); ! ! if (one.getEndRole().equalsIgnoreCase(priRoleName)) ! return DrawingInformation.getKey(one.getEndClass(), one ! .getEndAlias()); ! else ! return containingClassKey; ! } ! ! public String getSecondaryKey() { ! if (ac.isThreeWay()) ! throw new ProfileParsingException( ! "Secondary not valid for a three way association."); ! ! String secRoleName = ac.getSecondary().getName(); ! Reference one = (Reference) referenceList.get(0); ! ! if (one.getEndRole().equalsIgnoreCase(secRoleName)) ! return DrawingInformation.getKey(one.getEndClass(), one ! .getEndAlias()); ! else ! return containingClassKey; ! } ! ! public static final int ASSOCIATION = 0; ! ! public static final int AGGREGATION = 1; ! ! public static final int COMPOSITION = 2; ! ! public int getType() { ! if (ac.kind.equals(AssociationEndKind.AGGREGATION_LITERAL)) ! return AGGREGATION; ! if (ac.kind.equals(AssociationEndKind.COMPOSITION_LITERAL)) ! return COMPOSITION; ! return ASSOCIATION; ! } ! ! public String getKey(int index) { ! Reference one = (Reference) referenceList.get(index); ! return DrawingInformation.getKey(one.getEndClass(), one.getEndAlias()); ! } ! ! public String getMultiplicity(int index) { ! Reference it = (Reference) referenceList.get(index); ! return getMultiplicity(ac, ac.getEnd(it.getEndRole())); ! } ! ! public boolean isThreeWay() { ! return ac.isThreeWay(); ! } ! ! public String getPrimaryMultiplicity() { ! return getMultiplicity(ac, ac.getSecondary()); ! } ! ! public String getSecondaryMultiplicity() { ! return getMultiplicity(ac, ac.getPrimary()); ! } ! ! public boolean compare(String assocName, String primaryClassName, ! String secondaryClassName) { ! if (getPrimaryKey().equalsIgnoreCase(primaryClassName) ! && getSecondaryKey().equalsIgnoreCase(secondaryClassName) ! && name.equalsIgnoreCase(assocName)) ! return true; ! else ! return false; ! } ! ! public boolean equals(Object arg0) { ! if (arg0 instanceof AssociationInformation) { ! AssociationInformation ai = (AssociationInformation) arg0; ! if (getPrimaryKey().equalsIgnoreCase(ai.getPrimaryKey()) ! && getSecondaryKey().equalsIgnoreCase(ai.getSecondaryKey()) ! && name.equalsIgnoreCase(ai.getName())) ! return true; ! } ! return false; ! } ! ! // //only works for 2 ways... as will most of this.. ! // public void setOverride(String propertyName, int max, int min){ ! // multOverrideProperyName = propertyName; ! // multOverride ProperyName = propertyName; ! // } ! } --- 1,368 ---- ! /* ! * Created on Sep 27, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.profileViewer.drawingInformation; ! ! import java.util.ArrayList; ! import java.util.Collection; ! import java.util.Iterator; ! ! import net.sourceforge.modelWizard.Profile.Reference; ! import net.sourceforge.modelWizard.backingModelAbstraction.AssociationEndKind; ! import net.sourceforge.modelWizard.backingModelAbstraction.IAssociation; ! import net.sourceforge.modelWizard.backingModelAbstraction.IEndProperty; ! import net.sourceforge.modelWizard.backingModelAbstraction.IProperty; ! import net.sourceforge.modelWizard.modelAbstraction.ModelAccess; ! import net.sourceforge.modelWizard.profileViewer.ProfileParsingException; ! ! public class AssociationInformation { ! ! private class AssocInfo { ! private boolean isThreeWay = false; ! ! private AssociationEndKind kind; ! ! private ArrayList ends = new ArrayList(); ! ! private ArrayList refs = new ArrayList(); ! ! private IProperty primary, secondary; ! ! AssocInfo(IAssociation ac, Collection refs) { ! ends.addAll(ac.getEnds().values()); ! if (ends.size() != 2 && ends.size() != 3) ! throw new ProfileParsingException(ac.getName() + " has " ! + ends.size() + " ends!"); ! this.refs.addAll(refs); ! // note that all 3 ways are simple associations. ! if (ends.size() == 3) { ! isThreeWay = true; ! kind = AssociationEndKind.NONE_LITERAL; ! } else { ! // first of all check the first prperty ! IEndProperty tmp = (IEndProperty) ends.get(0); ! if (!tmp.getAggregationKind().equals( ! AssociationEndKind.NONE_LITERAL)) { ! secondary = tmp; ! primary = (IProperty) ends.get(1); ! kind = tmp.getAggregationKind(); ! } else { ! tmp = (IEndProperty) ends.get(1); ! if (!tmp.getAggregationKind().equals( ! AssociationEndKind.NONE_LITERAL)) { ! secondary = tmp; ! kind = tmp.getAggregationKind(); ! primary = (IProperty) ends.get(0); ! } else { ! primary = tmp; ! kind = tmp.getAggregationKind(); ! secondary = (IProperty) ends.get(0); ! } ! } ! } ! } ! ! public Collection getEnds() { ! return ends; ! } ! ! public IProperty getEnd(String name) { ! Iterator i = ends.iterator(); ! while (i.hasNext()) { ! IProperty p = (IProperty) i.next(); ! if (p.getName().equalsIgnoreCase(name)) ! return p; ! } ! throw new ProfileParsingException("can't find end: " + name); ! } ! ! public boolean isThreeWay() { ! return isThreeWay; ! } ! ! public AssociationEndKind getKind() { ! return kind; ! } ! ! public IProperty getPrimary() { ! if (isThreeWay) ! throw new ProfileParsingException( ! "Primary not valid for a three way association."); ! return primary; ! } ! ! public IProperty getSecondary() { ! if (isThreeWay) ! throw new ProfileParsingException( ! "Secondary not valid for a three way association."); ! return secondary; ! } ! ! // for a passed property (one of those in this AssocType), find the ! // right reference and return the min cardinality. ! public int getProfileMinCardinality(IProperty property) { ! if (refs == null) ! return 0; ! String propName = property.getName(); ! Reference thisRef = null; ! Iterator i = refs.iterator(); ! while (i.hasNext()) { ! Reference tmp = (Reference) i.next(); ! if (tmp.getEndRole().equalsIgnoreCase(propName)) { ! thisRef = tmp; ! break; ! } ! } ! if (thisRef != null) ! if (thisRef.isSetMinCardinality()) ! return thisRef.getMinCardinality(); ! return 0; ! } ! ! // for a passed property (one of those in this AssocType), find the ! // right reference and return the min cardinality. ! public int getProfileMaxCardinality(IProperty property) { ! if (refs == null) ! return -1; ! String propName = property.getName(); ! Reference thisRef = null; ! Iterator i = refs.iterator(); ! while (i.hasNext()) { ! Reference tmp = (Reference) i.next(); ! if (tmp.getEndRole().equalsIgnoreCase(propName)) { ! thisRef = tmp; ! break; ! } ! } ! if (thisRef != null) ! if (thisRef.isSetMaxCardinality()) ! return thisRef.getMaxCardinality(); ! return -1; ! } ! ! } ! ! private String name; ! ! private IAssociation realAssoc; ! ! private String containingClassKey; ! ! private String comment; ! ! private ArrayList referenceList = new ArrayList(); ! ! private short pageNo; ! ! private AssocInfo ac; ! ! static ModelAccess model = ModelAccess.INSTANCE; ! ! public AssociationInformation(IAssociation thisClass, String description, ! short pageNo, Collection references, String classKey) { ! name = thisClass.getName(); ! realAssoc = thisClass; ! comment = description; ! referenceList.addAll(references); ! this.pageNo = pageNo; ! ac = new AssocInfo(thisClass, references); ! this.containingClassKey = classKey; ! } ! ! private String getMultiplicity(AssocInfo acType, IProperty property) { ! int modelUpper = property.getUpper(); ! if (modelUpper == -1) ! modelUpper = Integer.MAX_VALUE; ! int modelLower = property.getLower(); ! int profileUpper = acType.getProfileMaxCardinality(property); ! if (profileUpper == -1) ! profileUpper = Integer.MAX_VALUE; ! int profileLower = acType.getProfileMinCardinality(property); ! String ret = ""; ! ! int u = modelUpper; ! if (modelUpper == Integer.MAX_VALUE) { ! u = profileUpper; ! } else if (profileUpper < modelUpper) ! u = profileUpper; ! ! int l = modelLower; ! if (profileLower > modelLower) ! l = profileLower; ! ! if (u == l) ! return Integer.toString(l); ! ! ret = l + ".."; ! ! if (u == Integer.MAX_VALUE) ! ret += "*"; ! else ! ret += u; ! return ret; ! } ! ! public IAssociation getCimCxClass() { ! return realAssoc; ! } ! ! public String getComment() { ! return comment; ! } ! ! public String getName() { ! return name; ! } ! ! public short getPageNo() { ! return pageNo; ! } ! ! public String toString() { ! String ret = "Assoc " + getName() + "\n"; ! ret += " Page No:" + pageNo + "\n"; ! Iterator i = referenceList.iterator(); ! while (i.hasNext()) { ! Reference r = (Reference) i.next(); ! ret += " Ref:" + r.toString(); ! } ! return ret; ! } ! ! /** ! * Return the contents of the reference list. ! * ! * @return ArrayList of Strings. ! */ ! public ArrayList getReferences() { ! ArrayList ret = new ArrayList(); ! Iterator i = referenceList.iterator(); ! while (i.hasNext()) { ! Reference r = (Reference) i.next(); ! // check that the roleName exists. ! Iterator n = ac.ends.iterator(); ! boolean found = false; ! while (n.hasNext()) { ! IProperty p = (IProperty) n.next(); ! if (p.getName().equalsIgnoreCase(r.getEndRole())) { ! found = true; ! break; ! } ! } ! if (!found) ! throw new ProfileParsingException("The end role '" ! + r.getEndRole() + "' does not exist in " ! + this.getName()); ! ret ! .add(DrawingInformation.getKey(r.getEndClass(), r ! .getEndAlias())); ! } ! ret.add(containingClassKey); ! return ret; ! } ! ! public String getPrimaryKey() { ! if (ac.isThreeWay()) ! throw new ProfileParsingException( ! "Primary not valid for a three way association."); ! ! String priRoleName = ac.getPrimary().getName(); ! Reference one = (Reference) referenceList.get(0); ! ! if (one.getEndRole().equalsIgnoreCase(priRoleName)) ! return DrawingInformation.getKey(one.getEndClass(), one ! .getEndAlias()); ! else ! return containingClassKey; ! } ! ! public String getSecondaryKey() { ! if (ac.isThreeWay()) ! throw new ProfileParsingException( ! "Secondary not valid for a three way association."); ! ! String secRoleName = ac.getSecondary().getName(); ! Reference one = (Reference) referenceList.get(0); ! ! if (one.getEndRole().equalsIgnoreCase(secRoleName)) ! return DrawingInformation.getKey(one.getEndClass(), one ! .getEndAlias()); ! else ! return containingClassKey; ! } ! ! public static final int ASSOCIATION = 0; ! ! public static final int AGGREGATION = 1; ! ! public static final int COMPOSITION = 2; ! ! public int getType() { ! if (ac.kind.equals(AssociationEndKind.AGGREGATION_LITERAL)) ! return AGGREGATION; ! if (ac.kind.equals(AssociationEndKind.COMPOSITION_LITERAL)) ! return COMPOSITION; ! return ASSOCIATION; ! } ! ! public String getKey(int index) { ! Reference one = (Reference) referenceList.get(index); ! return DrawingInformation.getKey(one.getEndClass(), one.getEndAlias()); ! } ! ! public String getMultiplicity(int index) { ! Reference it = (Reference) referenceList.get(index); ! return getMultiplicity(ac, ac.getEnd(it.getEndRole())); ! } ! ! public boolean isThreeWay() { ! return ac.isThreeWay(); ! } ! ! public String getPrimaryMultiplicity() { ! return getMultiplicity(ac, ac.getSecondary()); ! } ! ! public String getSecondaryMultiplicity() { ! return getMultiplicity(ac, ac.getPrimary()); ! } ! ! public boolean compare(String assocName, String primaryClassName, ! String secondaryClassName) { ! if (getPrimaryKey().equalsIgnoreCase(primaryClassName) ! && getSecondaryKey().equalsIgnoreCase(secondaryClassName) ! && name.equalsIgnoreCase(assocName)) ! return true; ! else ! return false; ! } ! ! public boolean equals(Object arg0) { ! if (arg0 instanceof AssociationInformation) { ! AssociationInformation ai = (AssociationInformation) arg0; ! if (getPrimaryKey().equalsIgnoreCase(ai.getPrimaryKey()) ! && getSecondaryKey().equalsIgnoreCase(ai.getSecondaryKey()) ! && name.equalsIgnoreCase(ai.getName())) ! return true; ! } ! return false; ! } ! ! // //only works for 2 ways... as will most of this.. ! // public void setOverride(String propertyName, int max, int min){ ! // multOverrideProperyName = propertyName; ! // multOverride ProperyName = propertyName; ! // } ! } |
|
From: jistrawn <jis...@us...> - 2006-10-24 21:43:50
|
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/profileViewer In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3447/src/net/sourceforge/modelWizard/profileViewer Modified Files: Intermediary.java Log Message: removed unused imports or reformatted import order (ctrl-shift-o) Index: Intermediary.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/profileViewer/Intermediary.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Intermediary.java 23 Nov 2005 23:27:08 -0000 1.3 --- Intermediary.java 24 Oct 2006 21:43:46 -0000 1.4 *************** *** 1,157 **** ! /* ! * Created on Sep 27, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.profileViewer; ! ! import net.sourceforge.modelWizard.Profile.Class; ! import net.sourceforge.modelWizard.Profile.Method; ! import net.sourceforge.modelWizard.Profile.Property; ! import net.sourceforge.modelWizard.backingModelAbstraction.IAssociation; ! import net.sourceforge.modelWizard.backingModelAbstraction.IClass; ! import net.sourceforge.modelWizard.backingModelAbstraction.IMethod; ! import net.sourceforge.modelWizard.backingModelAbstraction.IModel; ! import net.sourceforge.modelWizard.backingModelAbstraction.INamedElement; ! import net.sourceforge.modelWizard.backingModelAbstraction.IProperty; ! import net.sourceforge.modelWizard.modelAbstraction.ModelAccess; ! ! import java.util.ArrayList; ! import java.util.Iterator; ! ! ! /** ! * @author stjerman ! * ! * TODO To change the template for this generated type comment go to Window - ! * Preferences - Java - Code Style - Code Templates ! */ ! public class Intermediary { ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) ! */ ! public static final int PROFILE_PROPS = 1; ! public static final int OTHER_PROPS = 2; ! public static final int PROFILE_METHODS = 3; ! public static final int OTHER_METHODS = 4; ! int type; ! private Class theClass; ! private INamedElement modelElement; ! private IModel model = ModelAccess.INSTANCE.getCurrentModel(); ! ! Intermediary(int type, Class theClass) { ! this.type = type; ! this.theClass = theClass; ! modelElement = model.findElement(theClass.getClassName()); ! } ! ! public String getText() { ! switch (type) { ! case PROFILE_PROPS: ! return "Blueprint Properties"; ! ! case OTHER_PROPS: ! return "Model Properties"; ! ! case PROFILE_METHODS: ! return "Blueprint Methods"; ! ! case OTHER_METHODS: ! return "Model Methods"; ! } ! ! return null; ! } ! ! public Property[] getProfileProperties() { ! return (Property[]) theClass.getProperty().toArray(new Property[] { }); ! } ! ! public Object[] getOtherProperties() { ! ArrayList otherProps = new ArrayList(); ! ! if (modelElement instanceof IClass) { ! otherProps.addAll(((IClass) modelElement).getProperties(true) ! .values()); ! } ! ! if (modelElement instanceof IAssociation) { ! otherProps.addAll(((IAssociation) modelElement).getEnds().values()); ! } ! ! Iterator allProps = otherProps.iterator(); ! Property[] profProps = getProfileProperties(); ! ArrayList props = new ArrayList(); ! ! while (allProps.hasNext()) { ! IProperty p = (IProperty) allProps.next(); ! boolean here = false; ! ! for (int n = 0; n < profProps.length; n++) { ! if (profProps[n].getPropertyName().equalsIgnoreCase(p.getName())) { ! here = true; ! } ! } ! ! if (!here) { ! props.add(p); ! } ! } ! ! return props.toArray(); ! } ! ! public Method[] getProfileMethods() { ! return (Method[]) theClass.getMethod().toArray(); ! } ! ! public Object[] getOtherMethods() { ! ArrayList methods = new ArrayList(); ! ! if (modelElement instanceof IClass) { ! Iterator allMethods = ((IClass) modelElement).getMethods(true) ! .values().iterator(); ! Method[] profMethods = getProfileMethods(); ! ! while (allMethods.hasNext()) { ! IMethod m = (IMethod) allMethods.next(); ! boolean here = false; ! ! for (int n = 0; n < profMethods.length; n++) { ! if (profMethods[n].getMethodName().equalsIgnoreCase(m.getName())) { ! here = true; ! } ! } ! ! if (!here) { ! methods.add(m); ! } ! } ! } ! ! return methods.toArray(); ! } ! ! /** ! * @return Returns the theClass. ! */ ! public Class getTheClass() { ! return theClass; ! } ! ! public int getType() { ! return type; ! } ! } --- 1,157 ---- ! /* ! * Created on Sep 27, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.profileViewer; ! ! import java.util.ArrayList; ! import java.util.Iterator; ! ! import net.sourceforge.modelWizard.Profile.Class; ! import net.sourceforge.modelWizard.Profile.Method; ! import net.sourceforge.modelWizard.Profile.Property; ! import net.sourceforge.modelWizard.backingModelAbstraction.IAssociation; ! import net.sourceforge.modelWizard.backingModelAbstraction.IClass; ! import net.sourceforge.modelWizard.backingModelAbstraction.IMethod; ! import net.sourceforge.modelWizard.backingModelAbstraction.IModel; ! import net.sourceforge.modelWizard.backingModelAbstraction.INamedElement; ! import net.sourceforge.modelWizard.backingModelAbstraction.IProperty; ! import net.sourceforge.modelWizard.modelAbstraction.ModelAccess; ! ! ! /** ! * @author stjerman ! * ! * TODO To change the template for this generated type comment go to Window - ! * Preferences - Java - Code Style - Code Templates ! */ ! public class Intermediary { ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) ! */ ! public static final int PROFILE_PROPS = 1; ! public static final int OTHER_PROPS = 2; ! public static final int PROFILE_METHODS = 3; ! public static final int OTHER_METHODS = 4; ! int type; ! private Class theClass; ! private INamedElement modelElement; ! private IModel model = ModelAccess.INSTANCE.getCurrentModel(); ! ! Intermediary(int type, Class theClass) { ! this.type = type; ! this.theClass = theClass; ! modelElement = model.findElement(theClass.getClassName()); ! } ! ! public String getText() { ! switch (type) { ! case PROFILE_PROPS: ! return "Blueprint Properties"; ! ! case OTHER_PROPS: ! return "Model Properties"; ! ! case PROFILE_METHODS: ! return "Blueprint Methods"; ! ! case OTHER_METHODS: ! return "Model Methods"; ! } ! ! return null; ! } ! ! public Property[] getProfileProperties() { ! return (Property[]) theClass.getProperty().toArray(new Property[] { }); ! } ! ! public Object[] getOtherProperties() { ! ArrayList otherProps = new ArrayList(); ! ! if (modelElement instanceof IClass) { ! otherProps.addAll(((IClass) modelElement).getProperties(true) ! .values()); ! } ! ! if (modelElement instanceof IAssociation) { ! otherProps.addAll(((IAssociation) modelElement).getEnds().values()); ! } ! ! Iterator allProps = otherProps.iterator(); ! Property[] profProps = getProfileProperties(); ! ArrayList props = new ArrayList(); ! ! while (allProps.hasNext()) { ! IProperty p = (IProperty) allProps.next(); ! boolean here = false; ! ! for (int n = 0; n < profProps.length; n++) { ! if (profProps[n].getPropertyName().equalsIgnoreCase(p.getName())) { ! here = true; ! } ! } ! ! if (!here) { ! props.add(p); ! } ! } ! ! return props.toArray(); ! } ! ! public Method[] getProfileMethods() { ! return (Method[]) theClass.getMethod().toArray(); ! } ! ! public Object[] getOtherMethods() { ! ArrayList methods = new ArrayList(); ! ! if (modelElement instanceof IClass) { ! Iterator allMethods = ((IClass) modelElement).getMethods(true) ! .values().iterator(); ! Method[] profMethods = getProfileMethods(); ! ! while (allMethods.hasNext()) { ! IMethod m = (IMethod) allMethods.next(); ! boolean here = false; ! ! for (int n = 0; n < profMethods.length; n++) { ! if (profMethods[n].getMethodName().equalsIgnoreCase(m.getName())) { ! here = true; ! } ! } ! ! if (!here) { ! methods.add(m); ! } ! } ! } ! ! return methods.toArray(); ! } ! ! /** ! * @return Returns the theClass. ! */ ! public Class getTheClass() { ! return theClass; ! } ! ! public int getType() { ! return type; ! } ! } |