diff options
author | Henrik Rentz-Reichert | 2011-04-01 10:44:47 +0000 |
---|---|---|
committer | Henrik Rentz-Reichert | 2011-04-01 10:44:47 +0000 |
commit | ec17d289a9aed6e6f056826d35be2a2b13003935 (patch) | |
tree | af88460d8592a7b8589fecf9780a235e4c531e75 | |
parent | b876e657a928f1ffea78f7db6d103f0ed4a1a80c (diff) | |
download | org.eclipse.etrice-ec17d289a9aed6e6f056826d35be2a2b13003935.tar.gz org.eclipse.etrice-ec17d289a9aed6e6f056826d35be2a2b13003935.tar.xz org.eclipse.etrice-ec17d289a9aed6e6f056826d35be2a2b13003935.zip |
ui.behavior: using hasDoneChanges() for PropertyFeature
3 files changed, 25 insertions, 12 deletions
diff --git a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/StateSupport.java b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/StateSupport.java index 30180fe1e..ba445282a 100644 --- a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/StateSupport.java +++ b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/StateSupport.java @@ -321,6 +321,8 @@ public class StateSupport { private static class PropertyFeature extends AbstractCustomFeature {
+ private boolean doneChanges = false;
+
public PropertyFeature(IFeatureProvider fp) {
super(fp);
}
@@ -354,10 +356,9 @@ public class StateSupport { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
StatePropertyDialog dlg = new StatePropertyDialog(shell, s);
if (dlg.open()!=Window.OK)
- // TODOHRR: introduce a method to revert changes
- throw new RuntimeException();
-// return;
-
+ return;
+
+ doneChanges = true;
updateFigure(s, context);
}
@@ -377,6 +378,10 @@ public class StateSupport { }
+ @Override
+ public boolean hasDoneChanges() {
+ return doneChanges;
+ }
}
private static class GoDownFeature extends AbstractCustomFeature implements
diff --git a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/TrPointSupport.java b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/TrPointSupport.java index 884573879..3058b9bba 100644 --- a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/TrPointSupport.java +++ b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/TrPointSupport.java @@ -453,6 +453,7 @@ public class TrPointSupport { private String name;
private String description;
+ private boolean doneChanges = false;
public PropertyFeature(IFeatureProvider fp) {
super(fp);
@@ -491,15 +492,18 @@ public class TrPointSupport { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
TrPointPropertyDialog dlg = new TrPointPropertyDialog(shell, tp, subtp);
if (dlg.open()!=Window.OK)
- // TODOHRR: introduce a method to revert changes, does hasDoneChanges=false roll back changes?
- throw new RuntimeException();
-// return;
-
+ return;
+
+ doneChanges = true;
String kind = getItemKind(tp);
Graphiti.getPeService().setPropertyValue(pe, PROP_KIND, kind);
updateTrPointFigure(tp, pe, manageColor(DARK_COLOR), manageColor(BRIGHT_COLOR));
}
+ @Override
+ public boolean hasDoneChanges() {
+ return doneChanges;
+ }
}
private class UpdateFeature extends AbstractUpdateFeature {
diff --git a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/TransitionSupport.java b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/TransitionSupport.java index 569f3c4b3..a13202aa2 100644 --- a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/TransitionSupport.java +++ b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/TransitionSupport.java @@ -434,6 +434,7 @@ public class TransitionSupport { private String name;
private String description;
+ private boolean doneChanges = false;
public PropertyFeature(IFeatureProvider fp) {
super(fp);
@@ -480,13 +481,16 @@ public class TransitionSupport { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
TransitionPropertyDialog dlg = new TransitionPropertyDialog(shell, sg, trans);
if (dlg.open()!=Window.OK)
- // TODOHRR: introduce a method to revert changes, does hasDoneChanges=false roll back changes?
- throw new RuntimeException();
-// return;
-
+ return;
+
+ doneChanges = true;
updateLabel(trans, (Connection) pe);
}
+ @Override
+ public boolean hasDoneChanges() {
+ return doneChanges;
+ }
}
private IFeatureProvider fp;
|