/*
* (c) 2011 - 2013 University of Mannheim: Software Engineering Group
*/
package de.uni_mannheim.informatik.swt.models.plm.diagram.providers;
import java.util.Collection;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gef.ui.palette.PaletteViewer;
import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
import org.eclipse.ui.PlatformUI;
/**
* @generated
*/
public class ElementInitializers {
protected ElementInitializers() {
// use #getInstance to access cached instance
}
/**
* @generated
*/
public void init_Ontology_2003(
de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
0,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
1,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Model_3059(
de.uni_mannheim.informatik.swt.models.plm.PLM.Model instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
2,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
3,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
Object value_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
4,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getModel(), null).evaluate(instance);
instance.setName((java.lang.String) value_1);
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Connection_3060(
de.uni_mannheim.informatik.swt.models.plm.PLM.Connection instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
7,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
8,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditor editor = (de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditor) PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
PaletteViewer viewer = editor.getPalette();
//We create an instance of a DSL element
if (viewer.getActiveTool().getId().startsWith("dsl.")) {
String typeName = viewer
.getActiveTool()
.getId()
.substring(
viewer.getActiveTool().getId().indexOf(".") + 1)
.replace(".CreationTool", "");
TreeIterator<EObject> iter = EcoreUtil.getRootContainer(
instance).eAllContents();
while (iter.hasNext()) {
EObject current = iter.next();
if (EMFCoreUtil.getProxyID(current).equals(typeName)) {
de.uni_mannheim.informatik.swt.models.plm.PLM.impl.PLMFactoryImpl.eINSTANCE
.configureClabject(
(de.uni_mannheim.informatik.swt.models.plm.PLM.Clabject) current,
instance, null);
break;
}
}
}
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Attribute_3061(
de.uni_mannheim.informatik.swt.models.plm.PLM.Attribute instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
9,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
10,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
Object value_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
11,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getAttribute(), null).evaluate(instance);
value_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_1, EcorePackage.eINSTANCE.getEInt());
instance.setDurability(((Integer) value_1).intValue());
Object value_2 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
12,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getAttribute(), null).evaluate(instance);
value_2 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_2, EcorePackage.eINSTANCE.getEInt());
instance.setMutability(((Integer) value_2).intValue());
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Method_3062(
de.uni_mannheim.informatik.swt.models.plm.PLM.Method instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
19,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
20,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
Object value_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
21,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getMethod(), null).evaluate(instance);
value_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_1, EcorePackage.eINSTANCE.getEInt());
instance.setDurability(((Integer) value_1).intValue());
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Entity_3085(
de.uni_mannheim.informatik.swt.models.plm.PLM.Entity instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
29,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
30,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditor editor = (de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditor) PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
PaletteViewer viewer = editor.getPalette();
//We create an instance of a DSL element
if (viewer.getActiveTool().getId().startsWith("dsl.")) {
String typeName = viewer
.getActiveTool()
.getId()
.substring(
viewer.getActiveTool().getId().indexOf(".") + 1)
.replace(".CreationTool", "");
TreeIterator<EObject> iter = EcoreUtil.getRootContainer(
instance).eAllContents();
while (iter.hasNext()) {
EObject current = iter.next();
if (EMFCoreUtil.getProxyID(current).equals(typeName)) {
de.uni_mannheim.informatik.swt.models.plm.PLM.impl.PLMFactoryImpl.eINSTANCE
.configureClabject(
(de.uni_mannheim.informatik.swt.models.plm.PLM.Clabject) current,
instance, null);
break;
}
}
}
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Attribute_3070(
de.uni_mannheim.informatik.swt.models.plm.PLM.Attribute instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
31,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
32,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
Object value_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
33,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getAttribute(), null).evaluate(instance);
value_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_1, EcorePackage.eINSTANCE.getEInt());
instance.setDurability(((Integer) value_1).intValue());
Object value_2 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
34,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getAttribute(), null).evaluate(instance);
value_2 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_2, EcorePackage.eINSTANCE.getEInt());
instance.setMutability(((Integer) value_2).intValue());
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Method_3071(
de.uni_mannheim.informatik.swt.models.plm.PLM.Method instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
41,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
42,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
Object value_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
43,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getMethod(), null).evaluate(instance);
value_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_1, EcorePackage.eINSTANCE.getEInt());
instance.setDurability(((Integer) value_1).intValue());
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Connection_3086(
de.uni_mannheim.informatik.swt.models.plm.PLM.Connection instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
7,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
8,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditor editor = (de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditor) PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
PaletteViewer viewer = editor.getPalette();
//We create an instance of a DSL element
if (viewer.getActiveTool().getId().startsWith("dsl.")) {
String typeName = viewer
.getActiveTool()
.getId()
.substring(
viewer.getActiveTool().getId().indexOf(".") + 1)
.replace(".CreationTool", "");
TreeIterator<EObject> iter = EcoreUtil.getRootContainer(
instance).eAllContents();
while (iter.hasNext()) {
EObject current = iter.next();
if (EMFCoreUtil.getProxyID(current).equals(typeName)) {
de.uni_mannheim.informatik.swt.models.plm.PLM.impl.PLMFactoryImpl.eINSTANCE
.configureClabject(
(de.uni_mannheim.informatik.swt.models.plm.PLM.Clabject) current,
instance, null);
break;
}
}
}
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Complement_3063(
de.uni_mannheim.informatik.swt.models.plm.PLM.Complement instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
60,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
61,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Equality_3064(
de.uni_mannheim.informatik.swt.models.plm.PLM.Equality instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
64,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
65,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Inversion_3065(
de.uni_mannheim.informatik.swt.models.plm.PLM.Inversion instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
68,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
69,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Generalization_3072(
de.uni_mannheim.informatik.swt.models.plm.PLM.Generalization instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
72,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
73,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
/**
* @generated
*/
public void init_Entity_3069(
de.uni_mannheim.informatik.swt.models.plm.PLM.Entity instance) {
try {
de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer newInstance_0_0 = de.uni_mannheim.informatik.swt.models.plm.PLM.PLMFactory.eINSTANCE
.createLMLVisualizer();
instance.getVisualizer().add(newInstance_0_0);
Object value_0_0_0 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
29,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
if (value_0_0_0 instanceof Collection) {
newInstance_0_0.getAttributes().clear();
newInstance_0_0.getAttributes().addAll(
((Collection) value_0_0_0));
} else {
newInstance_0_0.getAttributes().add(
(java.lang.String) value_0_0_0);
}
Object value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMOCLFactory
.getExpression(
30,
de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage.eINSTANCE
.getLMLVisualizer(), null).evaluate(
newInstance_0_0);
value_0_0_1 = de.uni_mannheim.informatik.swt.models.plm.diagram.expressions.PLMAbstractExpression
.performCast(value_0_0_1, EcorePackage.eINSTANCE.getEInt());
newInstance_0_0.setDurability(((Integer) value_0_0_1).intValue());
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditor editor = (de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditor) PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
PaletteViewer viewer = editor.getPalette();
//We create an instance of a DSL element
if (viewer.getActiveTool().getId().startsWith("dsl.")) {
String typeName = viewer
.getActiveTool()
.getId()
.substring(
viewer.getActiveTool().getId().indexOf(".") + 1)
.replace(".CreationTool", "");
TreeIterator<EObject> iter = EcoreUtil.getRootContainer(
instance).eAllContents();
while (iter.hasNext()) {
EObject current = iter.next();
if (EMFCoreUtil.getProxyID(current).equals(typeName)) {
de.uni_mannheim.informatik.swt.models.plm.PLM.impl.PLMFactoryImpl.eINSTANCE
.configureClabject(
(de.uni_mannheim.informatik.swt.models.plm.PLM.Clabject) current,
instance, null);
break;
}
}
}
} catch (RuntimeException e) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
}
private static final String REASONING_SERVICE_ID = "de.uni_mannheim.informatik.swt.plm.reasoning.service";
/**
* @generated
*/
public static ElementInitializers getInstance() {
ElementInitializers cached = de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().getElementInitializers();
if (cached == null) {
de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMDiagramEditorPlugin
.getInstance().setElementInitializers(
cached = new ElementInitializers());
}
return cached;
}
}