Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2013-07-10 12:44:21 +0000
committervlorenzo2013-07-10 12:44:21 +0000
commit8d083ddf6e900f4a03dd35a5479248e0f971338c (patch)
tree4fbd6ee9892ab9512e5d77caf1ed0783eea882e9 /sandbox
parent4f08333f5f1c8549afe6b8cf4f888241c53bc82f (diff)
downloadorg.eclipse.papyrus-8d083ddf6e900f4a03dd35a5479248e0f971338c.tar.gz
org.eclipse.papyrus-8d083ddf6e900f4a03dd35a5479248e0f971338c.tar.xz
org.eclipse.papyrus-8d083ddf6e900f4a03dd35a5479248e0f971338c.zip
401764: [Table 2] The classes managing the table model and Nattable must be refactored
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401764
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/cell/DerivedUMLPropertiesCellManager.java17
-rw-r--r--sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/providers/DerivedUMLPropertiesLabelProvider.java15
2 files changed, 17 insertions, 15 deletions
diff --git a/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/cell/DerivedUMLPropertiesCellManager.java b/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/cell/DerivedUMLPropertiesCellManager.java
index 9f8ac002464..d2dbfa4a755 100644
--- a/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/cell/DerivedUMLPropertiesCellManager.java
+++ b/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/cell/DerivedUMLPropertiesCellManager.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager;
import org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.FeatureIdAxis;
import org.eclipse.papyrus.uml.tools.commands.SetMultiplicityCommand;
import org.eclipse.papyrus.uml.tools.util.MultiplicityParser;
@@ -31,8 +32,8 @@ public class DerivedUMLPropertiesCellManager extends AbstractCellManager impleme
/**
* {@inheritDoc}
*/
- public boolean handles(Object obj1, Object obj2) {
- return getMultiplicityElement(obj1, obj2) != null && getMultiplicityHandler(obj1, obj2) != null;
+ public boolean handles(Object columnElement, Object rowElement) {
+ return getMultiplicityElement(columnElement, rowElement) != null && getMultiplicityHandler(columnElement, rowElement) != null;
}
/**
@@ -45,8 +46,8 @@ public class DerivedUMLPropertiesCellManager extends AbstractCellManager impleme
/**
* {@inheritDoc}
*/
- public Object getValue(Object axisElement1, Object axisElement2) {
- MultiplicityElement element = getMultiplicityElement(axisElement1, axisElement2);
+ public Object getValue(Object columnElement, Object rowElement, INattableModelManager tableManager) {
+ MultiplicityElement element = getMultiplicityElement(columnElement, rowElement);
if(element == null) {
return null;
}
@@ -62,16 +63,16 @@ public class DerivedUMLPropertiesCellManager extends AbstractCellManager impleme
/**
* {@inheritDoc}
*/
- public boolean isCellEditable(Object obj1, Object obj2) {
- return getMultiplicityElement(obj1, obj2) != null;
+ public boolean isCellEditable(Object columnElement, Object rowElement) {
+ return getMultiplicityElement(columnElement, rowElement) != null;
}
/**
* {@inheritDoc}
*/
- public Command getSetValueCommand(EditingDomain domain, Object obj1, Object obj2, Object newValue) {
+ public Command getSetValueCommand(EditingDomain domain, Object columnElement, Object rowElemenet, Object newValue) {
- MultiplicityElement element = getMultiplicityElement(obj1, obj2);
+ MultiplicityElement element = getMultiplicityElement(columnElement, rowElemenet);
if(element == null) {
return null;
diff --git a/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/providers/DerivedUMLPropertiesLabelProvider.java b/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/providers/DerivedUMLPropertiesLabelProvider.java
index 792759c795a..211c61120ef 100644
--- a/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/providers/DerivedUMLPropertiesLabelProvider.java
+++ b/sandbox/org.eclipse.papyrus.views.properties.table/src/org/eclipse/papyrus/views/properties/table/providers/DerivedUMLPropertiesLabelProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,7 +15,7 @@ package org.eclipse.papyrus.views.properties.table.providers;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.IdAxis;
-import org.eclipse.papyrus.infra.nattable.utils.LabelProviderCellContextElement;
+import org.eclipse.papyrus.infra.nattable.utils.LabelProviderCellContextElementWrapper;
import org.eclipse.papyrus.infra.services.labelprovider.service.IFilteredLabelProvider;
import org.eclipse.papyrus.views.properties.table.axis.DerivedUMLPropertiesAxisManager;
import org.eclipse.swt.graphics.Image;
@@ -23,9 +23,10 @@ import org.eclipse.swt.graphics.Image;
public class DerivedUMLPropertiesLabelProvider extends LabelProvider implements IFilteredLabelProvider {
- public boolean accept(Object element) {
- if(element instanceof LabelProviderCellContextElement) {
- Object object = ((LabelProviderCellContextElement)element).getObject();
+ @Override
+ public boolean accept(final Object element) {
+ if(element instanceof LabelProviderCellContextElementWrapper) {
+ Object object = ((LabelProviderCellContextElementWrapper)element).getObject();
if(object instanceof IdAxis) {
String id = ((IdAxis)object).getElement();
return DerivedUMLPropertiesAxisManager.MULTIPLICITY.equals(id);
@@ -36,12 +37,12 @@ public class DerivedUMLPropertiesLabelProvider extends LabelProvider implements
}
@Override
- public String getText(Object element) {
+ public String getText(final Object element) {
return "multiplicity : String [0..1]";
}
@Override
- public Image getImage(Object element) {
+ public Image getImage(final Object element) {
org.eclipse.papyrus.infra.widgets.Activator widgetActivator = org.eclipse.papyrus.infra.widgets.Activator.getDefault();
String emtNattablePluginID = org.eclipse.papyrus.infra.emf.nattable.Activator.PLUGIN_ID;
return widgetActivator.getImage(emtNattablePluginID, "icons/attributes.gif");

Back to the top