diff options
author | vlorenzo | 2012-02-07 15:18:02 +0000 |
---|---|---|
committer | vlorenzo | 2012-02-07 15:18:02 +0000 |
commit | 99dcf296a950202790351888e46ff27e6ae5410a (patch) | |
tree | 3fb0226968537aac0916de0574f646d4682d8a40 | |
parent | fd106cc6b6374330fa8f280f4d761911be6fdb9c (diff) | |
download | org.eclipse.papyrus-99dcf296a950202790351888e46ff27e6ae5410a.tar.gz org.eclipse.papyrus-99dcf296a950202790351888e46ff27e6ae5410a.tar.xz org.eclipse.papyrus-99dcf296a950202790351888e46ff27e6ae5410a.zip |
369208: [Table Editor] bug with synchronized table : moving element listed in a table doesn't update the table
https://bugs.eclipse.org/bugs/show_bug.cgi?id=369208
-rw-r--r-- | plugins/uml/org.eclipse.papyrus.table.common/src/org/eclipse/papyrus/table/common/listener/ModelTriggerListener.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.table.common/src/org/eclipse/papyrus/table/common/listener/ModelTriggerListener.java b/plugins/uml/org.eclipse.papyrus.table.common/src/org/eclipse/papyrus/table/common/listener/ModelTriggerListener.java index 5166435d2a2..d33d33603ee 100644 --- a/plugins/uml/org.eclipse.papyrus.table.common/src/org/eclipse/papyrus/table/common/listener/ModelTriggerListener.java +++ b/plugins/uml/org.eclipse.papyrus.table.common/src/org/eclipse/papyrus/table/common/listener/ModelTriggerListener.java @@ -17,6 +17,7 @@ import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.facet.widgets.nattable.INatTableWidgetProvider;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.sashwindows.di.TabFolder;
import org.eclipse.papyrus.table.instance.papyrustableinstance.PapyrusTableInstance;
/**
@@ -32,7 +33,7 @@ public class ModelTriggerListener extends AbstractSynchronizedTableTriggerListen *
* @param table
* the table
- * @param provider
+ * @param prov<ider
* the nattable widget provider
*/
public ModelTriggerListener(final PapyrusTableInstance table, final INatTableWidgetProvider provider) {
@@ -52,14 +53,21 @@ public class ModelTriggerListener extends AbstractSynchronizedTableTriggerListen @Override
protected Command trigger(TransactionalEditingDomain domain, Notification notification) {
-
+
Command cmd = null;
-
+
Object notifier = notification.getNotifier();
- if(notifier instanceof org.eclipse.uml2.uml.Element) {
+ int eventType = notification.getEventType();
+ if(notifier instanceof TabFolder) {
+ switch(eventType) {
+ case Notification.ADD:
+ cmd = getSynchronizationCommand(domain); //update the contents of the table when we open the table (bug 369208)
+ default:
+ break;
+ }
+ } else if(notifier instanceof org.eclipse.uml2.uml.Element) {
if(this.papyrusTable.isIsSynchronized()) {
- int eventType = notification.getEventType();
//we can't do a test on the element which provide the notification, because each action on the model can change the result of the query
switch(eventType) {
case Notification.SET:
@@ -68,7 +76,6 @@ public class ModelTriggerListener extends AbstractSynchronizedTableTriggerListen case Notification.REMOVE:
case Notification.ADD_MANY:
case Notification.REMOVE_MANY:
- System.out.println(notification);
cmd = getSynchronizationCommand(domain);
default:
break;
|