Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorsten Sommer2013-07-14 10:39:21 -0400
committerTorsten Sommer2013-07-14 10:39:21 -0400
commitd502ca49abce8d2f9458f7e33611399de461ce86 (patch)
tree1783391753d4f5e53fcfc4110c3fb55f99f1edef
parentedb1f66f550526870b840a049f50b39d903fb1a7 (diff)
downloadorg.eclipse.efxclipse-d502ca49abce8d2f9458f7e33611399de461ce86.tar.gz
org.eclipse.efxclipse-d502ca49abce8d2f9458f7e33611399de461ce86.tar.xz
org.eclipse.efxclipse-d502ca49abce8d2f9458f7e33611399de461ce86.zip
ECPControlContext removed.
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPControl.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPControlContext.java33
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPModelElementOpenerImpl.java24
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPUtil.java1
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ModelElementEditor.java5
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/AutoSelector.java4
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CharacterField.java11
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CheckBoxControl.java13
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/DateControl.java11
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ECPControlBase.java9
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/EnumChoiceBox.java11
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ReferenceControl.java15
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/TextFieldControl.java11
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/AbstractEmbeddedControl.java7
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/AddEnumControl.java51
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedCheckboxControl.java7
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedEnumControl.java7
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedNumberFieldControl.java7
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedReferenceControl.java11
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedTextFieldControl.java7
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EnumAddControl.java8
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/MultiControl.java43
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/NumberFieldAddControl.java9
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/ReferenceAddControl.java9
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/TextFieldAddControl.java19
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigDecimalSpinner.java11
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigIntegerSpinner.java11
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleField.java12
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleSpinner.java11
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/FloatSpinner.java12
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/IntegerSpinner.java12
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/LongSpinner.java12
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/NumberSpinner.java7
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/ShortSpinner.java12
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/DefaultModelElementForm.java44
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/ModelElementForm.java4
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/impl/ControlFactoryRegistryImpl.java2
-rw-r--r--demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart.java19
-rw-r--r--demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart2.java61
39 files changed, 227 insertions, 339 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPControl.java
index ee38a62e6..2f9a4811c 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPControl.java
@@ -3,6 +3,7 @@ package org.eclipse.fx.ecp.ui;
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
import org.eclipse.fx.ecp.ui.impl.ControlFactoryRegistryImpl;
@@ -13,7 +14,7 @@ public interface ECPControl {
interface Factory {
- ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context);
+ ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain);
interface Descriptor {
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPControlContext.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPControlContext.java
deleted file mode 100644
index 6517c03e5..000000000
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPControlContext.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.eclipse.fx.ecp.ui;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.domain.EditingDomain;
-
-/**
- * Context for a modelelement.
- */
-public interface ECPControlContext {
-
- /**
- * Returns the editing domain.
- *
- * @return the editing domain
- */
- EditingDomain getEditingDomain();
-
- /**
- * Returns the {@link EObject} of this {@link ECPControlContext}.
- *
- * @return the {@link EObject} of this context
- */
- EObject getModelElement();
-
- /**
- * Opens an {@link EObject} in a new context.
- *
- * @param eObject
- * the {@link EObject} to open in a new context
- */
- void openInNewContext(EObject eObject);
-
-}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPModelElementOpenerImpl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPModelElementOpenerImpl.java
index 2002d8a44..4ab46079f 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPModelElementOpenerImpl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPModelElementOpenerImpl.java
@@ -7,8 +7,6 @@ import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.domain.EditingDomain;
public class ECPModelElementOpenerImpl implements ECPModelElementOpener {
@@ -33,27 +31,7 @@ public class ECPModelElementOpenerImpl implements ECPModelElementOpener {
if (object instanceof ModelElementEditor) {
-
- ECPControlContext modelElementContext = new ECPControlContext() {
-
- @Override
- public void openInNewContext(EObject eObject) {
- openModelElement(eObject);
- }
-
- @Override
- public EObject getModelElement() {
- return modelElement;
- }
-
- @Override
- public EditingDomain getEditingDomain() {
- return AdapterFactoryEditingDomain.getEditingDomainFor(modelElement);
- }
-
- };
-
- ((ModelElementEditor) object).setInput(modelElementContext);
+ ((ModelElementEditor) object).setInput(modelElement);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPUtil.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPUtil.java
index b40441afa..87a97e12f 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPUtil.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPUtil.java
@@ -6,7 +6,6 @@ import javafx.geometry.Point2D;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
-import javafx.scene.control.ContextMenu;
import javafx.scene.control.Labeled;
import javafx.scene.control.TreeItem;
import javafx.scene.image.ImageView;
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ModelElementEditor.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ModelElementEditor.java
index 071829b82..1fd946824 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ModelElementEditor.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ModelElementEditor.java
@@ -1,8 +1,9 @@
package org.eclipse.fx.ecp.ui;
+import org.eclipse.emf.ecore.EObject;
public interface ModelElementEditor {
-
- void setInput(ECPControlContext modelElement);
+
+ void setInput(EObject modelElement);
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/AutoSelector.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/AutoSelector.java
index df57a0dea..fb2642c22 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/AutoSelector.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/AutoSelector.java
@@ -1,12 +1,12 @@
package org.eclipse.fx.ecp.ui.controls;
-import com.google.common.base.Strings;
-
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.control.TextField;
+import com.google.common.base.Strings;
+
public class AutoSelector implements ChangeListener<Boolean> {
protected final TextField textField;
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CharacterField.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CharacterField.java
index bf2260769..c0a5a62f3 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CharacterField.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CharacterField.java
@@ -10,17 +10,18 @@ import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
public class CharacterField extends ECPControlBase {
protected TextField textField;
- public CharacterField(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public CharacterField(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new Skin(this));
@@ -103,8 +104,8 @@ public class CharacterField extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new CharacterField(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor propertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new CharacterField(propertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CheckBoxControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CheckBoxControl.java
index 94991d83e..a6a9cca19 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CheckBoxControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CheckBoxControl.java
@@ -5,9 +5,10 @@ import javafx.scene.control.CheckBox;
import javafx.scene.control.SkinBase;
import javafx.scene.layout.HBox;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.emf.databinding.edit.EMFEditFXProperties;
public class CheckBoxControl extends ECPControlBase {
@@ -15,14 +16,14 @@ public class CheckBoxControl extends ECPControlBase {
protected Property<Boolean> property;
protected CheckBox checkBox;
- public CheckBoxControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public CheckBoxControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new Skin(this));
getStyleClass().add("formControl");
- property = EMFEditFXProperties.value(context.getEditingDomain(), modelElement, feature);
+ property = EMFEditFXProperties.value(editingDomain, modelElement, feature);
checkBox.selectedProperty().bindBidirectional(property);
}
@@ -53,8 +54,8 @@ public class CheckBoxControl extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new CheckBoxControl(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new CheckBoxControl(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/DateControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/DateControl.java
index 0e8daa688..32686b873 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/DateControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/DateControl.java
@@ -10,18 +10,19 @@ import javafx.scene.layout.HBox;
import jidefx.scene.control.field.DateField;
import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
public class DateControl extends ECPControlBase {
protected DateField dateField;
protected boolean internalUpdate = false;
- public DateControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public DateControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new Skin(this));
@@ -73,8 +74,8 @@ public class DateControl extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new DateControl(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new DateControl(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ECPControlBase.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ECPControlBase.java
index 487c17554..ba8ab1b43 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ECPControlBase.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ECPControlBase.java
@@ -9,7 +9,6 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
public abstract class ECPControlBase extends Control {
@@ -18,14 +17,12 @@ public abstract class ECPControlBase extends Control {
protected final EditingDomain editingDomain;
protected final IItemPropertyDescriptor propertyDescriptor;
protected final Adapter modelElementAdapter;
- protected final ECPControlContext context;
- public ECPControlBase(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- this.modelElement = context.getModelElement();
+ public ECPControlBase(IItemPropertyDescriptor propertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ this.modelElement = modelElement;
this.feature = (EStructuralFeature) propertyDescriptor.getFeature(modelElement);
- this.editingDomain = context.getEditingDomain();
+ this.editingDomain = editingDomain;
this.propertyDescriptor = propertyDescriptor;
- this.context = context;
modelElementAdapter = createModelElementAdapter();
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/EnumChoiceBox.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/EnumChoiceBox.java
index 6722a6146..da6bcb465 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/EnumChoiceBox.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/EnumChoiceBox.java
@@ -15,17 +15,18 @@ import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
public class EnumChoiceBox extends ECPControlBase {
protected ChoiceBox<Enumerator> choiceBox;
- public EnumChoiceBox(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public EnumChoiceBox(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new Skin(this));
@@ -98,8 +99,8 @@ public class EnumChoiceBox extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new EnumChoiceBox(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new EnumChoiceBox(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ReferenceControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ReferenceControl.java
index fbe9426ae..0a1c98244 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ReferenceControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ReferenceControl.java
@@ -20,9 +20,9 @@ import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ECPUtil;
import org.eclipse.fx.emf.edit.ui.dnd.LocalTransfer;
@@ -38,8 +38,8 @@ public class ReferenceControl extends ECPControlBase {
protected Command unsetCommand;
protected Label label;
- public ReferenceControl(IItemPropertyDescriptor propertyDescriptor, final ECPControlContext context) {
- super(propertyDescriptor, context);
+ public ReferenceControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
reference = (EReference) feature;
setSkin(new Skin(this));
@@ -49,8 +49,9 @@ public class ReferenceControl extends ECPControlBase {
@Override
public void handle(ActionEvent arg0) {
Object value = modelElement.eGet(reference);
- if (value instanceof EObject)
- context.openInNewContext((EObject) value);
+ // TODO change this to model element opener
+// if (value instanceof EObject)
+// context.openInNewContext((EObject) value);
}
});
@@ -171,8 +172,8 @@ public class ReferenceControl extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new ReferenceControl(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new ReferenceControl(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/TextFieldControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/TextFieldControl.java
index 8dddd268b..ea392942e 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/TextFieldControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/TextFieldControl.java
@@ -10,17 +10,18 @@ import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
public class TextFieldControl extends ECPControlBase {
protected TextField textField;
- public TextFieldControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public TextFieldControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new Skin(this));
@@ -72,8 +73,8 @@ public class TextFieldControl extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new TextFieldControl(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new TextFieldControl(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/AbstractEmbeddedControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/AbstractEmbeddedControl.java
index 9ba721219..3b2f1f95c 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/AbstractEmbeddedControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/AbstractEmbeddedControl.java
@@ -12,11 +12,12 @@ import javafx.scene.layout.HBox;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.command.MoveCommand;
import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ECPUtil;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
@@ -34,8 +35,8 @@ public abstract class AbstractEmbeddedControl extends ECPControlBase {
protected Command moveDownCommand;
protected CompoundCommand removeCommand;
- public AbstractEmbeddedControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context, int initialIndex) {
- super(propertyDescriptor, context);
+ public AbstractEmbeddedControl(IItemPropertyDescriptor propertyDescriptor, EObject modelElement, EditingDomain editingDomain, int initialIndex) {
+ super(propertyDescriptor, modelElement, editingDomain);
index = initialIndex;
eList = (EList<?>) modelElement.eGet(feature);
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/AddEnumControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/AddEnumControl.java
deleted file mode 100644
index 8e3788fa7..000000000
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/AddEnumControl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.fx.ecp.ui.controls.multi;
-
-import javafx.beans.property.Property;
-import javafx.beans.property.SimpleObjectProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.scene.control.ChoiceBox;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
-
-public class AddEnumControl extends ChoiceBox<Enumerator> {
-
- final private SimpleObjectProperty<Object> objectProperty = new SimpleObjectProperty<>();
- public final static Object ILLEGAL_VALUE = new Object();
-
- public AddEnumControl(EStructuralFeature feature, ECPControlContext context) {
-
- EClassifier type = feature.getEType();
-
- EEnum eEnum = (EEnum) type;
-
- EList<EEnumLiteral> enumLiterals = eEnum.getELiterals();
-
- if (!feature.isRequired())
- getItems().add(null);
-
- for (EEnumLiteral literal : enumLiterals)
- getItems().add(literal.getInstance());
-
- getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Enumerator>() {
-
- @Override
- public void changed(ObservableValue<? extends Enumerator> arg0, Enumerator arg1, Enumerator arg2) {
- objectProperty.set(arg2);
- }
-
- });
-
- }
-
- public Property<?> objectValueProperty() {
- return objectProperty;
- }
-
-}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedCheckboxControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedCheckboxControl.java
index 7b36e6d27..8ede8c825 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedCheckboxControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedCheckboxControl.java
@@ -9,16 +9,17 @@ import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
public class EmbeddedCheckboxControl extends AbstractEmbeddedControl {
protected CheckBox checkBox;
- public EmbeddedCheckboxControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context, int initialIndex) {
- super(propertyDescriptor, context, initialIndex);
+ public EmbeddedCheckboxControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain, int initialIndex) {
+ super(propertyDescriptor, modelElement, editingDomain, initialIndex);
setSkin(new Skin(this));
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedEnumControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedEnumControl.java
index 44a0e4c1e..c7f9cd562 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedEnumControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedEnumControl.java
@@ -13,17 +13,18 @@ import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
public class EmbeddedEnumControl extends AbstractEmbeddedControl {
private volatile boolean internal;
protected ChoiceBox<Enumerator> choiceBox;
- public EmbeddedEnumControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context, int initialIndex) {
- super(propertyDescriptor, context, initialIndex);
+ public EmbeddedEnumControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain, int initialIndex) {
+ super(propertyDescriptor, modelElement, editingDomain, initialIndex);
setSkin(new Skin(this));
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedNumberFieldControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedNumberFieldControl.java
index 0e3f68f30..cd5ccca7a 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedNumberFieldControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedNumberFieldControl.java
@@ -12,9 +12,10 @@ import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.controls.AutoSelector;
public class EmbeddedNumberFieldControl extends AbstractEmbeddedControl {
@@ -22,8 +23,8 @@ public class EmbeddedNumberFieldControl extends AbstractEmbeddedControl {
protected TextField textField;
protected Class<?> instanceClass;
- public EmbeddedNumberFieldControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context, int initialIndex) {
- super(propertyDescriptor, context, initialIndex);
+ public EmbeddedNumberFieldControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain, int initialIndex) {
+ super(propertyDescriptor, modelElement, editingDomain, initialIndex);
instanceClass = feature.getEType().getInstanceClass();
setSkin(new Skin(this));
update();
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedReferenceControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedReferenceControl.java
index fcb02e411..f0f2305cb 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedReferenceControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedReferenceControl.java
@@ -10,8 +10,8 @@ import javafx.scene.layout.Priority;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ECPUtil;
public class EmbeddedReferenceControl extends AbstractEmbeddedControl {
@@ -20,8 +20,8 @@ public class EmbeddedReferenceControl extends AbstractEmbeddedControl {
protected AdapterImpl valueAdapter;
protected EObject value;
- public EmbeddedReferenceControl(IItemPropertyDescriptor propertyDescriptor, final ECPControlContext context, int initialIndex) {
- super(propertyDescriptor, context, initialIndex);
+ public EmbeddedReferenceControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain, int initialIndex) {
+ super(propertyDescriptor, modelElement, editingDomain, initialIndex);
valueAdapter = new AdapterImpl() {
@@ -85,8 +85,9 @@ public class EmbeddedReferenceControl extends AbstractEmbeddedControl {
public void handle(ActionEvent arg0) {
if (eList.size() > index) {
Object item = eList.get(index);
- if (item instanceof EObject)
- context.openInNewContext((EObject) item);
+ // TODO: change this to model element opener
+ //if (item instanceof EObject)
+ //context.openInNewContext((EObject) item);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedTextFieldControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedTextFieldControl.java
index 58f4be89c..26062f4d0 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedTextFieldControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EmbeddedTextFieldControl.java
@@ -16,9 +16,10 @@ import javafx.stage.Popup;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.controls.AutoSelector;
public class EmbeddedTextFieldControl extends AbstractEmbeddedControl {
@@ -26,8 +27,8 @@ public class EmbeddedTextFieldControl extends AbstractEmbeddedControl {
protected EDataTypeValueHandler valueHandler;
protected TextField textField;
- public EmbeddedTextFieldControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context, int initialIndex) {
- super(propertyDescriptor, context, initialIndex);
+ public EmbeddedTextFieldControl(IItemPropertyDescriptor propertyDescriptor, EObject modelElement, EditingDomain editingDomain, int initialIndex) {
+ super(propertyDescriptor, modelElement, editingDomain, initialIndex);
valueHandler = new EDataTypeValueHandler((EDataType) feature.getEType());
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EnumAddControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EnumAddControl.java
index 4a68dc498..afc0a11ae 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EnumAddControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/EnumAddControl.java
@@ -17,9 +17,10 @@ import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ECPUtil;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
@@ -29,8 +30,9 @@ public class EnumAddControl extends ECPControlBase {
protected Button addButton;
protected Command addCommand;
- public EnumAddControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public EnumAddControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
+
setSkin(new Skin(this));
getStyleClass().add("enum-add-control");
update();
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/MultiControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/MultiControl.java
index 40c1e2cfc..abba8ca2d 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/MultiControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/MultiControl.java
@@ -4,17 +4,12 @@ import java.net.URL;
import java.util.Collection;
import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Node;
-import javafx.scene.control.Button;
-import javafx.scene.control.Control;
import javafx.scene.control.SkinBase;
import javafx.scene.image.ImageView;
import javafx.scene.input.DragEvent;
import javafx.scene.input.TransferMode;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import org.eclipse.core.runtime.FileLocator;
@@ -23,23 +18,17 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.AddCommand;
-import org.eclipse.emf.edit.command.MoveCommand;
-import org.eclipse.emf.edit.command.RemoveCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ECPUIPlugin;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
-import org.eclipse.fx.ecp.ui.controls.ValidationMessage;
import org.eclipse.fx.emf.edit.ui.dnd.LocalTransfer;
import org.osgi.framework.Bundle;
@@ -59,8 +48,8 @@ public class MultiControl extends ECPControlBase {
}
- public MultiControl(final IItemPropertyDescriptor propertyDescriptor, final ECPControlContext context) {
- super(propertyDescriptor, context);
+ public MultiControl(final IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new Skin(this));
@@ -77,15 +66,15 @@ public class MultiControl extends ECPControlBase {
controlsBox.setSpacing(4);
for (int i = 0; i < values.size(); i++) {
- controlsBox.getChildren().add(createEmbeddedControl(propertyDescriptor, context, i));
+ controlsBox.getChildren().add(createEmbeddedControl(propertyDescriptor, modelElement, editingDomain, i));
}
if (feature.getEType() instanceof EEnum) {
- vBox.getChildren().add(addControl = new EnumAddControl(propertyDescriptor, context));
+ vBox.getChildren().add(addControl = new EnumAddControl(propertyDescriptor, modelElement, editingDomain));
} else if (feature.getEType() instanceof EDataType) {
- vBox.getChildren().add(addControl = new TextFieldAddControl(propertyDescriptor, context));
+ vBox.getChildren().add(addControl = new TextFieldAddControl(propertyDescriptor, modelElement, editingDomain));
} else if (feature.getEType() instanceof EObject) {
- vBox.getChildren().add(addControl = new ReferenceAddControl(propertyDescriptor, context));
+ vBox.getChildren().add(addControl = new ReferenceAddControl(propertyDescriptor, modelElement, editingDomain));
setOnDragOver(new EventHandler<DragEvent>() {
@@ -144,7 +133,7 @@ public class MultiControl extends ECPControlBase {
ObservableList<Node> children = controlsBox.getChildren();
switch (msg.getEventType()) {
case Notification.ADD:
- controlsBox.getChildren().add(createEmbeddedControl(propertyDescriptor, context, position));
+ controlsBox.getChildren().add(createEmbeddedControl(propertyDescriptor, modelElement, editingDomain, position));
break;
case Notification.REMOVE: {
AbstractEmbeddedControl control = (AbstractEmbeddedControl) children.get(position);
@@ -158,7 +147,7 @@ public class MultiControl extends ECPControlBase {
break;
case Notification.ADD_MANY:
while (children.size() < values.size())
- children.add(createEmbeddedControl(propertyDescriptor, context, 0));
+ children.add(createEmbeddedControl(propertyDescriptor, modelElement, editingDomain, 0));
break;
case Notification.REMOVE_MANY:
while (children.size() > values.size()) {
@@ -186,21 +175,21 @@ public class MultiControl extends ECPControlBase {
}
private AbstractEmbeddedControl createEmbeddedControl(final IItemPropertyDescriptor propertyDescriptor,
- final ECPControlContext context, int i) {
+ final EObject modelElement, final EditingDomain editingDomain, int i) {
if (feature instanceof EReference) {
- return new EmbeddedReferenceControl(propertyDescriptor, context, i);
+ return new EmbeddedReferenceControl(propertyDescriptor, modelElement, editingDomain, i);
} else if (feature.getEType() instanceof EEnum) {
- return new EmbeddedEnumControl(propertyDescriptor, context, i);
+ return new EmbeddedEnumControl(propertyDescriptor, modelElement, editingDomain, i);
} else {
Class<?> instanceClass = feature.getEType().getInstanceClass();
if (Boolean.class.isAssignableFrom(instanceClass)) {
- return new EmbeddedCheckboxControl(propertyDescriptor, context, i);
+ return new EmbeddedCheckboxControl(propertyDescriptor, modelElement, editingDomain, i);
} else if (Number.class.isAssignableFrom(instanceClass)
|| (instanceClass.isPrimitive() && instanceClass != boolean.class && instanceClass != char.class)) {
- return new EmbeddedNumberFieldControl(propertyDescriptor, context, i);
+ return new EmbeddedNumberFieldControl(propertyDescriptor, modelElement, editingDomain, i);
} else {
- return new EmbeddedTextFieldControl(propertyDescriptor, context, i);
+ return new EmbeddedTextFieldControl(propertyDescriptor, modelElement, editingDomain, i);
}
}
@@ -216,8 +205,8 @@ public class MultiControl extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new MultiControl(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new MultiControl(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/NumberFieldAddControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/NumberFieldAddControl.java
index 376366adb..9bce965a0 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/NumberFieldAddControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/NumberFieldAddControl.java
@@ -13,9 +13,10 @@ import javafx.scene.layout.Priority;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ECPUtil;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
@@ -26,11 +27,9 @@ public class NumberFieldAddControl extends ECPControlBase {
protected Command addCommand;
protected EDataTypeValueHandler valueHandler = new EDataTypeValueHandler((EDataType) feature.getEType());
- public NumberFieldAddControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
-
+ public NumberFieldAddControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new Skin(this));
-
update();
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/ReferenceAddControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/ReferenceAddControl.java
index a2dbd3f94..aacff02e7 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/ReferenceAddControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/ReferenceAddControl.java
@@ -12,8 +12,8 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ECPUtil;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
@@ -52,14 +52,11 @@ public class ReferenceAddControl extends ECPControlBase {
}
- public ReferenceAddControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public ReferenceAddControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
eClass = (EClass) ((EReference) feature).getEType();
-
setSkin(new Skin(this));
-
getStyleClass().add("reference-add-control");
-
update();
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/TextFieldAddControl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/TextFieldAddControl.java
index 85c6c2d33..0a1fb5a3b 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/TextFieldAddControl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/TextFieldAddControl.java
@@ -14,9 +14,10 @@ import javafx.scene.layout.Priority;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ECPUtil;
import org.eclipse.fx.ecp.ui.controls.AutoSelector;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
@@ -28,11 +29,9 @@ public class TextFieldAddControl extends ECPControlBase {
protected Command addCommand;
protected EDataTypeValueHandler valueHandler = new EDataTypeValueHandler((EDataType) feature.getEType());
- public TextFieldAddControl(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
-
+ public TextFieldAddControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new Skin(this));
-
update();
}
@@ -65,19 +64,19 @@ public class TextFieldAddControl extends ECPControlBase {
}
protected class Skin extends SkinBase<TextFieldAddControl> {
-
+
protected Skin(TextFieldAddControl control) {
super(control);
-
+
HBox hBox = new HBox();
getChildren().add(hBox);
textField = new EDataTypeTextField((EDataType) feature.getEType());
hBox.getChildren().add(textField);
textField.getStyleClass().add("left-pill");
-
+
textField.focusedProperty().addListener(new AutoSelector(textField));
-
+
textField.setText(feature.getDefaultValueLiteral());
HBox.setHgrow(textField, Priority.ALWAYS);
@@ -127,7 +126,7 @@ public class TextFieldAddControl extends ECPControlBase {
}
});
}
-
+
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigDecimalSpinner.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigDecimalSpinner.java
index 9f93bddf0..32bef6e1b 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigDecimalSpinner.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigDecimalSpinner.java
@@ -2,9 +2,10 @@ package org.eclipse.fx.ecp.ui.controls.numeric;
import java.math.BigDecimal;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
@@ -12,8 +13,8 @@ public class BigDecimalSpinner extends NumberSpinner {
public static final BigDecimal DEFAULT_VALUE = BigDecimal.ZERO;
- public BigDecimalSpinner(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public BigDecimalSpinner(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new NumberSpinnerSkin<NumberSpinner, BigDecimal>(this) {
@@ -61,8 +62,8 @@ public class BigDecimalSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new BigDecimalSpinner(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new BigDecimalSpinner(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigIntegerSpinner.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigIntegerSpinner.java
index 5d61f58f8..86b601f0a 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigIntegerSpinner.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigIntegerSpinner.java
@@ -2,17 +2,18 @@ package org.eclipse.fx.ecp.ui.controls.numeric;
import java.math.BigInteger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class BigIntegerSpinner extends NumberSpinner {
private static final BigInteger DEFAULT_VALUE = BigInteger.ZERO;
- public BigIntegerSpinner(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public BigIntegerSpinner(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new NumberSpinnerSkin<NumberSpinner, BigInteger>(this) {
@@ -58,8 +59,8 @@ public class BigIntegerSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new BigIntegerSpinner(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new BigIntegerSpinner(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleField.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleField.java
index f8d9d4fd8..b7febe6e9 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleField.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleField.java
@@ -1,7 +1,6 @@
package org.eclipse.fx.ecp.ui.controls.numeric;
import java.text.DecimalFormat;
-import java.text.NumberFormat;
import java.util.Objects;
import javafx.beans.value.ChangeListener;
@@ -11,10 +10,11 @@ import javafx.scene.layout.HBox;
import jidefx.scene.control.field.NumberField;
import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class DoubleField extends ECPControlBase implements ECPControl {
@@ -67,8 +67,8 @@ public class DoubleField extends ECPControlBase implements ECPControl {
}
- public DoubleField(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public DoubleField(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new DoubleFieldSkin(this));
getStyleClass().add("spinner");
}
@@ -94,8 +94,8 @@ public class DoubleField extends ECPControlBase implements ECPControl {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new DoubleField(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new DoubleField(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleSpinner.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleSpinner.java
index fd4623e1e..02de3a986 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleSpinner.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleSpinner.java
@@ -1,16 +1,17 @@
package org.eclipse.fx.ecp.ui.controls.numeric;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class DoubleSpinner extends NumberSpinner {
public static final double DEFAULT_VALUE = 0.0;
- public DoubleSpinner(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public DoubleSpinner(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
setSkin(new NumberSpinnerSkin<NumberSpinner, Double>(this) {
@@ -56,8 +57,8 @@ public class DoubleSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new DoubleSpinner(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new DoubleSpinner(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/FloatSpinner.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/FloatSpinner.java
index 92be37669..6acfc2442 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/FloatSpinner.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/FloatSpinner.java
@@ -1,16 +1,18 @@
package org.eclipse.fx.ecp.ui.controls.numeric;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class FloatSpinner extends NumberSpinner {
public static final float DEFAULT_VALUE = 0f;
- public FloatSpinner(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public FloatSpinner(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
+
setSkin(new NumberSpinnerSkin<NumberSpinner, Float>(this) {
@Override
@@ -55,8 +57,8 @@ public class FloatSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new FloatSpinner(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new FloatSpinner(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/IntegerSpinner.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/IntegerSpinner.java
index 715c42487..c8e7f9dd9 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/IntegerSpinner.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/IntegerSpinner.java
@@ -1,16 +1,18 @@
package org.eclipse.fx.ecp.ui.controls.numeric;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class IntegerSpinner extends NumberSpinner {
public static final Integer DEFAULT_VALUE = 0;
- public IntegerSpinner(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public IntegerSpinner(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
+
setSkin(new NumberSpinnerSkin<NumberSpinner, Integer>(this) {
@@ -56,8 +58,8 @@ public class IntegerSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new IntegerSpinner(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new IntegerSpinner(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/LongSpinner.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/LongSpinner.java
index 873632a50..687c837b5 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/LongSpinner.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/LongSpinner.java
@@ -1,16 +1,18 @@
package org.eclipse.fx.ecp.ui.controls.numeric;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class LongSpinner extends NumberSpinner {
public static final long DEFAULT_VALUE = 0L;
- public LongSpinner(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public LongSpinner(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
+
setSkin(new NumberSpinnerSkin<NumberSpinner, Long>(this) {
@@ -56,8 +58,8 @@ public class LongSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new LongSpinner(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new LongSpinner(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/NumberSpinner.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/NumberSpinner.java
index f291dcdb4..0e7d931bc 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/NumberSpinner.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/NumberSpinner.java
@@ -12,10 +12,11 @@ import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ECPUtil;
import org.eclipse.fx.ecp.ui.controls.AutoSelector;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
@@ -132,8 +133,8 @@ public abstract class NumberSpinner extends ECPControlBase implements ECPControl
}
- public NumberSpinner(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public NumberSpinner(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
getStyleClass().add("spinner");
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/ShortSpinner.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/ShortSpinner.java
index b6ac1ea4c..ca0a86582 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/ShortSpinner.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/ShortSpinner.java
@@ -1,16 +1,18 @@
package org.eclipse.fx.ecp.ui.controls.numeric;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class ShortSpinner extends NumberSpinner {
public static final short DEFAULT_VALUE = 0;
- public ShortSpinner(IItemPropertyDescriptor propertyDescriptor, ECPControlContext context) {
- super(propertyDescriptor, context);
+ public ShortSpinner(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ super(propertyDescriptor, modelElement, editingDomain);
+
setSkin(new NumberSpinnerSkin<NumberSpinner, Short>(this) {
@@ -58,8 +60,8 @@ public class ShortSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, ECPControlContext context) {
- return new ShortSpinner(itemPropertyDescriptor, context);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ return new ShortSpinner(itemPropertyDescriptor, modelElement, editingDomain);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/DefaultModelElementForm.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/DefaultModelElementForm.java
index 7c0767ea3..c4db9976d 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/DefaultModelElementForm.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/DefaultModelElementForm.java
@@ -3,12 +3,9 @@ package org.eclipse.fx.ecp.ui.form;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.function.Supplier;
import javafx.animation.Transition;
-import javafx.beans.property.ObjectProperty;
import javafx.geometry.Insets;
-import javafx.geometry.Point2D;
import javafx.geometry.Pos;
import javafx.geometry.VPos;
import javafx.scene.Node;
@@ -17,13 +14,11 @@ import javafx.scene.control.Label;
import javafx.scene.control.SkinBase;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
-import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority;
import jidefx.animation.AnimationType;
import jidefx.animation.AnimationUtils;
import jidefx.scene.control.decoration.DecorationPane;
-import jidefx.scene.control.decoration.DecorationUtils;
import jidefx.scene.control.decoration.Decorator;
import jidefx.scene.control.decoration.MutableDecorator;
@@ -33,26 +28,28 @@ import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ECPControl.Factory.Registry;
-import org.eclipse.fx.ecp.ui.controls.ControlDecoration;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class DefaultModelElementForm extends Control implements ModelElementForm {
- ECPControlContext modelElementContext;
private Map<EStructuralFeature, ValidationDecoration> controls = new HashMap<>();
- public DefaultModelElementForm(final ECPControlContext modelElementContext) {
- this.modelElementContext = modelElementContext;
+ protected final EObject modelElement;
+ protected final EditingDomain editingDomain;
+
+ public DefaultModelElementForm(EObject modelElement, EditingDomain editingDomain) {
+ this.modelElement = modelElement;
+ this.editingDomain = editingDomain;
setSkin(new Skin(this));
getStyleClass().add("model-element-form");
- modelElementContext.getModelElement().eAdapters().add(new AdapterImpl() {
+ modelElement.eAdapters().add(new AdapterImpl() {
@Override
public void notifyChanged(Notification msg) {
@@ -65,7 +62,7 @@ public class DefaultModelElementForm extends Control implements ModelElementForm
}
protected void validate() {
- Diagnostic diagnostic = Diagnostician.INSTANCE.validate(modelElementContext.getModelElement());
+ Diagnostic diagnostic = Diagnostician.INSTANCE.validate(modelElement);
for (ValidationDecoration controlDecoration : controls.values())
controlDecoration.handleValidation(diagnostic);
}
@@ -81,7 +78,6 @@ public class DefaultModelElementForm extends Control implements ModelElementForm
getChildren().add(new DecorationPane(gridPane));
gridPane.getStyleClass().add("grid");
- EObject modelElement = modelElementContext.getModelElement();
ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
AdapterFactoryItemDelegator adapterFactoryItemDelegator = new AdapterFactoryItemDelegator(adapterFactory);
@@ -104,19 +100,19 @@ public class DefaultModelElementForm extends Control implements ModelElementForm
ECPControl.Factory factory = registry.getFactory(propertyDescriptor, modelElement);
if (factory != null) {
- ECPControlBase control = factory.createControl(propertyDescriptor, modelElementContext);
+ ECPControlBase control = factory.createControl(propertyDescriptor, modelElement, editingDomain);
gridPane.add(control, 1, i);
GridPane.setHgrow(control, Priority.ALWAYS);
ValidationDecoration validationDecorator = new ValidationDecoration(control, feature);
-// DecorationUtils.install(control, validationDecorator);
+ // DecorationUtils.install(control, validationDecorator);
// AnchorPane.setLeftAnchor(control, 0.0);
// AnchorPane.setRightAnchor(control, 0.0);
//
// ControlDecoration controlDecoration = new ControlDecoration(feature, control);
- controls.put(feature, validationDecorator);
+ controls.put(feature, validationDecorator);
}
@@ -136,16 +132,16 @@ public class DefaultModelElementForm extends Control implements ModelElementForm
@Override
public void dispose() {
-// for (ControlDecoration controlDecoration : controls.values()) {
-// controlDecoration.dispose();
-// }
+ // for (ControlDecoration controlDecoration : controls.values()) {
+ // controlDecoration.dispose();
+ // }
}
public static class Factory implements ModelElementForm.Factory {
@Override
- public Node createModelElementForm(ECPControlContext modelElementContext) {
- return new DefaultModelElementForm(modelElementContext);
+ public Node createModelElementForm(EObject modelElement, EditingDomain editingDomain) {
+ return new DefaultModelElementForm(modelElement, editingDomain);
}
}
@@ -160,15 +156,15 @@ public class DefaultModelElementForm extends Control implements ModelElementForm
ImageView imageView = new ImageView(errorImage);
Label label = new Label(null, imageView);
nodeProperty().set(label);
-
+
label.setOpacity(0);
posProperty().set(Pos.TOP_LEFT);
Transition transition = AnimationUtils.createTransition(label, AnimationType.BOUNCE_IN);
-
+
transitionProperty().set(transition);
-
+
paddingProperty().set(new Insets(0));
}
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/ModelElementForm.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/ModelElementForm.java
index 5a9984807..62c34728e 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/ModelElementForm.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/ModelElementForm.java
@@ -3,7 +3,7 @@ package org.eclipse.fx.ecp.ui.form;
import javafx.scene.Node;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
+import org.eclipse.emf.edit.domain.EditingDomain;
public interface ModelElementForm {
@@ -11,7 +11,7 @@ public interface ModelElementForm {
interface Factory {
- Node createModelElementForm(ECPControlContext modelElementContext);
+ Node createModelElementForm(EObject modelElement, EditingDomain editingDomain);
interface Registry {
diff --git a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/impl/ControlFactoryRegistryImpl.java b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/impl/ControlFactoryRegistryImpl.java
index 7b617783e..30f18eeb1 100644
--- a/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/impl/ControlFactoryRegistryImpl.java
+++ b/bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/impl/ControlFactoryRegistryImpl.java
@@ -10,8 +10,8 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.fx.ecp.ui.ECPApplicableTester;
import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPStaticApplicableTester;
import org.eclipse.fx.ecp.ui.ECPControl.Factory;
+import org.eclipse.fx.ecp.ui.ECPStaticApplicableTester;
import org.osgi.framework.Bundle;
public class ControlFactoryRegistryImpl implements ECPControl.Factory.Registry {
diff --git a/demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart.java b/demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart.java
index 5e7bd4eff..9f2344b4d 100644
--- a/demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart.java
+++ b/demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart.java
@@ -10,10 +10,6 @@
*******************************************************************************/
package org.eclipse.fx.ecp;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.BorderPane;
@@ -21,15 +17,7 @@ import javax.inject.Inject;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.fx.ecp.ui.ECPControl;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
import org.eclipse.fx.ecp.ui.ModelElementEditor;
import org.eclipse.fx.ecp.ui.form.DefaultModelElementForm;
@@ -50,13 +38,14 @@ public class ModelEditorPart implements ModelElementEditor {
parent.setCenter(scrollPane);
}
- public void setInput(final ECPControlContext modelElementContext) {
- modelElement = modelElementContext.getModelElement();
+ @Override
+ public void setInput(final EObject modelElement) {
+ this.modelElement = modelElement;
if(form != null)
form.dispose();
- form = new DefaultModelElementForm(modelElementContext);
+ form = new DefaultModelElementForm(modelElement, null);
scrollPane.setContent(form);
// modelElement.eAdapters().add(new AdapterImpl() {
diff --git a/demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart2.java b/demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart2.java
index 0a888e085..09e17e5f5 100644
--- a/demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart2.java
+++ b/demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart2.java
@@ -19,7 +19,6 @@ import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Point2D;
import javafx.scene.Node;
-import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ContextMenu;
@@ -36,23 +35,22 @@ import javax.inject.Inject;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
-import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.Diagnostician;
-import org.eclipse.fx.ecp.ui.ECPControlContext;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.fx.ecp.ui.ECPUtil;
import org.eclipse.fx.ecp.ui.ModelElementEditor;
import org.eclipse.fx.ecp.ui.controls.BreadcrumbBar;
-import org.eclipse.fx.ecp.ui.controls.ControlDecoration;
import org.eclipse.fx.ecp.ui.form.DefaultModelElementForm;
import org.eclipse.fx.ecp.ui.form.ModelElementForm;
public class ModelEditorPart2 implements ModelElementEditor {
private final ScrollPane scrollPane;
- private ECPControlContext controlContext;
- private final LinkedList<ECPControlContext> prevModelElements = new LinkedList<>();
- private final LinkedList<ECPControlContext> nextModelElements = new LinkedList<>();
+ private EObject modelElement;
+ // TODO change this to weak references
+ private final LinkedList<EObject> prevModelElements = new LinkedList<>();
+ private final LinkedList<EObject> nextModelElements = new LinkedList<>();
private final Button forwardButton;
private final Button backButton;
private final BreadcrumbBar breadcrumbBar;
@@ -78,8 +76,8 @@ public class ModelEditorPart2 implements ModelElementEditor {
@Override
public void handle(ActionEvent arg0) {
- nextModelElements.push(controlContext);
- controlContext = prevModelElements.pop();
+ nextModelElements.push(modelElement);
+ modelElement = prevModelElements.pop();
if (contextMenuTimeline != null)
contextMenuTimeline.stop();
if (contextMenu != null)
@@ -136,8 +134,8 @@ public class ModelEditorPart2 implements ModelElementEditor {
@Override
public void handle(ActionEvent arg0) {
- prevModelElements.push(controlContext);
- controlContext = nextModelElements.pop();
+ prevModelElements.push(modelElement);
+ modelElement = nextModelElements.pop();
if (contextMenuTimeline != null)
contextMenuTimeline.stop();
if (contextMenu != null)
@@ -167,7 +165,7 @@ public class ModelEditorPart2 implements ModelElementEditor {
@Override
public void handle(ActionEvent arg0) {
-// validate();
+ // validate();
}
});
@@ -178,11 +176,11 @@ public class ModelEditorPart2 implements ModelElementEditor {
}
- public void setInput(final ECPControlContext modelElementContext) {
- if (controlContext != null)
- prevModelElements.push(controlContext);
+ public void setInput(EObject modelElement) {
+ if (modelElement != null)
+ prevModelElements.push(modelElement);
- controlContext = modelElementContext;
+ this.modelElement = modelElement;
nextModelElements.clear();
@@ -192,25 +190,28 @@ public class ModelEditorPart2 implements ModelElementEditor {
void updateControls() {
backButton.setDisable(prevModelElements.isEmpty());
forwardButton.setDisable(nextModelElements.isEmpty());
- breadcrumbBar.setModelElement(controlContext.getModelElement());
-
- if(modelElementForm != null)
+ breadcrumbBar.setModelElement(modelElement);
+
+ if (modelElementForm != null)
modelElementForm.dispose();
-
- modelElementForm = (DefaultModelElementForm) ModelElementForm.Factory.Registry.INSTANCE.getFactory(controlContext.getModelElement()).createModelElementForm(
- controlContext);
+
+ // TODO: add null check
+ EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(modelElement);
+
+ modelElementForm = (DefaultModelElementForm) ModelElementForm.Factory.Registry.INSTANCE.getFactory(modelElement)
+ .createModelElementForm(modelElement, editingDomain);
+
scrollPane.setContent(modelElementForm);
}
public void showContextMenu(Node node, boolean back) {
contextMenu.getItems().clear();
- List<ECPControlContext> modelElements = back ? prevModelElements : nextModelElements;
+ List<EObject> modelElements = back ? prevModelElements : nextModelElements;
for (int i = 0; i < modelElements.size(); i++) {
final int j = back ? -i - 1 : i + 1;
- ECPControlContext controlContext = modelElements.get(i);
- EObject modelElement = controlContext.getModelElement();
+ EObject modelElement = modelElements.get(i);
String text = org.eclipse.fx.ecp.ui.ECPUtil.getText(modelElement);
Node graphic = org.eclipse.fx.ecp.ui.ECPUtil.getGraphic(modelElement);
MenuItem menuItem = new MenuItem(text, graphic);
@@ -238,14 +239,14 @@ public class ModelEditorPart2 implements ModelElementEditor {
*/
private void go(int position) {
while (position < 0) {
- nextModelElements.push(controlContext);
- controlContext = prevModelElements.pop();
+ nextModelElements.push(modelElement);
+ modelElement = prevModelElements.pop();
position++;
}
while (position > 0) {
- prevModelElements.push(controlContext);
- controlContext = nextModelElements.pop();
+ prevModelElements.push(modelElement);
+ modelElement = nextModelElements.pop();
position--;
}

Back to the top