Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2017-05-06 08:06:50 +0000
committervincent lorenzo2017-05-09 11:07:15 +0000
commitbbdfe743cf57c470c505c8f62e42a4ae4bd2db41 (patch)
tree67bb67a48328d9ca431dea4b8b37035762b04086 /plugins/infra/nattable
parent277f38a64c4055284e3aa87e5223c38dd5761d42 (diff)
downloadorg.eclipse.papyrus-bbdfe743cf57c470c505c8f62e42a4ae4bd2db41.tar.gz
org.eclipse.papyrus-bbdfe743cf57c470c505c8f62e42a4ae4bd2db41.tar.xz
org.eclipse.papyrus-bbdfe743cf57c470c505c8f62e42a4ae4bd2db41.zip
Bug 516247: [Table][Matrix]Interface org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager must be changed
- do the required changed for Matrix Change-Id: I64e8a20c3b6ff04b8cf7799fd18d85f54b00b2bc Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'plugins/infra/nattable')
-rwxr-xr-x[-rw-r--r--]plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/celleditor/config/SingleEEnumTypeCellEditorConfiguration.java3
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFFeatureValueCellManager.java24
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFOperationValueCellManager.java8
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/cell/ModelViewsCellManager.java16
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/configuration/EditConfiguration.java2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/fillhandle/command/PapyrusFillHandlePasteCommandHandler.java4
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/listener/NatTableDropListener.java4
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/AbstractCellManager.java20
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/CellManagerFactory.java96
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/ICellManager.java41
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/StringResolutionProblemWrapperCellManager.java36
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/TreeFillingConfigurationCellManager.java8
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/AbstractPasteInSelectionNattableCommandProvider.java14
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java10
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInTableCommandProvider.java10
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectTreeAxisInNattableCommandProvider.java10
16 files changed, 163 insertions, 143 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/celleditor/config/SingleEEnumTypeCellEditorConfiguration.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/celleditor/config/SingleEEnumTypeCellEditorConfiguration.java
index 7cca8cf91f3..5da9773ac15 100644..100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/celleditor/config/SingleEEnumTypeCellEditorConfiguration.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/celleditor/config/SingleEEnumTypeCellEditorConfiguration.java
@@ -62,7 +62,8 @@ public class SingleEEnumTypeCellEditorConfiguration implements ICellAxisConfigur
}
/**
- * @see org.eclipse.papyrus.infra.emf.nattable.celleditor.configuration.ICellAxisEditorConfiguration#handles(org.eclipse.nebula.widgets.nattable.config.IConfigRegistry, java.lang.Object)
+ *
+ * @see org.eclipse.papyrus.infra.nattable.celleditor.config.ICellAxisConfiguration#handles(org.eclipse.papyrus.infra.nattable.model.nattable.Table, java.lang.Object)
*
* @param table
* @param axisElement
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFFeatureValueCellManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFFeatureValueCellManager.java
index 0e40103f34e..2fa35cab29e 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFFeatureValueCellManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFFeatureValueCellManager.java
@@ -65,14 +65,14 @@ public class EMFFeatureValueCellManager extends AbstractCellManager {
/**
*
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#handles(java.lang.Object, java.lang.Object)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#handles(java.lang.Object, java.lang.Object, INattableModelManager)
*
* @param columnElement
* @param rowElement
* @return
*/
@Override
- public boolean handles(final Object columnElement, final Object rowElement) {
+ public boolean handles(final Object columnElement, final Object rowElement, INattableModelManager tableManager) {
return organizeAndResolvedObjects(columnElement, rowElement, null) != null;
}
@@ -131,14 +131,14 @@ public class EMFFeatureValueCellManager extends AbstractCellManager {
/**
*
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object, INattableModelManager)
*
* @param columnElement
* @param rowElement
* @return
*/
@Override
- public boolean isCellEditable(final Object columnElement, final Object rowElement) {
+ public boolean isCellEditable(final Object columnElement, final Object rowElement, INattableModelManager tableManager) {
final List<Object> objects = organizeAndResolvedObjects(columnElement, rowElement, null);
final EObject object = (EObject) objects.get(0);
final EStructuralFeature feature = (EStructuralFeature) objects.get(1);
@@ -319,15 +319,15 @@ public class EMFFeatureValueCellManager extends AbstractCellManager {
/**
*
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager#getOrCreateStringValueConverterClass(org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager, java.util.Map, java.lang.String)
- *
- * @param tableManager
* @param existingConverters
* @param multiValueSeparator
+ * @param tableManager
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager#getOrCreateStringValueConverterClass(java.util.Map, java.lang.String, org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager)
+ *
* @return
*/
@Override
- public AbstractStringValueConverter getOrCreateStringValueConverterClass(INattableModelManager tableManager, Map<Class<? extends AbstractStringValueConverter>, AbstractStringValueConverter> existingConverters, final String multiValueSeparator) {
+ public AbstractStringValueConverter getOrCreateStringValueConverterClass(Map<Class<? extends AbstractStringValueConverter>, AbstractStringValueConverter> existingConverters, final String multiValueSeparator, INattableModelManager tableManager) {
AbstractStringValueConverter converter = existingConverters.get(EMFStringValueConverter.class);
if (converter == null) {
converter = new EMFStringValueConverter(tableManager.getTable().getContext(), multiValueSeparator);
@@ -378,17 +378,17 @@ public class EMFFeatureValueCellManager extends AbstractCellManager {
/**
*
* @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#setStringValue(java.lang.Object, java.lang.Object, java.lang.String, org.eclipse.papyrus.infra.ui.converter.AbstractStringValueConverter,
- * org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager, java.util.Map)
+ * java.util.Map, org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager)
*
* @param columnElement
* @param rowElement
* @param valueAsString
* @param valueConverter
- * @param tableManager
* @param sharedMap
+ * @param tableManager
*/
@Override
- public void setStringValue(final Object columnElement, final Object rowElement, final String valueAsString, final AbstractStringValueConverter valueConverter, final INattableModelManager tableManager, final Map<?, ?> sharedMap) {
+ public void setStringValue(final Object columnElement, final Object rowElement, final String valueAsString, final AbstractStringValueConverter valueConverter, final Map<?, ?> sharedMap, final INattableModelManager tableManager) {
final List<Object> objects = organizeAndResolvedObjects(columnElement, rowElement, sharedMap);
final EObject editedObject = (EObject) objects.get(0);
final EStructuralFeature editedFeature = (EStructuralFeature) objects.get(1);
@@ -433,7 +433,7 @@ public class EMFFeatureValueCellManager extends AbstractCellManager {
*/
@Override
public Command getUnsetCellValueCommand(TransactionalEditingDomain domain, Object columnElement, Object rowElement, INattableModelManager tableManager) {
- if (isCellEditable(columnElement, rowElement)) {
+ if (isCellEditable(columnElement, rowElement, tableManager)) {
final List<Object> objects = organizeAndResolvedObjects(columnElement, rowElement, null);
final EObject elementToEdit = (EObject) objects.get(0);
final EStructuralFeature editedFeature = (EStructuralFeature) objects.get(1);
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFOperationValueCellManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFOperationValueCellManager.java
index d6bdba3065c..cfac394e00d 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFOperationValueCellManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFOperationValueCellManager.java
@@ -45,11 +45,11 @@ public class EMFOperationValueCellManager extends AbstractCellManager {
protected final static String NO_PARAMETER_MESSAGE = "N/A: This operation requires some parameters"; //$NON-NLS-1$
/**
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#handles(java.lang.Object, java.lang.Object)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#handles(java.lang.Object, java.lang.Object, INattableModelManager)
*
*/
@Override
- public boolean handles(Object columnElement, Object rowElement) {
+ public boolean handles(Object columnElement, Object rowElement, INattableModelManager tableManager) {
return organizeAndResolvedObjects(columnElement, rowElement, null) != null;
}
@@ -112,11 +112,11 @@ public class EMFOperationValueCellManager extends AbstractCellManager {
/**
*
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object, INattableModelManager)
*
*/
@Override
- public boolean isCellEditable(final Object columnElement, final Object rowElement) {
+ public boolean isCellEditable(final Object columnElement, final Object rowElement, INattableModelManager tableManager) {
return false;
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/cell/ModelViewsCellManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/cell/ModelViewsCellManager.java
index f9d95d8d837..94391ac2a3d 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/cell/ModelViewsCellManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/cell/ModelViewsCellManager.java
@@ -86,14 +86,14 @@ public class ModelViewsCellManager extends AbstractCellManager {
/**
*
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#handles(java.lang.Object, java.lang.Object)
- *
- * @param rowElement
* @param columnElement
+ * @param rowElement
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#handles(java.lang.Object, java.lang.Object, INattableModelManager)
+ *
* @return
*/
@Override
- public boolean handles(Object rowElement, Object columnElement) {
+ public boolean handles(Object rowElement, Object columnElement, INattableModelManager tableManager) {
return organizeAndResolvedObjects(columnElement, rowElement) != null;
}
@@ -129,15 +129,15 @@ public class ModelViewsCellManager extends AbstractCellManager {
/**
*
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object)
- *
- * @param rowElement
* @param columnElement
+ * @param rowElement
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object, INattableModelManager)
+ *
* @return
* <code>true</code> excepted if the edited feature is isOpen
*/
@Override
- public boolean isCellEditable(Object rowElement, Object columnElement) {
+ public boolean isCellEditable(Object rowElement, Object columnElement, INattableModelManager tableManager) {
final List<Object> objects = organizeAndResolvedObjects(columnElement, rowElement);
final String featureName = ((String) objects.get(1)).replace(Utils.NATTABLE_EDITOR_PAGE_ID, ""); //$NON-NLS-1$
return featureName.equals(Utils.VIEW_NAME);
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/configuration/EditConfiguration.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/configuration/EditConfiguration.java
index 869f4565101..347d7a23901 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/configuration/EditConfiguration.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/configuration/EditConfiguration.java
@@ -89,7 +89,7 @@ public class EditConfiguration extends DefaultEditConfiguration {
public boolean isEditable(final int columnIndex, final int rowIndex) {
final Object rowElement = manager.getRowElement(rowIndex);
final Object columnElement = manager.getColumnElement(columnIndex);
- return CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement);
+ return CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, this.manager);
}
}
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/fillhandle/command/PapyrusFillHandlePasteCommandHandler.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/fillhandle/command/PapyrusFillHandlePasteCommandHandler.java
index df1ad4ee74b..05acf7cfd19 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/fillhandle/command/PapyrusFillHandlePasteCommandHandler.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/fillhandle/command/PapyrusFillHandlePasteCommandHandler.java
@@ -373,7 +373,7 @@ public class PapyrusFillHandlePasteCommandHandler extends FillHandlePasteCommand
final Object rowElement = AxisUtils.getRepresentedElement(tableManager.getRowElement(index));
final Object columnElement = AxisUtils.getRepresentedElement(tableManager.getColumnElement(currentCell.getColumnIndex()));
- final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement);
+ final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, tableManager);
if (isEditable) {
rowDiff++;
@@ -408,7 +408,7 @@ public class PapyrusFillHandlePasteCommandHandler extends FillHandlePasteCommand
final Object rowElement = AxisUtils.getRepresentedElement(tableManager.getRowElement(currentCell.getRowIndex()));
final Object columnElement = AxisUtils.getRepresentedElement(tableManager.getColumnElement(index));
- final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement);
+ final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, tableManager);
if (isEditable) {
columnDiff++;
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/listener/NatTableDropListener.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/listener/NatTableDropListener.java
index dc7d66a56e4..36ef614415f 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/listener/NatTableDropListener.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/listener/NatTableDropListener.java
@@ -153,7 +153,7 @@ public class NatTableDropListener implements DropTargetListener {
int columnIndex = this.dropKindValue.getColumnIndex();
final Object rowElement = this.manager.getRowElement(rowIndex);
final Object columnElement = this.manager.getColumnElement(columnIndex);
- if (CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement)) {
+ if (CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, this.manager)) {
final TransactionalEditingDomain domain = getEditingDomain();
final Command cmd = getDropSetValueCommand(domain, droppedElements);
if (cmd!=null && cmd.canExecute()) {
@@ -206,7 +206,7 @@ public class NatTableDropListener implements DropTargetListener {
int columnIndex = this.dropKindValue.getColumnIndex();
final Object rowElement = this.manager.getRowElement(rowIndex);
final Object columnElement = this.manager.getColumnElement(columnIndex);
- if (CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement)) {
+ if (CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, this.manager)) {
Object newValue = null;
final Object currentValue = CellManagerFactory.INSTANCE.getCrossValueIgnoringProblems(columnElement, rowElement, this.manager);
if (currentValue instanceof Collection<?>) {
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/AbstractCellManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/AbstractCellManager.java
index 42ccf2a4743..f9c2c46cfac 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/AbstractCellManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/AbstractCellManager.java
@@ -80,14 +80,14 @@ public abstract class AbstractCellManager implements ICellManager, IUnsetValueCe
/**
*
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object, INattableModelManager)
*
* @param columnElement
* @param rowElement
* @return
*/
@Override
- public boolean isCellEditable(final Object columnElement, final Object rowElement) {
+ public boolean isCellEditable(final Object columnElement, final Object rowElement, INattableModelManager tableManager) {
return false;
}
@@ -128,12 +128,12 @@ public abstract class AbstractCellManager implements ICellManager, IUnsetValueCe
/**
*
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#getOrCreateStringValueConverterClass(INattableModelManager, Map, String)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#getOrCreateStringValueConverterClass(Map, String, INattableModelManager)
*
* @return
*/
@Override
- public AbstractStringValueConverter getOrCreateStringValueConverterClass(INattableModelManager tableManager, Map<Class<? extends AbstractStringValueConverter>, AbstractStringValueConverter> existingConverters, String multiValueSeparator) {
+ public AbstractStringValueConverter getOrCreateStringValueConverterClass(Map<Class<? extends AbstractStringValueConverter>, AbstractStringValueConverter> existingConverters, String multiValueSeparator, INattableModelManager tableManager) {
AbstractStringValueConverter converter = existingConverters.get(this.getClass());
if (converter == null) {
converter = new AbstractStringValueConverter() {
@@ -156,7 +156,7 @@ public abstract class AbstractCellManager implements ICellManager, IUnsetValueCe
/**
*
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object, java.util.Map)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object, java.util.Map, INattableModelManager)
*
* @param columnElement
* @param rowElement
@@ -164,24 +164,24 @@ public abstract class AbstractCellManager implements ICellManager, IUnsetValueCe
* @return
*/
@Override
- public boolean isCellEditable(final Object columnElement, final Object rowElement, final Map<?, ?> sharedMap) {
- return isCellEditable(columnElement, rowElement);
+ public boolean isCellEditable(final Object columnElement, final Object rowElement, final Map<?, ?> sharedMap, INattableModelManager tableManager) {
+ return isCellEditable(columnElement, rowElement, tableManager);
}
/**
*
* @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#setStringValue(java.lang.Object, java.lang.Object, java.lang.String, org.eclipse.papyrus.infra.ui.converter.AbstractStringValueConverter,
- * org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager, java.util.Map)
+ * java.util.Map, org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager)
*
* @param columnElement
* @param rowElement
* @param valueAsString
* @param valueConverter
- * @param tableManager
* @param sharedMap
+ * @param tableManager
*/
@Override
- public void setStringValue(Object columnElement, Object rowElement, String valueAsString, AbstractStringValueConverter valueConverter, INattableModelManager tableManager, Map<?, ?> sharedMap) {
+ public void setStringValue(Object columnElement, Object rowElement, String valueAsString, AbstractStringValueConverter valueConverter, Map<?, ?> sharedMap, INattableModelManager tableManager) {
// do nothing
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/CellManagerFactory.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/CellManagerFactory.java
index b0c27de0504..638feaa400f 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/CellManagerFactory.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/CellManagerFactory.java
@@ -78,7 +78,7 @@ public final class CellManagerFactory {
final Integer order = new Integer(iConfigurationElement.getAttribute(ORDER));
try {
final ICellManager solver = (ICellManager) iConfigurationElement.createExecutableExtension(CLASS_MANAGER);
- if(!this.managersMap.containsKey(order)){
+ if (!this.managersMap.containsKey(order)) {
this.managersMap.put(order, new HashSet<ICellManager>());
}
this.managersMap.get(order).add(new StringResolutionProblemWrapperCellManager(solver));
@@ -96,17 +96,17 @@ public final class CellManagerFactory {
* @param rowElement
* the row element as described in the model (you must ignore the invert axis)
* @return
- * the value to display in the cell
+ * the value to display in the cell
*/
public Object getCrossValue(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager != null) {
return cellManager.getValue(columnElement, rowElement, tableManager);
} else {
return CELL_MANAGER_NOT_FOUND;
}
}
-
+
/**
*
* @param columnElement
@@ -115,12 +115,12 @@ public final class CellManagerFactory {
* @param rowElement
* the row element as described in the model (you must ignore the invert axis)
* @return
- * the value to display in the cell
+ * the value to display in the cell
*/
public Object getCrossValueIgnoringProblems(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager != null) {
- return ((StringResolutionProblemWrapperCellManager)cellManager).getValueIgnoringCellProblem(columnElement, rowElement, tableManager);
+ return ((StringResolutionProblemWrapperCellManager) cellManager).getValueIgnoringCellProblem(columnElement, rowElement, tableManager);
} else {
return CELL_MANAGER_NOT_FOUND;
}
@@ -130,22 +130,23 @@ public final class CellManagerFactory {
*
* @param columnElement
* the column element as described in the model (you must ignore the invert axis)
- *
* @param rowElement
* the row element as described in the model (you must ignore the invert axis)
+ * @param tableManager
+ * the current table manager
*
* @return
- * the cell manager
+ * the cell manager
*/
- private ICellManager getCellManager(final Object columnElement, final Object rowElement) {
+ private ICellManager getCellManager(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) {
ICellManager result = null;
final Iterator<Integer> orders = this.managersMap.keySet().iterator();
- while(orders.hasNext() && null == result){
+ while (orders.hasNext() && null == result) {
final Integer integer = orders.next();
final Iterator<ICellManager> cellManagers = this.managersMap.get(integer).iterator();
- while(cellManagers.hasNext() && null == result){
+ while (cellManagers.hasNext() && null == result) {
final ICellManager current = cellManagers.next();
- if (current.handles(columnElement, rowElement)) {
+ if (current.handles(columnElement, rowElement, tableManager)) {
result = current;
}
}
@@ -159,14 +160,16 @@ public final class CellManagerFactory {
* the column element as described in the model (you must ignore the invert axis)
* @param rowElement
* the row element as described in the model (you must ignore the invert axis)
- *
+ * @param tableManager
+ * the current table manager
* @return
- * <code>true</code> if the cell is editable
+ * <code>true</code> if the cell is editable
+ * @since 3.0 add tableManager argument
*/
- public boolean isCellEditable(final Object columnElement, final Object rowElement) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ public boolean isCellEditable(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) {
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager != null) {
- return cellManager.isCellEditable(columnElement, rowElement);
+ return cellManager.isCellEditable(columnElement, rowElement, tableManager);
}
return false;
@@ -187,7 +190,7 @@ public final class CellManagerFactory {
* the table manager
*/
public void setCellValue(final TransactionalEditingDomain domain, final Object columnElement, final Object rowElement, final Object newValue, final INattableModelManager tableManager) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager != null) {
cellManager.setValue(domain, columnElement, rowElement, newValue, tableManager);
} else {
@@ -210,11 +213,11 @@ public final class CellManagerFactory {
* @param tableManager
* the table manager
* @return
- * the command to set the value
+ * the command to set the value
*/
public Command getSetStringValueCommand(final TransactionalEditingDomain editingDomain, final Object columnElement, final Object rowElement, final String valueAsString, final AbstractStringValueConverter stringResolvers,
final INattableModelManager tableManager) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager != null) {
return cellManager.getSetStringValueCommand(editingDomain, columnElement, rowElement, valueAsString, stringResolvers, tableManager);
} else {
@@ -228,18 +231,19 @@ public final class CellManagerFactory {
* the columnElement
* @param rowElement
* the rowElement
- * @param tableManager
- * the table manager
* @param existingConverters
* the map of the existing converters (to avoid to create same too many times
+ * @param tableManager
+ * the table manager
* @return
- * the converter to use, or null if not found
+ * the converter to use, or null if not found
+ * @since 3.0 : change the arguments order
*/
- public AbstractStringValueConverter getOrCreateStringValueConverterClass(final Object columnElement, final Object rowElement, INattableModelManager tableManager,
- final Map<Class<? extends AbstractStringValueConverter>, AbstractStringValueConverter> existingConverters, final String multiValueSeparator) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ public AbstractStringValueConverter getOrCreateStringValueConverterClass(final Object columnElement, final Object rowElement, final Map<Class<? extends AbstractStringValueConverter>, AbstractStringValueConverter> existingConverters,
+ final String multiValueSeparator, final INattableModelManager tableManager) {
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager != null) {
- return cellManager.getOrCreateStringValueConverterClass(tableManager, existingConverters, multiValueSeparator);
+ return cellManager.getOrCreateStringValueConverterClass(existingConverters, multiValueSeparator, tableManager);
}
return null;
}
@@ -255,16 +259,17 @@ public final class CellManagerFactory {
* the value as string
* @param valueConverter
* the value converter to use
- * @param tableManager
- * the table manager
* @param sharedMap
* a map with shared elements. The method may read/add elements to the shared map. These contributions will be managed by a paste post
* action or by the paste manager itself
+ * @param tableManager
+ * the table manager
+ * @since 3.0 change parameter order
*/
- public void setStringValue(final Object columnElement, final Object rowElement, final String valueAsString, final AbstractStringValueConverter valueConverter, final INattableModelManager tableManager, final Map<?, ?> sharedMap) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ public void setStringValue(final Object columnElement, final Object rowElement, final String valueAsString, final AbstractStringValueConverter valueConverter, final Map<?, ?> sharedMap, final INattableModelManager tableManager) {
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager != null) {
- cellManager.setStringValue(columnElement, rowElement, valueAsString, valueConverter, tableManager, sharedMap);
+ cellManager.setStringValue(columnElement, rowElement, valueAsString, valueConverter, sharedMap, tableManager);
} else {
throw new UnsupportedOperationException(CELL_MANAGER_NOT_FOUND);
}
@@ -278,13 +283,16 @@ public final class CellManagerFactory {
* the row element
* @param sharedMap
* a map with shared elements
+ * @param tableManager
+ * the current table manager
* @return
- * <code>true</code> if the cell is editable
+ * <code>true</code> if the cell is editable
+ * @since 3.0 add tableManager argument
*/
- public boolean isCellEditable(final Object columnElement, final Object rowElement, final Map<?, ?> sharedMap) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ public boolean isCellEditable(final Object columnElement, final Object rowElement, final Map<?, ?> sharedMap, final INattableModelManager tableManager) {
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager != null) {
- return cellManager.isCellEditable(columnElement, rowElement, sharedMap);
+ return cellManager.isCellEditable(columnElement, rowElement, sharedMap, tableManager);
}
return false;
@@ -303,10 +311,10 @@ public final class CellManagerFactory {
* @param tableManager
* the table manager
* @return
- * the command to use to do the set value. It is used by the DnD from the ModelExplorer
+ * the command to use to do the set value. It is used by the DnD from the ModelExplorer
*/
public Command getSetCellValueCommand(final TransactionalEditingDomain domain, final Object columnElement, final Object rowElement, final Object newValue, final INattableModelManager tableManager) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager != null) {
return cellManager.getSetValueCommand(domain, columnElement, rowElement, newValue, tableManager);
}
@@ -322,16 +330,16 @@ public final class CellManagerFactory {
* @param tableManager
* the table manager
* @return
- * a collection of all values for the intersection of the columnElement and the row element.
+ * a collection of all values for the intersection of the columnElement and the row element.
*/
public final Collection<?> getCrossValueAsCollection(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) {
Object value = CellManagerFactory.INSTANCE.getCrossValue(columnElement, rowElement, tableManager);
Collection<?> collection = Collections.emptyList();
if (value instanceof Collection<?>) {
collection = (Collection<?>) value;
- }else if (value instanceof Object[]) {
+ } else if (value instanceof Object[]) {
collection = Arrays.asList(value);
- }else if (null != value) {
+ } else if (null != value) {
collection = Collections.singletonList(value);
}
return collection;
@@ -351,7 +359,7 @@ public final class CellManagerFactory {
* unset the cell value if possible (reset to default value)
*/
public final void unsetCellValue(final TransactionalEditingDomain domain, final Object columnElement, final Object rowElement, final INattableModelManager tableManager) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager instanceof IUnsetValueCellManager) {
((IUnsetValueCellManager) cellManager).unsetCellValue(domain, columnElement, rowElement, tableManager);
}
@@ -371,7 +379,7 @@ public final class CellManagerFactory {
* the command to unset the cell value (reset to default value
*/
public final Command getUnsetCellValueCommand(final TransactionalEditingDomain domain, final Object columnElement, final Object rowElement, final INattableModelManager tableManager) {
- final ICellManager cellManager = getCellManager(columnElement, rowElement);
+ final ICellManager cellManager = getCellManager(columnElement, rowElement, tableManager);
if (cellManager instanceof IUnsetValueCellManager) {
return ((IUnsetValueCellManager) cellManager).getUnsetCellValueCommand(domain, columnElement, rowElement, tableManager);
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/ICellManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/ICellManager.java
index 66a3cd9929a..9240f1e99ab 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/ICellManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/ICellManager.java
@@ -9,7 +9,7 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
+ * Vicnent Lorenzo (CEA LIST) Bugs 516247, 515806
*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.manager.cell;
@@ -50,9 +50,12 @@ public interface ICellManager {
* the column element as described in the model (you must ignore the invert axis)
* @param rowElement
* the row element as described in the model (you must ignore the invert axis)
+ * @param tableManager
+ * the current table manager
* @return
+ * @since 3.0 : tableManager arguments added
*/
- public boolean handles(final Object columnElement, final Object rowElement);
+ public boolean handles(final Object columnElement, final Object rowElement, final INattableModelManager tableManager);
/**
@@ -64,7 +67,7 @@ public interface ICellManager {
* @param tableManager
* the table manager
* @return
- * the value of the cell or {@value #NOT_AVALAIBLE} if the cell is meaningless for the couple of parameters
+ * the value of the cell or {@value #NOT_AVALAIBLE} if the cell is meaningless for the couple of parameters
*
* THIS METHOD MUST NOT BE USED IN REPLACEMENT OF A SPECIFIC LABEL PROVIDER
*/
@@ -92,10 +95,13 @@ public interface ICellManager {
* the column element as described in the model (you must ignore the invert axis)
* @param rowElement
* the row element as described in the model (you must ignore the invert axis)
+ * @param tableManager
+ * the current table manager
* @return
- * <code>true</code> if the intersection of the 2 objects is editable
+ * <code>true</code> if the intersection of the 2 objects is editable
+ * @since 3.0 tableManager arguments added
*/
- public boolean isCellEditable(final Object columnElement, final Object rowElement);
+ public boolean isCellEditable(final Object columnElement, final Object rowElement, final INattableModelManager tableManager);
/**
*
@@ -109,7 +115,7 @@ public interface ICellManager {
* the new value to set to the intersection of these 2 objects
* @param tableManager
* @return
- * the command to set the value or <code>null</code>
+ * the command to set the value or <code>null</code>
*/
public Command getSetValueCommand(final TransactionalEditingDomain domain, final Object columnElement, final Object rowElement, final Object newValue, final INattableModelManager tableManager);
@@ -131,16 +137,17 @@ public interface ICellManager {
/**
*
- * @param tableManager
- * the table manager
* @param existingConverters
* a map with the existing converters, to avoid to create them too often
* @param multiValueSeparator
* the separator used for multi values
+ * @param tableManager
+ * the table manager
* @return
- * the class to use to converter the string into values. If the method create them, the method must add it to the map existingConverters
+ * the class to use to converter the string into values. If the method create them, the method must add it to the map existingConverters
+ * @since 3.0 argument order changed
*/
- public AbstractStringValueConverter getOrCreateStringValueConverterClass(INattableModelManager tableManager, final Map<Class<? extends AbstractStringValueConverter>, AbstractStringValueConverter> existingConverters, final String multiValueSeparator);
+ public AbstractStringValueConverter getOrCreateStringValueConverterClass(final Map<Class<? extends AbstractStringValueConverter>, AbstractStringValueConverter> existingConverters, final String multiValueSeparator, final INattableModelManager tableManager);
/**
* This method is used when we are pasting element in detached mode
@@ -151,10 +158,13 @@ public interface ICellManager {
* the row element as described in the model (you must ignore the invert axis)
* @param sharedMap
* a map with shared elements
+ * @param tableManager
+ * the current table manager
* @return
- * <code>true</code> if the intersection of the 2 objects is editable
+ * <code>true</code> if the intersection of the 2 objects is editable
+ * @since 3.0 tableManager arguments added
*/
- public boolean isCellEditable(final Object columnElement, final Object rowElement, final Map<?, ?> sharedMap);
+ public boolean isCellEditable(final Object columnElement, final Object rowElement, final Map<?, ?> sharedMap, final INattableModelManager tableManager);
/**
* This method is used when we are pasting elements in detached mode
@@ -167,12 +177,13 @@ public interface ICellManager {
* the value as string
* @param valueConverter
* the value converter to use
- * @param tableManager
- * the table manager
* @param sharedMap
* a map with shared elements. The method may read/add elements to the shared map. These contributions will be managed by a paste post
* action or by the paste manager itself
+ * @param tableManager
+ * the table manager
+ * @since 3.0 argument order changed
*
*/
- public void setStringValue(final Object columnElement, final Object rowElement, final String valueAsString, final AbstractStringValueConverter valueConverter, final INattableModelManager tableManager, final Map<?, ?> sharedMap);
+ public void setStringValue(final Object columnElement, final Object rowElement, final String valueAsString, final AbstractStringValueConverter valueConverter, final Map<?, ?> sharedMap, final INattableModelManager tableManager);
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/StringResolutionProblemWrapperCellManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/StringResolutionProblemWrapperCellManager.java
index 6936396d5c4..161114dbae3 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/StringResolutionProblemWrapperCellManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/StringResolutionProblemWrapperCellManager.java
@@ -46,15 +46,15 @@ public class StringResolutionProblemWrapperCellManager implements IUnsetValueCel
}
/**
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#handles(java.lang.Object, java.lang.Object)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#handles(java.lang.Object, java.lang.Object, INattableModelManager)
*
* @param columnElement
* @param rowElement
* @return
*/
@Override
- public boolean handles(Object columnElement, Object rowElement) {
- return this.wrappedCellManager.handles(columnElement, rowElement);
+ public boolean handles(Object columnElement, Object rowElement, INattableModelManager tableManager) {
+ return this.wrappedCellManager.handles(columnElement, rowElement, tableManager);
}
/**
@@ -122,15 +122,15 @@ public class StringResolutionProblemWrapperCellManager implements IUnsetValueCel
}
/**
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object, INattableModelManager)
*
* @param columnElement
* @param rowElement
* @return
*/
@Override
- public boolean isCellEditable(Object columnElement, Object rowElement) {
- return this.wrappedCellManager.isCellEditable(columnElement, rowElement);
+ public boolean isCellEditable(Object columnElement, Object rowElement, INattableModelManager tableManager) {
+ return this.wrappedCellManager.isCellEditable(columnElement, rowElement, tableManager);
}
/**
@@ -196,20 +196,20 @@ public class StringResolutionProblemWrapperCellManager implements IUnsetValueCel
}
/**
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#getOrCreateStringValueConverterClass(org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager, java.util.Map, java.lang.String)
- *
- * @param tableManager
* @param existingConverters
* @param multiValueSeparator
+ * @param tableManager
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#getOrCreateStringValueConverterClass(java.util.Map, java.lang.String, org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager)
+ *
* @return
*/
@Override
- public AbstractStringValueConverter getOrCreateStringValueConverterClass(INattableModelManager tableManager, Map<Class<? extends AbstractStringValueConverter>, AbstractStringValueConverter> existingConverters, String multiValueSeparator) {
- return this.wrappedCellManager.getOrCreateStringValueConverterClass(tableManager, existingConverters, multiValueSeparator);
+ public AbstractStringValueConverter getOrCreateStringValueConverterClass(Map<Class<? extends AbstractStringValueConverter>, AbstractStringValueConverter> existingConverters, String multiValueSeparator, INattableModelManager tableManager) {
+ return this.wrappedCellManager.getOrCreateStringValueConverterClass(existingConverters, multiValueSeparator, tableManager);
}
/**
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object, java.util.Map)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object, java.util.Map, INattableModelManager)
*
* @param columnElement
* @param rowElement
@@ -217,24 +217,24 @@ public class StringResolutionProblemWrapperCellManager implements IUnsetValueCel
* @return
*/
@Override
- public boolean isCellEditable(Object columnElement, Object rowElement, Map<?, ?> sharedMap) {
- return this.wrappedCellManager.isCellEditable(columnElement, rowElement, sharedMap);
+ public boolean isCellEditable(Object columnElement, Object rowElement, Map<?, ?> sharedMap, INattableModelManager tableManager) {
+ return this.wrappedCellManager.isCellEditable(columnElement, rowElement, sharedMap, tableManager);
}
/**
* @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#setStringValue(java.lang.Object, java.lang.Object, java.lang.String, org.eclipse.papyrus.infra.ui.converter.AbstractStringValueConverter,
- * org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager, java.util.Map)
+ * java.util.Map, org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager)
*
* @param columnElement
* @param rowElement
* @param valueAsString
* @param valueConverter
- * @param tableManager
* @param sharedMap
+ * @param tableManager
*/
@Override
- public void setStringValue(Object columnElement, Object rowElement, String valueAsString, AbstractStringValueConverter valueConverter, INattableModelManager tableManager, Map<?, ?> sharedMap) {
- this.wrappedCellManager.setStringValue(columnElement, rowElement, valueAsString, valueConverter, tableManager, sharedMap);
+ public void setStringValue(Object columnElement, Object rowElement, String valueAsString, AbstractStringValueConverter valueConverter, Map<?, ?> sharedMap, INattableModelManager tableManager) {
+ this.wrappedCellManager.setStringValue(columnElement, rowElement, valueAsString, valueConverter, sharedMap, tableManager);
CellHelper.createStringResolutionProblem(tableManager, columnElement, rowElement, valueAsString, valueConverter.getConvertedValue(), sharedMap);
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/TreeFillingConfigurationCellManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/TreeFillingConfigurationCellManager.java
index d32ca9c9806..31330643b5d 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/TreeFillingConfigurationCellManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/cell/TreeFillingConfigurationCellManager.java
@@ -27,26 +27,26 @@ public class TreeFillingConfigurationCellManager extends AbstractCellManager imp
/**
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager#handles(java.lang.Object, java.lang.Object)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager#handles(java.lang.Object, java.lang.Object, INattableModelManager)
*
* @param columnElement
* @param rowElement
* @return
*/
@Override
- public boolean handles(Object columnElement, Object rowElement) {
+ public boolean handles(Object columnElement, Object rowElement, INattableModelManager tableManager) {
return rowElement instanceof ITreeItemAxis && ((ITreeItemAxis) rowElement).getElement() instanceof TreeFillingConfiguration;
}
/**
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager#isCellEditable(java.lang.Object, java.lang.Object)
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager#isCellEditable(java.lang.Object, java.lang.Object, INattableModelManager)
*
* @param columnElement
* @param rowElement
* @return
*/
@Override
- public boolean isCellEditable(Object columnElement, Object rowElement) {
+ public boolean isCellEditable(Object columnElement, Object rowElement, INattableModelManager tableManager) {
return false;
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/AbstractPasteInSelectionNattableCommandProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/AbstractPasteInSelectionNattableCommandProvider.java
index c742cc91ac7..34861b2a41f 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/AbstractPasteInSelectionNattableCommandProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/AbstractPasteInSelectionNattableCommandProvider.java
@@ -1061,9 +1061,9 @@ public abstract class AbstractPasteInSelectionNattableCommandProvider implements
final Object columnElement = AxisUtils.getRepresentedElement(tableManager.getColumnElement(realColumnIndex));
// Edit the value if this is editable
- final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, sharedMap);
+ final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, sharedMap, tableManager);
if (isEditable) {
- final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnElement, rowElement, tableManager, existingConverters, pasteHelper.getMultiValueSeparator());
+ final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnElement, rowElement, existingConverters, pasteHelper.getMultiValueSeparator(), tableManager);
// Get the converted value (to compare with the new one
final Command command = CellManagerFactory.INSTANCE.getSetStringValueCommand(tableEditingDomain, columnElement, rowElement, valueAsString, converter, tableManager);
@@ -1382,9 +1382,9 @@ public abstract class AbstractPasteInSelectionNattableCommandProvider implements
final Object columnElement = getColumnElement(realColumnIndex);
// Edit the value if this is editable
- final boolean isEditable = null == sharedMap ? CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement) : CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, sharedMap);
+ final boolean isEditable = null == sharedMap ? CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, tableManager) : CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, sharedMap, tableManager);
if (isEditable) {
- final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnElement, rowElement, tableManager, existingConverters, pasteHelper.getMultiValueSeparator());
+ final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnElement, rowElement, existingConverters, pasteHelper.getMultiValueSeparator(), tableManager);
// Get the converted value (to compare with the new one)
if (!createdElement || attachedMode) {
@@ -1399,7 +1399,7 @@ public abstract class AbstractPasteInSelectionNattableCommandProvider implements
}
} else {
try {
- CellManagerFactory.INSTANCE.setStringValue(columnElement, rowElement, valueAsString, converter, tableManager, sharedMap);
+ CellManagerFactory.INSTANCE.setStringValue(columnElement, rowElement, valueAsString, converter, sharedMap, tableManager);
} catch (final Exception e) {
Activator.log.error("Cannot set value '" + valueAsString + "' for element '" + rowElement + "' and feature '" + columnElement + "'", e);
multiStatus.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Cannot set value '" + valueAsString + "' for element '" + rowElement + "' and feature '" + columnElement + "'"));
@@ -1623,9 +1623,9 @@ public abstract class AbstractPasteInSelectionNattableCommandProvider implements
if (!(rowElement instanceof TreeFillingConfiguration)) {
// Edit the value if this is editable
- final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, sharedMap);
+ final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnElement, rowElement, sharedMap, tableManager);
if (isEditable) {
- final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnElement, rowElement, tableManager, existingConverters, pasteHelper.getMultiValueSeparator());
+ final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnElement, rowElement, existingConverters, pasteHelper.getMultiValueSeparator(), tableManager);
// Get the converted value (to compare with the new one
final Command command = CellManagerFactory.INSTANCE.getSetStringValueCommand(tableEditingDomain, columnElement, rowElement, valueAsString, converter, tableManager);
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
index d4a95cd3d3d..65edcdf9938 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
@@ -192,10 +192,10 @@ public class PasteEObjectAxisInNattableCommandProvider extends AbstractPasteEObj
final Object columnObject = currentAxis;
final Object rowObject = createdElement;
- final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject, sharedMap);
+ final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject, sharedMap, tableManager);
if (isEditable) {
- final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, tableManager, existingConverters, this.pasteHelper.getMultiValueSeparator());
- CellManagerFactory.INSTANCE.setStringValue(columnObject, rowObject, valueAsString, converter, tableManager, sharedMap);
+ final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, existingConverters, this.pasteHelper.getMultiValueSeparator(), tableManager);
+ CellManagerFactory.INSTANCE.setStringValue(columnObject, rowObject, valueAsString, converter, sharedMap, tableManager);
}
}
@@ -427,10 +427,10 @@ public class PasteEObjectAxisInNattableCommandProvider extends AbstractPasteEObj
rowObject = createdElement;
}
- final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject);
+ final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject, tableManager);
if (isEditable) {
- final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, tableManager, existingConverters, pasteHelper.getMultiValueSeparator());
+ final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, existingConverters, pasteHelper.getMultiValueSeparator(), tableManager);
final Command setValueCommand = CellManagerFactory.INSTANCE.getSetStringValueCommand(contextEditingDomain, columnObject, rowObject, valueAsString, converter, tableManager);
final IStatus commandStatus = getStatusCommand(setValueCommand);
if (!commandStatus.isOK()) {
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInTableCommandProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInTableCommandProvider.java
index da634840171..31a5630607a 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInTableCommandProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInTableCommandProvider.java
@@ -392,10 +392,10 @@ public class PasteEObjectAxisInTableCommandProvider implements PasteNattableComm
}
- final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject, sharedMap);
+ final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject, sharedMap, tableManager);
if (isEditable) {
- final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, tableManager, existingConverters, TableClipboardUtils.MULTI_VALUE_SEPARATOR);
- CellManagerFactory.INSTANCE.setStringValue(columnObject, rowObject, valueAsString, converter, tableManager, sharedMap);
+ final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, existingConverters, TableClipboardUtils.MULTI_VALUE_SEPARATOR, tableManager);
+ CellManagerFactory.INSTANCE.setStringValue(columnObject, rowObject, valueAsString, converter, sharedMap, tableManager);
}
}
@@ -616,10 +616,10 @@ public class PasteEObjectAxisInTableCommandProvider implements PasteNattableComm
}
- final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject);
+ final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject, tableManager);
if (isEditable) {
- final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, tableManager, existingConverters, TableClipboardUtils.MULTI_VALUE_SEPARATOR);
+ final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, existingConverters, TableClipboardUtils.MULTI_VALUE_SEPARATOR, tableManager);
final Command setValueCommand = CellManagerFactory.INSTANCE.getSetStringValueCommand(contextEditingDomain, columnObject, rowObject, valueAsString, converter, tableManager);
if (setValueCommand != null && setValueCommand.canExecute()) {
setValueCommand.execute();
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectTreeAxisInNattableCommandProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectTreeAxisInNattableCommandProvider.java
index f7fc3628ee1..407d7a88e41 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectTreeAxisInNattableCommandProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectTreeAxisInNattableCommandProvider.java
@@ -726,10 +726,10 @@ public class PasteEObjectTreeAxisInNattableCommandProvider extends AbstractPaste
* A map used to share objects and informations during the paste between this class and the cell value manager.
*/
private void setValueInDetachedMode(final Object rowObject, final Object columnObject, final String valueAsString, final Map<Object, Object> sharedMap) {
- final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject, sharedMap);
+ final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject, sharedMap, tableManager);
if (isEditable) {
- final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, tableManager, existingConverters, pasteHelper.getMultiValueSeparator());
- CellManagerFactory.INSTANCE.setStringValue(columnObject, rowObject, valueAsString, converter, tableManager, sharedMap);
+ final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, existingConverters, pasteHelper.getMultiValueSeparator(), tableManager);
+ CellManagerFactory.INSTANCE.setStringValue(columnObject, rowObject, valueAsString, converter, sharedMap, tableManager);
}
}
@@ -748,10 +748,10 @@ public class PasteEObjectTreeAxisInNattableCommandProvider extends AbstractPaste
* The value to set.
*/
private void setValueInAttachedMode(final ExtendedCompoundCommand compoundCommand, final List<IStatus> resultStatus, final Object rowObject, final Object columnObject, final String valueAsString) {
- final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject);
+ final boolean isEditable = CellManagerFactory.INSTANCE.isCellEditable(columnObject, rowObject, tableManager);
if (isEditable) {
- final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, tableManager, existingConverters, pasteHelper.getMultiValueSeparator());
+ final AbstractStringValueConverter converter = CellManagerFactory.INSTANCE.getOrCreateStringValueConverterClass(columnObject, rowObject, existingConverters, pasteHelper.getMultiValueSeparator(), tableManager);
final Command setValueCommand = CellManagerFactory.INSTANCE.getSetStringValueCommand(contextEditingDomain, columnObject, rowObject, valueAsString, converter, tableManager);
final IStatus commandStatus = getStatusCommand(setValueCommand);
if (!commandStatus.isOK()) {

Back to the top