Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2012-08-27 11:30:41 +0000
committervlorenzo2012-08-27 11:30:41 +0000
commit32a1f969b61621ab9bc1a5e5c9856d008d5b7d4a (patch)
tree8b859a80c4590601a7e5b0879b883b6bd89c6886 /incoming
parent4320194f07b0f179678287522ec3f8efc3170508 (diff)
downloadorg.eclipse.papyrus-32a1f969b61621ab9bc1a5e5c9856d008d5b7d4a.tar.gz
org.eclipse.papyrus-32a1f969b61621ab9bc1a5e5c9856d008d5b7d4a.tar.xz
org.eclipse.papyrus-32a1f969b61621ab9bc1a5e5c9856d008d5b7d4a.zip
Save my work on the table common plugin
Diffstat (limited to 'incoming')
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/META-INF/MANIFEST.MF3
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/AbstractTableEditor.java2
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/factory/PapyrusTableEfacetCommandFactory.java (renamed from incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/copy/PapyrusTableEfacetCommandFactory.java)2
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/DownRowHandler.java2
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/UpRowHandler.java2
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/listener/AbstractTableTriggerListener.java26
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/listener/FillingListener.java31
7 files changed, 39 insertions, 29 deletions
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/META-INF/MANIFEST.MF
index 2fb0f6a76e7..df0a7d7876f 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/META-INF/MANIFEST.MF
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/META-INF/MANIFEST.MF
@@ -33,4 +33,5 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.infra.table.efacet.common.editor,
org.eclipse.papyrus.infra.table.efacet.common.factory,
- org.eclipse.papyrus.infra.table.efacet.common.handlers
+ org.eclipse.papyrus.infra.table.efacet.common.handlers,
+ org.eclipse.papyrus.infra.table.efacet.common.listener
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/AbstractTableEditor.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/AbstractTableEditor.java
index 369ae80e867..7c824e2bdd5 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/AbstractTableEditor.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/AbstractTableEditor.java
@@ -81,7 +81,7 @@ public class AbstractTableEditor extends AbstractPapyrusNestedEditor implements
/** the table instance */
protected PapyrusTable rawModel;
-
+
public AbstractTableEditor(final ServicesRegistry servicesRegistry, final PapyrusTable rawModel) {
super(servicesRegistry);
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/copy/PapyrusTableEfacetCommandFactory.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/factory/PapyrusTableEfacetCommandFactory.java
index 3a053bbfc16..22b89f488bb 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/copy/PapyrusTableEfacetCommandFactory.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/factory/PapyrusTableEfacetCommandFactory.java
@@ -10,7 +10,7 @@
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
*/
-package org.eclipse.papyrus.infra.table.efacet.common.copy;
+package org.eclipse.papyrus.infra.table.efacet.common.factory;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.UnexecutableCommand;
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/DownRowHandler.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/DownRowHandler.java
index efc320f574b..7de13e2ab25 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/DownRowHandler.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/DownRowHandler.java
@@ -15,7 +15,7 @@ package org.eclipse.papyrus.infra.table.efacet.common.handlers;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Row;
-import org.eclipse.papyrus.infra.table.efacet.common.copy.PapyrusTableEfacetCommandFactory;
+import org.eclipse.papyrus.infra.table.efacet.common.factory.PapyrusTableEfacetCommandFactory;
/**
*
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/UpRowHandler.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/UpRowHandler.java
index d1272feed97..f0094099362 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/UpRowHandler.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/UpRowHandler.java
@@ -15,7 +15,7 @@ package org.eclipse.papyrus.infra.table.efacet.common.handlers;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Row;
-import org.eclipse.papyrus.infra.table.efacet.common.copy.PapyrusTableEfacetCommandFactory;
+import org.eclipse.papyrus.infra.table.efacet.common.factory.PapyrusTableEfacetCommandFactory;
/**
*
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/listener/AbstractTableTriggerListener.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/listener/AbstractTableTriggerListener.java
index 3886b835e84..6cdc93283a8 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/listener/AbstractTableTriggerListener.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/listener/AbstractTableTriggerListener.java
@@ -14,6 +14,14 @@ package org.eclipse.papyrus.infra.table.efacet.common.listener;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.IFacetManagerFactory;
+import org.eclipse.emf.facet.widgets.celleditors.ICommandFactoriesRegistry;
+import org.eclipse.emf.facet.widgets.celleditors.ICommandFactory;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
+import org.eclipse.emf.facet.widgets.table.ui.command.ITableCommandFactory;
+import org.eclipse.emf.facet.widgets.table.ui.command.ITableCommandFactoryFactory;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.transaction.TriggerListener;
import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
@@ -82,4 +90,22 @@ public abstract class AbstractTableTriggerListener extends TriggerListener {
* @return the command name
*/
protected abstract String getCommandName(final Notification notification);
+
+ /**
+ *
+ * @param editingDomain
+ * the editing domain
+ * @param resourceSet
+ * the resource set
+ * @param table
+ * the table
+ * @return
+ * the command factory for these parameters
+ */
+ public static ITableCommandFactory getTableCmdFactory(final TransactionalEditingDomain editingDomain, final ResourceSet resourceSet, final Table table) {
+ final IFacetManager facetManager = IFacetManagerFactory.DEFAULT.getOrCreateFacetManager(resourceSet);
+ final ICommandFactory commandFactory = ICommandFactoriesRegistry.INSTANCE.getCommandFactoryFor(editingDomain);
+ final ITableCommandFactory tableCmdFactory = ITableCommandFactoryFactory.DEFAULT.createTableCommandFactory(table, editingDomain, commandFactory, facetManager);
+ return tableCmdFactory;
+ }
}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/listener/FillingListener.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/listener/FillingListener.java
index bead6928589..2f58b73315e 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/listener/FillingListener.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/listener/FillingListener.java
@@ -200,23 +200,6 @@ public class FillingListener extends AbstractTableTriggerListener {
return cmd;
}
- /**
- *
- * @param editingDomain
- * the editing domain
- * @param resourceSet
- * the resource set
- * @param table
- * the table
- * @return
- * the command factory for these parameters
- */
- private static ITableCommandFactory getTableCmdFactory(final TransactionalEditingDomain editingDomain, final ResourceSet resourceSet, final Table table) {
- final IFacetManager facetManager = IFacetManagerFactory.DEFAULT.getOrCreateFacetManager(resourceSet);
- final ICommandFactory commandFactory = ICommandFactoriesRegistry.INSTANCE.getCommandFactoryFor(editingDomain);
- final ITableCommandFactory tableCmdFactory = ITableCommandFactoryFactory.DEFAULT.createTableCommandFactory(table, editingDomain, commandFactory, facetManager);
- return tableCmdFactory;
- }
/**
@@ -230,13 +213,13 @@ public class FillingListener extends AbstractTableTriggerListener {
final List<EObject> toAdd = new ArrayList<EObject>();
final List<EObject> toRemove = new ArrayList<EObject>();
final IFacetManager facetManager = IFacetManagerFactory.DEFAULT.getOrCreateFacetManager(papyrusTable.eResource());
- final List<EObject> allElements = new ArrayList<EObject>();
- for(final Query current : papyrusTable.getQueries()){
+ final Set<EObject> allElements = new HashSet<EObject>();
+ for(final Query current : papyrusTable.getQueries()) {
EObject container = current.eContainer();
- if(container instanceof FacetReference){
+ if(container instanceof FacetReference) {
try {
- List<EObject> res = facetManager.getOrInvokeMultiValued(papyrusTable, (ETypedElement)container,null);
- if(res!=null){
+ List<EObject> res = facetManager.getOrInvokeMultiValued(papyrusTable, (ETypedElement)container, null);
+ if(res != null) {
allElements.addAll(res);
}
} catch (FacetManagerException e) {
@@ -244,8 +227,8 @@ public class FillingListener extends AbstractTableTriggerListener {
}
}
}
- final List<EObject> currentContent = TableContentsUtils.getTableContents(papyrusTable, papyrusTable.getTable().getContext(),false);
- final ArrayList<EObject> newValue = new ArrayList<EObject>((List<EObject>)allElements);
+ final List<EObject> currentContent = TableContentsUtils.getTableContents(papyrusTable, papyrusTable.getTable().getContext(), false);
+ final ArrayList<EObject> newValue = new ArrayList<EObject>((Set<EObject>)allElements);
//fill the add list
toAdd.addAll(newValue);

Back to the top