Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2012-08-22 08:19:41 -0400
committervlorenzo2012-08-22 08:19:41 -0400
commit1112ce4a7508e792eafc90b5d4c498c075e09fec (patch)
treeef1774517ee456b529cd3952a4c187bd7f83dd68
parent53f9b3328753eda87ea7b05eef9d7c95291888b7 (diff)
downloadorg.eclipse.papyrus-1112ce4a7508e792eafc90b5d4c498c075e09fec.tar.gz
org.eclipse.papyrus-1112ce4a7508e792eafc90b5d4c498c075e09fec.tar.xz
org.eclipse.papyrus-1112ce4a7508e792eafc90b5d4c498c075e09fec.zip
A save of my work on the new tables
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/NatTableEditor2.java5
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java2
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractMoveRowHandler.java21
3 files changed, 9 insertions, 19 deletions
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/NatTableEditor2.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/NatTableEditor2.java
index 5f2cf45e1e9..6457b205edc 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/NatTableEditor2.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/NatTableEditor2.java
@@ -27,7 +27,6 @@ import java.util.HashMap;
import org.eclipse.core.databinding.conversion.IConverter;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
@@ -45,8 +44,6 @@ import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidget;
import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidgetFactory;
import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidgetProvider;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.TriggerListener;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.ISelection;
@@ -136,7 +133,7 @@ public class NatTableEditor2 extends EditorPart implements ISelectionProvider, I
};
}
if(adapter == PapyrusTable.class) {
- this.natTableWidget.getTable().eContainer();
+ return this.natTableWidget.getTable().eContainer();
} else if(adapter == Table.class) {
return this.natTableWidget.getTable();
}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java
index 041f5d0e89c..4db8d7cc129 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java
@@ -256,14 +256,12 @@ public abstract class AbstractCreateTableEditorHandler extends AbstractHandler {
/** label provider for EMF objects */
final ILabelProvider labelProvider = new AdapterFactoryLabelProvider(factory);
- System.out.println(labelProvider.getText(papyrusTable));;
if(papyrusTable.isUsingContextFeature() && papyrusTable.getContextFeature() != null) { //TODO : verify that the context owns the wanted feature
final boolean isDerived = papyrusTable.getContextFeature().isDerived();
final EReference ref = papyrusTable.getContextFeature();
final EGenericType genericTtype = ref.getEGenericType();
final EList<EObject> cross = ref.eCrossReferences();
- System.out.println(isDerived);
getTableContext().eAdapters().add(new AdapterImpl() {
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractMoveRowHandler.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractMoveRowHandler.java
index ebfc76a2aae..c2278fa7c29 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractMoveRowHandler.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractMoveRowHandler.java
@@ -12,8 +12,6 @@
*/
package org.eclipse.papyrus.infra.table.efacet.common.handlers;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import org.eclipse.core.commands.AbstractHandler;
@@ -21,9 +19,8 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
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.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
-import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidget;
+import org.eclipse.emf.facet.widgets.table.ui.ITableWidget;
import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidgetProvider;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor;
@@ -32,6 +29,8 @@ import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
+//import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidget;
+
/**
*
* the abstract class for the move line handler
@@ -56,9 +55,6 @@ public abstract class AbstractMoveRowHandler extends AbstractHandler {
//we set the old row selection
final ITableWidget widget = getTableWidget();
-
- final List<EObject> toSelect = new ArrayList<EObject>();
-
widget.selectRows(selectedRows, true);
}
return null;
@@ -82,12 +78,8 @@ public abstract class AbstractMoveRowHandler extends AbstractHandler {
* a list of the selected rows
*/
protected List<EObject> getSelectedRowEObject() {
- final List<Row> rows = new ArrayList<Row>();
final ITableWidget widget = getTableWidget();
- if(widget instanceof org.eclipse.emf.facet.widgets.table.ui.ITableWidget) {
- return ((org.eclipse.emf.facet.widgets.table.ui.ITableWidget)widget).getSelectedRowEObjects();
- }
- return Collections.EMPTY_LIST;
+ return widget.getSelectedRowEObjects();
}
/**
@@ -117,7 +109,10 @@ public abstract class AbstractMoveRowHandler extends AbstractHandler {
if(editor != null) {
final ITableWidgetProvider provider = (ITableWidgetProvider)editor.getAdapter(ITableWidgetProvider.class);
if(provider != null) {
- return provider.getTableWidget();
+ final Object widget = provider.getTableWidget();
+ if(widget instanceof ITableWidget) {
+ return (ITableWidget)widget;
+ }
}
}
return null;

Back to the top