Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorsten Sommer2013-07-16 12:16:19 -0400
committerTorsten Sommer2013-07-16 12:16:19 -0400
commitac71604cff5b8bfb0124d5c63d9757c20ad0f3b2 (patch)
treeca84bd0bbd4330fe181c3b215654492f495788c3
parentd502ca49abce8d2f9458f7e33611399de461ce86 (diff)
downloadorg.eclipse.efxclipse-ac71604cff5b8bfb0124d5c63d9757c20ad0f3b2.tar.gz
org.eclipse.efxclipse-ac71604cff5b8bfb0124d5c63d9757c20ad0f3b2.tar.xz
org.eclipse.efxclipse-ac71604cff5b8bfb0124d5c63d9757c20ad0f3b2.zip
Model element opener added to create()
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/ECPControl.java2
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CharacterField.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/CheckBoxControl.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/DateControl.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/EnumChoiceBox.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/ReferenceControl.java14
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/TextFieldControl.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/multi/MultiControl.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigDecimalSpinner.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/BigIntegerSpinner.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleField.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/DoubleSpinner.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/FloatSpinner.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/IntegerSpinner.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/LongSpinner.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/controls/numeric/ShortSpinner.java3
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/DefaultModelElementForm.java12
-rw-r--r--bundles/runtime/org.eclipse.fx.ecp.ui/src/org/eclipse/fx/ecp/ui/form/ModelElementForm.java3
-rw-r--r--demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart.java47
-rw-r--r--demos/org.eclipse.fx.ecp.app/src/org/eclipse/fx/ecp/ModelEditorPart2.java7
20 files changed, 75 insertions, 52 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 2f9a4811c..a0354724b 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
@@ -14,7 +14,7 @@ public interface ECPControl {
interface Factory {
- ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain);
+ ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener);
interface Descriptor {
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 c0a5a62f3..002b92db1 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
@@ -15,6 +15,7 @@ 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.ECPModelElementOpener;
public class CharacterField extends ECPControlBase {
@@ -104,7 +105,7 @@ public class CharacterField extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor propertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor propertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
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 a6a9cca19..4df1920c7 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
@@ -9,6 +9,7 @@ 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.ECPModelElementOpener;
import org.eclipse.fx.emf.databinding.edit.EMFEditFXProperties;
public class CheckBoxControl extends ECPControlBase {
@@ -54,7 +55,7 @@ public class CheckBoxControl extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
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 32686b873..987697a9d 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
@@ -15,6 +15,7 @@ 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.ECPModelElementOpener;
public class DateControl extends ECPControlBase {
@@ -74,7 +75,7 @@ public class DateControl extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
return new DateControl(itemPropertyDescriptor, modelElement, editingDomain);
}
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 da6bcb465..cdad9ed4e 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
@@ -20,6 +20,7 @@ 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.ECPModelElementOpener;
public class EnumChoiceBox extends ECPControlBase {
@@ -99,7 +100,7 @@ public class EnumChoiceBox extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
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 0a1c98244..8288f7d32 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
@@ -23,6 +23,7 @@ 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.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.ECPUtil;
import org.eclipse.fx.emf.edit.ui.dnd.LocalTransfer;
@@ -38,7 +39,7 @@ public class ReferenceControl extends ECPControlBase {
protected Command unsetCommand;
protected Label label;
- public ReferenceControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain) {
+ public ReferenceControl(IItemPropertyDescriptor propertyDescriptor, final EObject modelElement, final EditingDomain editingDomain, final ECPModelElementOpener modelElementOpener) {
super(propertyDescriptor, modelElement, editingDomain);
reference = (EReference) feature;
@@ -47,11 +48,10 @@ public class ReferenceControl extends ECPControlBase {
hyperlink.setOnAction(new EventHandler<ActionEvent>() {
@Override
- public void handle(ActionEvent arg0) {
+ public void handle(ActionEvent event) {
Object value = modelElement.eGet(reference);
- // TODO change this to model element opener
-// if (value instanceof EObject)
-// context.openInNewContext((EObject) value);
+ if (value instanceof EObject)
+ modelElementOpener.openModelElement((EObject) value);
}
});
@@ -172,8 +172,8 @@ public class ReferenceControl extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
- return new ReferenceControl(itemPropertyDescriptor, modelElement, editingDomain);
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
+ return new ReferenceControl(itemPropertyDescriptor, modelElement, editingDomain, modelElementOpener);
}
}
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 ea392942e..85eb6c301 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
@@ -15,6 +15,7 @@ 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.ECPModelElementOpener;
public class TextFieldControl extends ECPControlBase {
@@ -73,7 +74,7 @@ public class TextFieldControl extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
return new TextFieldControl(itemPropertyDescriptor, modelElement, editingDomain);
}
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 abba8ca2d..a605a43db 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
@@ -27,6 +27,7 @@ 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.ECPControl;
+import org.eclipse.fx.ecp.ui.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.ECPUIPlugin;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
import org.eclipse.fx.emf.edit.ui.dnd.LocalTransfer;
@@ -205,7 +206,7 @@ public class MultiControl extends ECPControlBase {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
return new MultiControl(itemPropertyDescriptor, modelElement, editingDomain);
}
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 32bef6e1b..67735fd09 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
@@ -6,6 +6,7 @@ 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.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
@@ -62,7 +63,7 @@ public class BigDecimalSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
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 86b601f0a..8831e892a 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
@@ -6,6 +6,7 @@ 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.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class BigIntegerSpinner extends NumberSpinner {
@@ -59,7 +60,7 @@ public class BigIntegerSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
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 b7febe6e9..1197ed97d 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
@@ -15,6 +15,7 @@ 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.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class DoubleField extends ECPControlBase implements ECPControl {
@@ -94,7 +95,7 @@ public class DoubleField extends ECPControlBase implements ECPControl {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
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 02de3a986..13c89893c 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
@@ -4,6 +4,7 @@ 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.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class DoubleSpinner extends NumberSpinner {
@@ -57,7 +58,7 @@ public class DoubleSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
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 6acfc2442..089574799 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
@@ -4,6 +4,7 @@ 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.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class FloatSpinner extends NumberSpinner {
@@ -57,7 +58,7 @@ public class FloatSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
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 c8e7f9dd9..2134a5228 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
@@ -4,6 +4,7 @@ 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.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class IntegerSpinner extends NumberSpinner {
@@ -58,7 +59,7 @@ public class IntegerSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
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 687c837b5..b9dca1da3 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
@@ -4,6 +4,7 @@ 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.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class LongSpinner extends NumberSpinner {
@@ -58,7 +59,7 @@ public class LongSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
return new LongSpinner(itemPropertyDescriptor, modelElement, editingDomain);
}
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 ca0a86582..fdf175711 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
@@ -4,6 +4,7 @@ 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.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class ShortSpinner extends NumberSpinner {
@@ -60,7 +61,7 @@ public class ShortSpinner extends NumberSpinner {
public static class Factory implements ECPControl.Factory {
@Override
- public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain) {
+ public ECPControlBase createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
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 c4db9976d..f5012b1e1 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
@@ -34,6 +34,7 @@ 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.ECPControl.Factory.Registry;
+import org.eclipse.fx.ecp.ui.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.controls.ECPControlBase;
public class DefaultModelElementForm extends Control implements ModelElementForm {
@@ -42,10 +43,13 @@ public class DefaultModelElementForm extends Control implements ModelElementForm
protected final EObject modelElement;
protected final EditingDomain editingDomain;
+ protected final ECPModelElementOpener modelElementOpener;
- public DefaultModelElementForm(EObject modelElement, EditingDomain editingDomain) {
+ public DefaultModelElementForm(EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
this.modelElement = modelElement;
this.editingDomain = editingDomain;
+ this.modelElementOpener = modelElementOpener;
+
setSkin(new Skin(this));
getStyleClass().add("model-element-form");
@@ -100,7 +104,7 @@ public class DefaultModelElementForm extends Control implements ModelElementForm
ECPControl.Factory factory = registry.getFactory(propertyDescriptor, modelElement);
if (factory != null) {
- ECPControlBase control = factory.createControl(propertyDescriptor, modelElement, editingDomain);
+ ECPControlBase control = factory.createControl(propertyDescriptor, modelElement, editingDomain, modelElementOpener);
gridPane.add(control, 1, i);
GridPane.setHgrow(control, Priority.ALWAYS);
@@ -140,8 +144,8 @@ public class DefaultModelElementForm extends Control implements ModelElementForm
public static class Factory implements ModelElementForm.Factory {
@Override
- public Node createModelElementForm(EObject modelElement, EditingDomain editingDomain) {
- return new DefaultModelElementForm(modelElement, editingDomain);
+ public Node createModelElementForm(EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener) {
+ return new DefaultModelElementForm(modelElement, editingDomain, modelElementOpener);
}
}
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 62c34728e..8d73b4a4d 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
@@ -4,6 +4,7 @@ import javafx.scene.Node;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.fx.ecp.ui.ECPModelElementOpener;
public interface ModelElementForm {
@@ -11,7 +12,7 @@ public interface ModelElementForm {
interface Factory {
- Node createModelElementForm(EObject modelElement, EditingDomain editingDomain);
+ Node createModelElementForm(EObject modelElement, EditingDomain editingDomain, ECPModelElementOpener modelElementOpener);
interface 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 9f2344b4d..11fb198be 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
@@ -41,35 +41,36 @@ public class ModelEditorPart implements ModelElementEditor {
@Override
public void setInput(final EObject modelElement) {
this.modelElement = modelElement;
-
- if(form != null)
+
+ if (form != null)
form.dispose();
- form = new DefaultModelElementForm(modelElement, null);
+ form = new DefaultModelElementForm(modelElement, null, null);
scrollPane.setContent(form);
-// modelElement.eAdapters().add(new AdapterImpl() {
-//
-// @Override
-// public void notifyChanged(Notification msg) {
-// update();
-// }
-//
-// });
+ // modelElement.eAdapters().add(new AdapterImpl() {
+ //
+ // @Override
+ // public void notifyChanged(Notification msg) {
+ // update();
+ // }
+ //
+ // });
-// update();
+ // update();
}
-// public void update() {
-// IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory.adapt(modelElement, IItemLabelProvider.class);
-// if (labelProvider != null) {
-// part.setLabel(labelProvider.getText(modelElement));
-// Object image = labelProvider.getImage(modelElement);
-// if (image instanceof URL)
-// part.setIconURI(((URL) image).toExternalForm());
-// } else {
-// part.setLabel("Model Editor");
-// }
-// }
+ // public void update() {
+ // IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory.adapt(modelElement,
+ // IItemLabelProvider.class);
+ // if (labelProvider != null) {
+ // part.setLabel(labelProvider.getText(modelElement));
+ // Object image = labelProvider.getImage(modelElement);
+ // if (image instanceof URL)
+ // part.setIconURI(((URL) image).toExternalForm());
+ // } else {
+ // part.setLabel("Model Editor");
+ // }
+ // }
}
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 09e17e5f5..a83c53116 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
@@ -38,6 +38,7 @@ import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.fx.ecp.ui.ECPModelElementOpener;
import org.eclipse.fx.ecp.ui.ECPUtil;
import org.eclipse.fx.ecp.ui.ModelElementEditor;
import org.eclipse.fx.ecp.ui.controls.BreadcrumbBar;
@@ -57,9 +58,11 @@ public class ModelEditorPart2 implements ModelElementEditor {
private final ContextMenu contextMenu = new ContextMenu();
private Timeline contextMenuTimeline;
private DefaultModelElementForm modelElementForm;
+ private final ECPModelElementOpener modelElementOpener;
@Inject
- public ModelEditorPart2(BorderPane parent, final MApplication application, MPart part) {
+ public ModelEditorPart2(BorderPane parent, final MApplication application, MPart part, ECPModelElementOpener modelElementOpener) {
+ this.modelElementOpener = modelElementOpener;
scrollPane = new ScrollPane();
parent.setCenter(scrollPane);
scrollPane.setFitToWidth(true);
@@ -199,7 +202,7 @@ public class ModelEditorPart2 implements ModelElementEditor {
EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(modelElement);
modelElementForm = (DefaultModelElementForm) ModelElementForm.Factory.Registry.INSTANCE.getFactory(modelElement)
- .createModelElementForm(modelElement, editingDomain);
+ .createModelElementForm(modelElement, editingDomain, modelElementOpener);
scrollPane.setContent(modelElementForm);
}

Back to the top