Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2013-05-16 12:01:04 +0000
committervlorenzo2013-05-16 12:01:04 +0000
commitaec5d36623e48769493d5ec5c9fc5a07ff271eec (patch)
treea0f5df3cfdaa5daf48e550c0d0f6e13e8f03cbfe /sandbox
parent9c077de73c10ca930d16663ca97ccadaf9ebd293 (diff)
downloadorg.eclipse.papyrus-aec5d36623e48769493d5ec5c9fc5a07ff271eec.tar.gz
org.eclipse.papyrus-aec5d36623e48769493d5ec5c9fc5a07ff271eec.tar.xz
org.eclipse.papyrus-aec5d36623e48769493d5ec5c9fc5a07ff271eec.zip
400782: [Table 2] Tabular Editor must allow to add/remove axis (columns or rows)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=400782 Add the management of the axis inversion
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLFeatureAxisManager.java2
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java2
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/UMLFeatureRestrictedContentProvider.java16
3 files changed, 18 insertions, 2 deletions
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLFeatureAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLFeatureAxisManager.java
index bc3df145817..f8d6c2cd0ce 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLFeatureAxisManager.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLFeatureAxisManager.java
@@ -33,7 +33,7 @@ public class UMLFeatureAxisManager extends EStructuralFeatureAxisManager {
}
@Override
- public IRestrictedContentProvider createDestroyColumnsContentProvider(boolean isRestricted) {
+ public IRestrictedContentProvider createPossibleAxisContentProvider(boolean isRestricted) {
return new UMLFeatureRestrictedContentProvider(this, isRestricted);
}
}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java
index 3d4feb84a2e..06136e87b4d 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java
@@ -165,7 +165,7 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager {
* return the content provider for the stereotypes properties
*/
@Override
- public IRestrictedContentProvider createDestroyColumnsContentProvider(boolean isRestricted) {
+ public IRestrictedContentProvider createPossibleAxisContentProvider(boolean isRestricted) {
AbstractAxisProvider secondAxis = ((INattableModelManager)getTableManager()).getHorizontalAxisProvider();
if(secondAxis == getRepresentedContentProvider()) {
secondAxis = ((INattableModelManager)getTableManager()).getVerticalAxisProvider();
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/UMLFeatureRestrictedContentProvider.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/UMLFeatureRestrictedContentProvider.java
index 34465a8c05c..ddd51702ae3 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/UMLFeatureRestrictedContentProvider.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/UMLFeatureRestrictedContentProvider.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.EObjectAxis;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisprovider.AbstractAxisProvider;
import org.eclipse.papyrus.infra.widgets.providers.AbstractRestrictedContentProvider;
import org.eclipse.papyrus.uml.nattable.manager.axis.UMLFeatureAxisManager;
@@ -43,6 +44,18 @@ public class UMLFeatureRestrictedContentProvider extends AbstractRestrictedConte
return elementsToShow.toArray();
}
+ protected AbstractAxisProvider getManagedAxisProvider() {
+ return this.umlFeatureAxisManager.getRepresentedContentProvider();
+ }
+
+ protected AbstractAxisProvider getSecondAxisProvider() {
+ AbstractAxisProvider secondAxisProvider = this.umlFeatureAxisManager.getTableManager().getVerticalAxisProvider();
+ if(secondAxisProvider == this.umlFeatureAxisManager) {
+ secondAxisProvider = this.umlFeatureAxisManager.getTableManager().getHorizontalAxisProvider();
+ }
+ return secondAxisProvider;
+ }
+
public Object[] getChildren(Object parentElement) {
List<Object> asList = new ArrayList<Object>();
if(parentElement instanceof EClass) {
@@ -62,6 +75,9 @@ public class UMLFeatureRestrictedContentProvider extends AbstractRestrictedConte
for(Object object : elementsList) {
if(object instanceof EObject) {
EObject eObject = (EObject)object;
+ if(eObject instanceof EObjectAxis) {
+ eObject = ((EObjectAxis)eObject).getElement();
+ }
EClass eClass = eObject.eClass();
eClassifiers.add(eClass);
eClassifiers.addAll(eClass.getEAllSuperTypes());

Back to the top