Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2013-05-29 08:19:35 +0000
committercletavernie2013-05-29 08:19:35 +0000
commit479dffe392ccc8c9167818c0e700c1e2f2e760ac (patch)
tree4614753d4cc783550154fd1c646d01faffe3904a /sandbox
parent5849b2eecde3badafe67c0b391e003118feff633 (diff)
downloadorg.eclipse.papyrus-479dffe392ccc8c9167818c0e700c1e2f2e760ac.tar.gz
org.eclipse.papyrus-479dffe392ccc8c9167818c0e700c1e2f2e760ac.tar.xz
org.eclipse.papyrus-479dffe392ccc8c9167818c0e700c1e2f2e760ac.zip
406896: [Properties View - Table] The new Table widget shall be integrated in the properties view as a Property Editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=406896
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/org.eclipse.papyrus.views.properties.table/META-INF/MANIFEST.MF6
-rw-r--r--sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/axis/DerivedUMLPropertiesAxisManager.java14
-rw-r--r--sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/axis/SynchronizedFeatureValueAxisManager.java29
3 files changed, 48 insertions, 1 deletions
diff --git a/sandbox/org.eclipse.papyrus.views.properties.table/META-INF/MANIFEST.MF b/sandbox/org.eclipse.papyrus.views.properties.table/META-INF/MANIFEST.MF
index ce6a76f0a1c..448b79589ef 100644
--- a/sandbox/org.eclipse.papyrus.views.properties.table/META-INF/MANIFEST.MF
+++ b/sandbox/org.eclipse.papyrus.views.properties.table/META-INF/MANIFEST.MF
@@ -23,6 +23,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.emf.edit;bundle-version="2.9.0",
org.eclipse.uml2.uml;bundle-version="4.1.0",
org.eclipse.papyrus.uml.tools;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.0"
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.0",
+ org.eclipse.emf.transaction;bundle-version="1.4.0",
+ org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.7.0",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
diff --git a/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/axis/DerivedUMLPropertiesAxisManager.java b/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/axis/DerivedUMLPropertiesAxisManager.java
index f0d4baf434f..aa5cab2eff1 100644
--- a/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/axis/DerivedUMLPropertiesAxisManager.java
+++ b/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/axis/DerivedUMLPropertiesAxisManager.java
@@ -13,6 +13,8 @@
*****************************************************************************/
package org.eclipse.papyrus.views.properties.table.axis;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager;
/**
@@ -37,4 +39,16 @@ public class DerivedUMLPropertiesAxisManager extends AbstractAxisManager {
return false;
}
+ public boolean canEditAxisHeader() {
+ return true;
+ }
+
+ public boolean canDestroyAxisElement(Integer axisIndex) {
+ return false;
+ }
+
+ public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) {
+ return null;
+ }
+
}
diff --git a/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/axis/SynchronizedFeatureValueAxisManager.java b/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/axis/SynchronizedFeatureValueAxisManager.java
index 85504120212..5279d4a8e7c 100644
--- a/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/axis/SynchronizedFeatureValueAxisManager.java
+++ b/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/axis/SynchronizedFeatureValueAxisManager.java
@@ -17,10 +17,19 @@ import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractSynchronizedOnFeatureAxisManager;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.EObjectAxis;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.EStructuralFeatureValueFillingConfiguration;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.IAxisConfiguration;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
/**
*
@@ -50,4 +59,24 @@ public class SynchronizedFeatureValueAxisManager extends AbstractSynchronizedOnF
return result;
}
+ public boolean canDestroyAxisElement(Integer axisIndex) {
+ return true;
+ }
+
+ public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) {
+ final Object current = getElements().get(axisPosition);
+ EObject elementToDestroy = null;
+ if(current instanceof EObjectAxis) {
+ elementToDestroy = ((EObjectAxis)current).getElement();
+ } else if(current instanceof EObject) {
+ elementToDestroy = (EObject)current;
+ }
+ if(elementToDestroy != null) {
+ final DestroyElementRequest request = new DestroyElementRequest((TransactionalEditingDomain)getContextEditingDomain(), elementToDestroy, false);
+ final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(elementToDestroy);
+ return new GMFtoEMFCommandWrapper(provider.getEditCommand(request));
+ }
+ return null;
+ }
+
}

Back to the top