Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2008-04-02 12:05:49 -0400
committerashatalin2008-04-02 12:05:49 -0400
commitfc2010099e5ab1388aab3b25acf2ee3c1128e285 (patch)
treef431d43e234e7da7d6bc24d787864cf73b7eea90 /examples
parente6780af002889f0c2ee8174c6dde7d324699bc9f (diff)
downloadorg.eclipse.gmf-tooling-fc2010099e5ab1388aab3b25acf2ee3c1128e285.tar.gz
org.eclipse.gmf-tooling-fc2010099e5ab1388aab3b25acf2ee3c1128e285.tar.xz
org.eclipse.gmf-tooling-fc2010099e5ab1388aab3b25acf2ee3c1128e285.zip
Regenerating example with new templatesv20080402-1725
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EAnnotationReferencesCreateCommand.java4
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EAnnotationReferencesReorientCommand.java2
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EClassESuperTypesCreateCommand.java4
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EClassESuperTypesReorientCommand.java2
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReference2CreateCommand.java8
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReference2ReorientCommand.java2
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReferenceCreateCommand.java8
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReferenceReorientCommand.java2
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramUpdater.java4
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/providers/ElementInitializers.java154
10 files changed, 33 insertions, 157 deletions
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EAnnotationReferencesCreateCommand.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EAnnotationReferencesCreateCommand.java
index fb6786a0d..86256eaad 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EAnnotationReferencesCreateCommand.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EAnnotationReferencesCreateCommand.java
@@ -52,10 +52,10 @@ public class EAnnotationReferencesCreateCommand extends EditElementCommand {
if (source == null && target == null) {
return false;
}
- if (source != null && !(source instanceof EAnnotation)) {
+ if (source != null && false == source instanceof EAnnotation) {
return false;
}
- if (target != null && !(target instanceof EObject)) {
+ if (target != null && false == target instanceof EObject) {
return false;
}
if (getSource() == null) {
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EAnnotationReferencesReorientCommand.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EAnnotationReferencesReorientCommand.java
index 0078c6051..41c9a28b4 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EAnnotationReferencesReorientCommand.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EAnnotationReferencesReorientCommand.java
@@ -62,7 +62,7 @@ public class EAnnotationReferencesReorientCommand extends EditElementCommand {
* @generated
*/
public boolean canExecute() {
- if (!(referenceOwner instanceof EAnnotation)) {
+ if (false == referenceOwner instanceof EAnnotation) {
return false;
}
if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EClassESuperTypesCreateCommand.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EClassESuperTypesCreateCommand.java
index 2b626e330..2529f8a39 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EClassESuperTypesCreateCommand.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EClassESuperTypesCreateCommand.java
@@ -52,10 +52,10 @@ public class EClassESuperTypesCreateCommand extends EditElementCommand {
if (source == null && target == null) {
return false;
}
- if (source != null && !(source instanceof EClass)) {
+ if (source != null && false == source instanceof EClass) {
return false;
}
- if (target != null && !(target instanceof EClass)) {
+ if (target != null && false == target instanceof EClass) {
return false;
}
if (getSource() == null) {
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EClassESuperTypesReorientCommand.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EClassESuperTypesReorientCommand.java
index ef123591c..234efede9 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EClassESuperTypesReorientCommand.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EClassESuperTypesReorientCommand.java
@@ -62,7 +62,7 @@ public class EClassESuperTypesReorientCommand extends EditElementCommand {
* @generated
*/
public boolean canExecute() {
- if (!(referenceOwner instanceof EClass)) {
+ if (false == referenceOwner instanceof EClass) {
return false;
}
if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReference2CreateCommand.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReference2CreateCommand.java
index b219dd81e..abb35c55e 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReference2CreateCommand.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReference2CreateCommand.java
@@ -63,10 +63,10 @@ public class EReference2CreateCommand extends CreateElementCommand {
if (source == null && target == null) {
return false;
}
- if (source != null && !(source instanceof EClass)) {
+ if (source != null && false == source instanceof EClass) {
return false;
}
- if (target != null && !(target instanceof EClassifier)) {
+ if (target != null && false == target instanceof EClassifier) {
return false;
}
if (getSource() == null) {
@@ -80,11 +80,11 @@ public class EReference2CreateCommand extends CreateElementCommand {
* @generated
*/
protected EObject doDefaultElementCreation() {
- // org.eclipse.emf.ecore.EReference newElement = (org.eclipse.emf.ecore.EReference) super.doDefaultElementCreation();
EReference newElement = EcoreFactory.eINSTANCE.createEReference();
getSource().getEStructuralFeatures().add(newElement);
newElement.setEType(getTarget());
- EcoreElementTypes.Initializers.EReference_4003.init(newElement);
+ EcoreElementTypes.init_EReference_4003(newElement);
+
return newElement;
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReference2ReorientCommand.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReference2ReorientCommand.java
index 5fa7e7e93..338ba7253 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReference2ReorientCommand.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReference2ReorientCommand.java
@@ -57,7 +57,7 @@ public class EReference2ReorientCommand extends EditElementCommand {
* @generated
*/
public boolean canExecute() {
- if (!(getElementToEdit() instanceof EReference)) {
+ if (false == getElementToEdit() instanceof EReference) {
return false;
}
if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReferenceCreateCommand.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReferenceCreateCommand.java
index 0a31f810d..593933037 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReferenceCreateCommand.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReferenceCreateCommand.java
@@ -63,10 +63,10 @@ public class EReferenceCreateCommand extends CreateElementCommand {
if (source == null && target == null) {
return false;
}
- if (source != null && !(source instanceof EClass)) {
+ if (source != null && false == source instanceof EClass) {
return false;
}
- if (target != null && !(target instanceof EClassifier)) {
+ if (target != null && false == target instanceof EClassifier) {
return false;
}
if (getSource() == null) {
@@ -80,11 +80,11 @@ public class EReferenceCreateCommand extends CreateElementCommand {
* @generated
*/
protected EObject doDefaultElementCreation() {
- // org.eclipse.emf.ecore.EReference newElement = (org.eclipse.emf.ecore.EReference) super.doDefaultElementCreation();
EReference newElement = EcoreFactory.eINSTANCE.createEReference();
getSource().getEStructuralFeatures().add(newElement);
newElement.setEType(getTarget());
- EcoreElementTypes.Initializers.EReference_4002.init(newElement);
+ EcoreElementTypes.init_EReference_4002(newElement);
+
return newElement;
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReferenceReorientCommand.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReferenceReorientCommand.java
index 2948805bb..6e84a0fe3 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReferenceReorientCommand.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/commands/EReferenceReorientCommand.java
@@ -57,7 +57,7 @@ public class EReferenceReorientCommand extends EditElementCommand {
* @generated
*/
public boolean canExecute() {
- if (!(getElementToEdit() instanceof EReference)) {
+ if (false == getElementToEdit() instanceof EReference) {
return false;
}
if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramUpdater.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramUpdater.java
index 952761e2a..29a943c12 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramUpdater.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramUpdater.java
@@ -1025,7 +1025,7 @@ public class EcoreDiagramUpdater {
private static Collection getContainedTypeModelFacetLinks_EReference_4002(EClass container) {
Collection result = new LinkedList();
for (Iterator links = container.getEStructuralFeatures().iterator(); links.hasNext();) {
- Object linkObject = links.next();
+ EObject linkObject = (EObject) links.next();
if (false == linkObject instanceof EReference) {
continue;
}
@@ -1045,7 +1045,7 @@ public class EcoreDiagramUpdater {
private static Collection getContainedTypeModelFacetLinks_EReference_4003(EClass container) {
Collection result = new LinkedList();
for (Iterator links = container.getEStructuralFeatures().iterator(); links.hasNext();) {
- Object linkObject = links.next();
+ EObject linkObject = (EObject) links.next();
if (false == linkObject instanceof EReference) {
continue;
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/providers/ElementInitializers.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/providers/ElementInitializers.java
index 041ee2545..1006b89f1 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/providers/ElementInitializers.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/providers/ElementInitializers.java
@@ -18,6 +18,7 @@ import java.util.List;
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.EcorePackage;
import org.eclipse.gmf.ecore.expressions.EcoreAbstractExpression;
@@ -32,149 +33,24 @@ public class ElementInitializers {
/**
* @generated
*/
- public static class Initializers {
+ public static void init_EReference_4002(EReference instance) {
+ try {
+ EcoreOCLFactory.getExpression("false", EcorePackage.eINSTANCE.getEReference()).assignTo(EcorePackage.eINSTANCE.getEReference_Containment(), instance);
- /**
- * @generated
- */
- public static final IObjectInitializer EReference_4002 = new ObjectInitializer(EcorePackage.eINSTANCE.getEReference()) {
-
- protected void init() {
- add(createExpressionFeatureInitializer(EcorePackage.eINSTANCE.getEReference_Containment(), EcoreOCLFactory.getExpression("false", //$NON-NLS-1$
- EcorePackage.eINSTANCE.getEReference())));
- }
- };
-
- /**
- * @generated
- */
- public static final IObjectInitializer EReference_4003 = new ObjectInitializer(EcorePackage.eINSTANCE.getEReference()) {
-
- protected void init() {
- add(createExpressionFeatureInitializer(EcorePackage.eINSTANCE.getEReference_Containment(), EcoreOCLFactory.getExpression("true", //$NON-NLS-1$
- EcorePackage.eINSTANCE.getEReference())));
- }
- };
-
- /**
- * @generated
- */
- private Initializers() {
- }
-
- /**
- * @generated
- */
- public static interface IObjectInitializer {
-
- /**
- * @generated
- */
- public void init(EObject instance);
+ } catch (RuntimeException e) {
+ EcoreDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
+ }
- /**
- * @generated
- */
- public static abstract class ObjectInitializer implements IObjectInitializer {
-
- /**
- * @generated
- */
- final EClass element;
-
- /**
- * @generated
- */
- private List featureInitializers = new ArrayList();
-
- /**
- * @generated
- */
- ObjectInitializer(EClass element) {
- this.element = element;
- init();
- }
-
- /**
- * @generated
- */
- protected abstract void init();
-
- /**
- * @generated
- */
- protected final IFeatureInitializer add(IFeatureInitializer initializer) {
- featureInitializers.add(initializer);
- return initializer;
- }
-
- /**
- * @generated
- */
- public void init(EObject instance) {
- for (Iterator it = featureInitializers.iterator(); it.hasNext();) {
- IFeatureInitializer nextExpr = (IFeatureInitializer) it.next();
- try {
- nextExpr.init(instance);
- } catch (RuntimeException e) {
- EcoreDiagramEditorPlugin.getInstance().logError("Feature initialization failed", e); //$NON-NLS-1$
- }
- }
- }
- }
-
- /**
- * @generated
- */
- interface IFeatureInitializer {
-
- /**
- * @generated
- */
- void init(EObject contextInstance);
- }
-
- /**
- * @generated
- */
- static IFeatureInitializer createNewElementFeatureInitializer(EStructuralFeature initFeature, ObjectInitializer[] newObjectInitializers) {
- final EStructuralFeature feature = initFeature;
- final ObjectInitializer[] initializers = newObjectInitializers;
- return new IFeatureInitializer() {
-
- public void init(EObject contextInstance) {
- for (int i = 0; i < initializers.length; i++) {
- EObject newInstance = initializers[i].element.getEPackage().getEFactoryInstance().create(initializers[i].element);
- if (feature.isMany()) {
- ((Collection) contextInstance.eGet(feature)).add(newInstance);
- } else {
- contextInstance.eSet(feature, newInstance);
- }
- initializers[i].init(newInstance);
- }
- }
- };
- }
-
- /**
- * @generated
- */
- static IFeatureInitializer createExpressionFeatureInitializer(EStructuralFeature initFeature, EcoreAbstractExpression valueExpression) {
- final EStructuralFeature feature = initFeature;
- final EcoreAbstractExpression expression = valueExpression;
- return new IFeatureInitializer() {
-
- public void init(EObject contextInstance) {
- expression.assignTo(feature, contextInstance);
- }
- };
- }
+ /**
+ * @generated
+ */
+ public static void init_EReference_4003(EReference instance) {
+ try {
+ EcoreOCLFactory.getExpression("true", EcorePackage.eINSTANCE.getEReference()).assignTo(EcorePackage.eINSTANCE.getEReference_Containment(), instance);
- /**
- * @generated
- */
- static class Java {
+ } catch (RuntimeException e) {
+ EcoreDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
}

Back to the top