From 93cf4406b7d8ddf02b3840526ddf72f613bed8fa Mon Sep 17 00:00:00 2001 From: Vincent Lorenzo Date: Wed, 17 Jul 2013 10:56:38 +0200 Subject: 401764: [Table 2] The classes managing the table model and Nattable must be refactored https://bugs.eclipse.org/bugs/show_bug.cgi?id=401764 Replace all usages of EditingDomain by TransactionalEditingDomain (to clear the API) + organize import--- .../converter/handlers/ConvertOldTableHandler.java | 1 - .../nattable/manager/axis/EObjectAxisManager.java | 13 ++-- .../axis/EStructuralFeatureAxisManager.java | 15 ++--- .../manager/cell/EMFFeatureValueCellManager.java | 5 +- .../common/editor/AbstractEMFNattableEditor.java | 4 +- .../common/handlers/RenameTableHandler.java | 1 + .../advice/NatTableDuplicateEditHelperAdvice.java | 1 - .../nattable/common/utils/TableEditorInput.java | 8 +-- .../PapyrusNattableControlModeParticipant.java | 18 ++++-- ...eLabelProviderConfigurationObservableValue.java | 4 +- ...lumnHeaderAxisConfigurationObservableValue.java | 4 +- ...tLabelProviderConfigurationObservableValue.java | 4 +- ...eLabelProviderConfigurationObservableValue.java | 4 +- ...tRowHeaderAxisConfigurationObservableValue.java | 4 +- ...tLabelProviderConfigurationObservableValue.java | 4 +- .../axis/EditorContextSynchronizerAxisManager.java | 6 +- .../manager/axis/EditorFeatureAxisManager.java | 6 +- .../config/manager/cell/ModelViewsCellManager.java | 7 +- .../infra/nattable/command/TableCommands.java | 12 ++-- .../nattable/handler/AbstractTableHandler.java | 31 ++------- .../nattable/manager/axis/AbstractAxisManager.java | 33 ++++------ .../manager/axis/CompositeAxisManager.java | 19 +++--- .../infra/nattable/manager/axis/IAxisManager.java | 10 +-- .../manager/table/NattableModelManager.java | 25 ++++---- .../nattable/utils/TableEditingDomainUtils.java | 74 +++++++++++++++++++++ .../nattable/utils/TableEditingDomainuUtils.java | 75 ---------------------- .../nattable/manager/axis/AllocateAxisManager.java | 6 +- .../manager/axis/RequirementAxisManager.java | 9 +-- .../axis/UMLStereotypePropertyAxisManager.java | 16 ++--- .../manager/axis/PropertyFileAxisManager.java | 19 ++---- .../axis/PropertyFilePropertyAxisManager.java | 25 +++----- .../axis/DerivedUMLPropertiesAxisManager.java | 4 +- .../axis/SynchronizedFeatureValueAxisManager.java | 3 +- .../cell/DerivedUMLPropertiesCellManager.java | 4 +- 34 files changed, 215 insertions(+), 259 deletions(-) create mode 100644 extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableEditingDomainUtils.java delete mode 100644 extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableEditingDomainuUtils.java diff --git a/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertOldTableHandler.java b/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertOldTableHandler.java index 952b0f2c099..45e138561db 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertOldTableHandler.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertOldTableHandler.java @@ -45,7 +45,6 @@ import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager; import org.eclipse.papyrus.infra.core.sashwindows.di.DiPackage; import org.eclipse.papyrus.infra.core.services.ServiceException; import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject; -import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; import org.eclipse.papyrus.infra.nattable.common.modelresource.PapyrusNattableModel; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.EObjectAxis; diff --git a/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EObjectAxisManager.java b/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EObjectAxisManager.java index 6717715f923..f7c44d0a800 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EObjectAxisManager.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EObjectAxisManager.java @@ -19,7 +19,6 @@ import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.command.CompoundCommand; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.edit.command.AddCommand; -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; @@ -43,7 +42,7 @@ public class EObjectAxisManager extends AbstractAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getAddAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -54,7 +53,7 @@ public class EObjectAxisManager extends AbstractAxisManager { * the command to create the required axis in the model */ @Override - public Command getAddAxisCommand(final EditingDomain domain, final Collection objectToAdd) { + public Command getAddAxisCommand(final TransactionalEditingDomain domain, final Collection objectToAdd) { final CompoundCommand cmd = new CompoundCommand(Messages.EObjectManager_AddAxisElement); for(final Object object : objectToAdd) { if(isAllowedContents(object)) { @@ -71,7 +70,7 @@ public class EObjectAxisManager extends AbstractAxisManager { /** * This manager doesn't add axis on the other side, because it is a master axis manager * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getComplementaryAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getComplementaryAddAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -79,7 +78,7 @@ public class EObjectAxisManager extends AbstractAxisManager { * @return */ @Override - public Command getComplementaryAddAxisCommand(final EditingDomain domain, final Collection objectToAdd) { + public Command getComplementaryAddAxisCommand(final TransactionalEditingDomain domain, final Collection objectToAdd) { return null; } @@ -182,14 +181,14 @@ public class EObjectAxisManager extends AbstractAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(TransactionalEditingDomain, * java.lang.Integer) * * @param domain * @param axisPosition * @return */ - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { final Object current = getElements().get(axisPosition); if(current instanceof EObjectAxis) { final EObject element = ((EObjectAxis)current).getElement(); diff --git a/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EStructuralFeatureAxisManager.java b/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EStructuralFeatureAxisManager.java index 797ce4147ce..78d5acae254 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EStructuralFeatureAxisManager.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/EStructuralFeatureAxisManager.java @@ -25,7 +25,6 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; @@ -49,7 +48,7 @@ public class EStructuralFeatureAxisManager extends AbstractAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getComplementaryAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getComplementaryAddAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -57,7 +56,7 @@ public class EStructuralFeatureAxisManager extends AbstractAxisManager { * @return */ @Override - public Command getComplementaryAddAxisCommand(final EditingDomain domain, final Collection objectToAdd) { + public Command getComplementaryAddAxisCommand(final TransactionalEditingDomain domain, final Collection objectToAdd) { final Set features = new HashSet(); for(final Object current : objectToAdd) { if(current instanceof EObject) { @@ -73,7 +72,7 @@ public class EStructuralFeatureAxisManager extends AbstractAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getAddAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -81,7 +80,7 @@ public class EStructuralFeatureAxisManager extends AbstractAxisManager { * @return */ @Override - public Command getAddAxisCommand(EditingDomain domain, Collection objectToAdd) { + public Command getAddAxisCommand(TransactionalEditingDomain domain, Collection objectToAdd) { final Collection toAdd = new ArrayList(); for(final Object current : objectToAdd) { if(isAllowedContents(current)) { @@ -99,7 +98,7 @@ public class EStructuralFeatureAxisManager extends AbstractAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getDestroyAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getDestroyAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -107,7 +106,7 @@ public class EStructuralFeatureAxisManager extends AbstractAxisManager { * @return */ @Override - public Command getDestroyAxisCommand(EditingDomain domain, Collection objectToDestroy) {//FIXME must be done in the abstract class + public Command getDestroyAxisCommand(TransactionalEditingDomain domain, Collection objectToDestroy) {//FIXME must be done in the abstract class IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getRepresentedContentProvider()); final CompositeCommand compositeCommand = new CompositeCommand("Destroy IAxis Command"); for(final IAxis current : getRepresentedContentProvider().getAxis()) { @@ -248,7 +247,7 @@ public class EStructuralFeatureAxisManager extends AbstractAxisManager { return false; } - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { return UnexecutableCommand.INSTANCE; } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFFeatureValueCellManager.java b/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFFeatureValueCellManager.java index 48543347cd0..73b0dd66cf3 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFFeatureValueCellManager.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/cell/EMFFeatureValueCellManager.java @@ -125,13 +125,14 @@ public class EMFFeatureValueCellManager extends AbstractCellManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#getSetValueCommand(org.eclipse.emf.edit.domain.EditingDomain, - * java.lang.Object, java.lang.Object, java.lang.Object, INattableModelManager) + * @see org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager#getSetValueCommand(org.eclipse.emf.transaction.TransactionalEditingDomain, + * java.lang.Object, java.lang.Object, java.lang.Object, org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager) * * @param domain * @param columnElement * @param rowElement * @param newValue + * @param tableManager * @return */ @Override diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/editor/AbstractEMFNattableEditor.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/editor/AbstractEMFNattableEditor.java index 465888fe379..36568fa6302 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/editor/AbstractEMFNattableEditor.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/editor/AbstractEMFNattableEditor.java @@ -18,7 +18,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.papyrus.infra.core.services.ServiceException; import org.eclipse.papyrus.infra.core.services.ServicesRegistry; import org.eclipse.papyrus.infra.core.utils.ServiceUtils; @@ -91,7 +91,7 @@ public abstract class AbstractEMFNattableEditor extends EditorPart { * * @return */ - public EditingDomain getEditingDomain() { + public TransactionalEditingDomain getEditingDomain() { try { return ServiceUtils.getInstance().getTransactionalEditingDomain(this.servicesRegistry); } catch (final ServiceException e) { diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/RenameTableHandler.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/RenameTableHandler.java index a5a88d42a9d..d971c2b68d1 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/RenameTableHandler.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/RenameTableHandler.java @@ -17,6 +17,7 @@ import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.expressions.IEvaluationContext; +import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.window.Window; diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/advice/NatTableDuplicateEditHelperAdvice.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/advice/NatTableDuplicateEditHelperAdvice.java index 4f5bf1bba2a..a8aa99f2a47 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/advice/NatTableDuplicateEditHelperAdvice.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/advice/NatTableDuplicateEditHelperAdvice.java @@ -44,7 +44,6 @@ import org.eclipse.papyrus.infra.core.services.ServiceException; import org.eclipse.papyrus.infra.emf.commands.IPapyrusDuplicateCommandConstants; import org.eclipse.papyrus.infra.emf.utils.BusinessModelResolver; import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource; -import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; import org.eclipse.papyrus.infra.nattable.common.Activator; import org.eclipse.papyrus.infra.nattable.common.modelresource.PapyrusNattableModel; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/utils/TableEditorInput.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/utils/TableEditorInput.java index 0936d3b045c..c96c29b607f 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/utils/TableEditorInput.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/utils/TableEditorInput.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.papyrus.infra.nattable.common.utils; -import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.ui.IEditorInput; @@ -31,9 +31,9 @@ public class TableEditorInput implements IEditorInput { /** A textual description of what is shown in the editor */ private final String description; - private final EditingDomain editingDomain; + private final TransactionalEditingDomain editingDomain; - public TableEditorInput(final Table papyrusTable, final EditingDomain editingDomain) { + public TableEditorInput(final Table papyrusTable, final TransactionalEditingDomain editingDomain) { this.tableInstance = papyrusTable; this.description = papyrusTable.getDescription(); this.editingDomain = editingDomain; @@ -71,7 +71,7 @@ public class TableEditorInput implements IEditorInput { return null; } - protected EditingDomain getEditingDomain() { + protected TransactionalEditingDomain getEditingDomain() { return this.editingDomain; } } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.controlmode/src/org/eclipse/papyrus/infra/nattable/controlmode/commands/PapyrusNattableControlModeParticipant.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.controlmode/src/org/eclipse/papyrus/infra/nattable/controlmode/commands/PapyrusNattableControlModeParticipant.java index 5b742d1d92f..7c6b2d405ac 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.controlmode/src/org/eclipse/papyrus/infra/nattable/controlmode/commands/PapyrusNattableControlModeParticipant.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.controlmode/src/org/eclipse/papyrus/infra/nattable/controlmode/commands/PapyrusNattableControlModeParticipant.java @@ -1,6 +1,17 @@ -/* - * - */ +/***************************************************************************** + * 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ + package org.eclipse.papyrus.infra.nattable.controlmode.commands; import org.eclipse.emf.ecore.EObject; @@ -8,7 +19,6 @@ import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.papyrus.infra.nattable.controlmode.helpers.TableControlModeHelper; import org.eclipse.papyrus.infra.services.controlmode.ControlModeRequest; import org.eclipse.papyrus.infra.services.controlmode.participants.IControlCommandParticipant; -import org.eclipse.papyrus.infra.services.controlmode.participants.IControlModeParticipant; import org.eclipse.papyrus.infra.services.controlmode.participants.IUncontrolCommandParticipant; diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnFeatureLabelProviderConfigurationObservableValue.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnFeatureLabelProviderConfigurationObservableValue.java index 58b1663dedf..e9a0e412e78 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnFeatureLabelProviderConfigurationObservableValue.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnFeatureLabelProviderConfigurationObservableValue.java @@ -22,7 +22,7 @@ import org.eclipse.papyrus.infra.nattable.command.TableCommands; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ILabelProviderConfiguration; import org.eclipse.papyrus.infra.nattable.utils.LabelConfigurationManagementUtils; -import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainuUtils; +import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainUtils; /** * The Class AbstractColumnFeatureLabelProviderConfigurationObservableValue. @@ -64,7 +64,7 @@ public abstract class AbstractColumnFeatureLabelProviderConfigurationObservableV @Override protected void doSetValue(Object value) { final ICommand cmd = TableCommands.getSetColumnLabelConfigurationValueCommand(getTable(), (ILabelProviderConfiguration)getEditedEObject(), getManagedFeature(), value); - final TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(getTable()); + final TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(getTable()); domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd)); } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnHeaderAxisConfigurationObservableValue.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnHeaderAxisConfigurationObservableValue.java index 4cb57cee409..062cc52609d 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnHeaderAxisConfigurationObservableValue.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnHeaderAxisConfigurationObservableValue.java @@ -21,7 +21,7 @@ import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; import org.eclipse.papyrus.infra.nattable.command.TableCommands; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.utils.HeaderAxisConfigurationManagementUtils; -import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainuUtils; +import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainUtils; /** * Abstract class for the columnHeaderAxisConfiguration @@ -62,7 +62,7 @@ public abstract class AbstractColumnHeaderAxisConfigurationObservableValue exten @Override protected final void doSetValue(final Object value) { final ICommand cmd = TableCommands.getSetColumnHeaderConfigurationValueCommand(getTable(), getManagedFeature(), value); - final TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(getTable()); + final TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(getTable()); domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd)); } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnObjectLabelProviderConfigurationObservableValue.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnObjectLabelProviderConfigurationObservableValue.java index 11816dfa145..3bfcabbe318 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnObjectLabelProviderConfigurationObservableValue.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractColumnObjectLabelProviderConfigurationObservableValue.java @@ -22,7 +22,7 @@ import org.eclipse.papyrus.infra.nattable.command.TableCommands; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ILabelProviderConfiguration; import org.eclipse.papyrus.infra.nattable.utils.LabelConfigurationManagementUtils; -import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainuUtils; +import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainUtils; /** * The Class AbstractColumnObjectLabelProviderConfigurationObservableValue. @@ -64,7 +64,7 @@ public abstract class AbstractColumnObjectLabelProviderConfigurationObservableVa @Override protected void doSetValue(Object value) { final ICommand cmd = TableCommands.getSetColumnLabelConfigurationValueCommand(getTable(), (ILabelProviderConfiguration)getEditedEObject(), getManagedFeature(), value); - final TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(getTable()); + final TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(getTable()); domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd)); } } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowFeatureLabelProviderConfigurationObservableValue.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowFeatureLabelProviderConfigurationObservableValue.java index 0c0fcd7c29a..dca7d5af3c0 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowFeatureLabelProviderConfigurationObservableValue.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowFeatureLabelProviderConfigurationObservableValue.java @@ -22,7 +22,7 @@ import org.eclipse.papyrus.infra.nattable.command.TableCommands; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ILabelProviderConfiguration; import org.eclipse.papyrus.infra.nattable.utils.LabelConfigurationManagementUtils; -import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainuUtils; +import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainUtils; /** * The Class AbstractRowFeatureLabelProviderConfigurationObservableValue. @@ -64,7 +64,7 @@ public abstract class AbstractRowFeatureLabelProviderConfigurationObservableValu @Override protected void doSetValue(Object value) { final ICommand cmd = TableCommands.getSetRowLabelConfigurationValueCommand(getTable(), (ILabelProviderConfiguration)getEditedEObject(), getManagedFeature(), value); - final TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(getTable()); + final TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(getTable()); domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd)); } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowHeaderAxisConfigurationObservableValue.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowHeaderAxisConfigurationObservableValue.java index a82250bb84d..c43b635ed8d 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowHeaderAxisConfigurationObservableValue.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowHeaderAxisConfigurationObservableValue.java @@ -21,7 +21,7 @@ import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; import org.eclipse.papyrus.infra.nattable.command.TableCommands; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.utils.HeaderAxisConfigurationManagementUtils; -import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainuUtils; +import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainUtils; /** * Abstract class for the rowHeaderAxisConfiguration @@ -64,7 +64,7 @@ public abstract class AbstractRowHeaderAxisConfigurationObservableValue extends @Override protected final void doSetValue(final Object value) { final ICommand cmd = TableCommands.getSetRowHeaderConfigurationValueCommand(getTable(), getManagedFeature(), value); - final TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(getTable()); + final TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(getTable()); domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd)); } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowObjectLabelProviderConfigurationObservableValue.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowObjectLabelProviderConfigurationObservableValue.java index 608355c15c4..8541a95c5bc 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowObjectLabelProviderConfigurationObservableValue.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/observable/AbstractRowObjectLabelProviderConfigurationObservableValue.java @@ -22,7 +22,7 @@ import org.eclipse.papyrus.infra.nattable.command.TableCommands; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ILabelProviderConfiguration; import org.eclipse.papyrus.infra.nattable.utils.LabelConfigurationManagementUtils; -import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainuUtils; +import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainUtils; /** * The Class AbstractRowObjectLabelProviderConfigurationObservableValue. @@ -64,7 +64,7 @@ public abstract class AbstractRowObjectLabelProviderConfigurationObservableValue @Override protected void doSetValue(Object value) { final ICommand cmd = TableCommands.getSetRowLabelConfigurationValueCommand(getTable(), (ILabelProviderConfiguration)getEditedEObject(), getManagedFeature(), value); - final TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(getTable()); + final TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(getTable()); domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd)); } } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/axis/EditorContextSynchronizerAxisManager.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/axis/EditorContextSynchronizerAxisManager.java index 951e4bd277c..f7951271632 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/axis/EditorContextSynchronizerAxisManager.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/axis/EditorContextSynchronizerAxisManager.java @@ -22,7 +22,7 @@ import org.eclipse.emf.common.command.UnexecutableCommand; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.impl.AdapterImpl; import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.papyrus.infra.core.sashwindows.di.DiPackage; import org.eclipse.papyrus.infra.core.sashwindows.di.PageList; import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; @@ -160,7 +160,7 @@ public class EditorContextSynchronizerAxisManager extends AbstractSynchronizedOn /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(TransactionalEditingDomain, * java.lang.Integer) * * @param domain @@ -168,7 +168,7 @@ public class EditorContextSynchronizerAxisManager extends AbstractSynchronizedOn * @return */ @Override - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { return UnexecutableCommand.INSTANCE; } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/axis/EditorFeatureAxisManager.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/axis/EditorFeatureAxisManager.java index 22f31725732..9acaf2da798 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/axis/EditorFeatureAxisManager.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/axis/EditorFeatureAxisManager.java @@ -15,7 +15,7 @@ package org.eclipse.papyrus.infra.nattable.views.config.manager.axis; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.command.UnexecutableCommand; -import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager; /** @@ -71,7 +71,7 @@ public class EditorFeatureAxisManager extends AbstractAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(TransactionalEditingDomain, * java.lang.Integer) * * @param domain @@ -79,7 +79,7 @@ public class EditorFeatureAxisManager extends AbstractAxisManager { * @return */ @Override - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { return UnexecutableCommand.INSTANCE; } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/cell/ModelViewsCellManager.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/cell/ModelViewsCellManager.java index f1350a46b10..e2ffd90c082 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/cell/ModelViewsCellManager.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/manager/cell/ModelViewsCellManager.java @@ -143,13 +143,14 @@ public class ModelViewsCellManager extends AbstractCellManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#getSetValueCommand(org.eclipse.emf.edit.domain.EditingDomain, - * java.lang.Object, java.lang.Object, java.lang.Object, INattableModelManager) + * @see org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager#getSetValueCommand(org.eclipse.emf.transaction.TransactionalEditingDomain, + * java.lang.Object, java.lang.Object, java.lang.Object, org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager) * * @param domain - * @param rowElement * @param columnElement + * @param rowElement * @param newValue + * @param manager * @return */ @Override diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/command/TableCommands.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/command/TableCommands.java index 78ea5676701..fc4544bc51b 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/command/TableCommands.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/command/TableCommands.java @@ -35,7 +35,7 @@ import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfigurati import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.TableHeaderAxisConfiguration; import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ILabelProviderConfiguration; import org.eclipse.papyrus.infra.nattable.utils.HeaderAxisConfigurationManagementUtils; -import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainuUtils; +import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainUtils; import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; @@ -69,7 +69,7 @@ public class TableCommands { */ //FIXME : the handler must use me public static ICommand getSetRowHeaderConfigurationValueCommand(final Table table, final EStructuralFeature feature, final Object newValue) { - final TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(table); + final TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(table); final CompositeCommand compositeCommand = new CompositeCommand("SetRowHeaderConfigurationCommand"); //$NON-NLS-1$ EObject elementToEdit = HeaderAxisConfigurationManagementUtils.getRowAbstractHeaderAxisUsedInTable(table); if(elementToEdit instanceof TableHeaderAxisConfiguration) { @@ -104,7 +104,7 @@ public class TableCommands { */ //FIXME : the handler must use me public static ICommand getSetColumnHeaderConfigurationValueCommand(final Table table, final EStructuralFeature feature, final Object newValue) { - final TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(table); + final TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(table); final CompositeCommand compositeCommand = new CompositeCommand("SetColumnHeaderConfigurationCommand"); //$NON-NLS-1$ EObject elementToEdit = HeaderAxisConfigurationManagementUtils.getColumnAbstractHeaderAxisUsedInTable(table); if(elementToEdit instanceof TableHeaderAxisConfiguration) { @@ -143,7 +143,7 @@ public class TableCommands { //FIXME the handler must use me public static final ICommand getSetColumnLabelConfigurationValueCommand(final Table table, final ILabelProviderConfiguration usedLabelConfiguration, final EStructuralFeature editedFeature, final Object newValue) { final CompositeCommand cmd = new CompositeCommand("ChangeColumnLabelConfigurationValueCommand"); //$NON-NLS-1$ - TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(table); + TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(table); ILabelProviderConfiguration editedLabelConf; if(usedLabelConfiguration.eContainer() instanceof TableHeaderAxisConfiguration) { editedLabelConf = EcoreUtil.copy(usedLabelConfiguration); @@ -174,7 +174,7 @@ public class TableCommands { //FIXME the handler must use me public static final ICommand getSetRowLabelConfigurationValueCommand(final Table table, final ILabelProviderConfiguration usedLabelConfiguration, final EStructuralFeature editedFeature, final Object newValue) { final CompositeCommand cmd = new CompositeCommand("ChangeRowLabelConfigurationValueCommand"); //$NON-NLS-1$ - TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(table); + TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(table); ILabelProviderConfiguration editedLabelConf; if(usedLabelConfiguration.eContainer() instanceof TableHeaderAxisConfiguration) { editedLabelConf = EcoreUtil.copy(usedLabelConfiguration); @@ -256,7 +256,7 @@ public class TableCommands { * the command to register the local label configuration */ private static final ICommand getRegisterLocalLabelConfigurationCommand(final String commandName, final Table table, final AbstractHeaderAxisConfiguration headerAxisConfigurationUsedInTable, final TableHeaderAxisConfiguration tableHeaderAxisConfiguration, final EStructuralFeature axisConfigurationFeature, final ILabelProviderConfiguration localTableLabelConfiguration, final ILabelProviderConfiguration tableLabelConfiguration) { - final TransactionalEditingDomain domain = TableEditingDomainuUtils.getTableEditingDomain(table); + final TransactionalEditingDomain domain = TableEditingDomainUtils.getTableEditingDomain(table); final CompositeCommand cmd = new CompositeCommand(commandName); //1. we must get or create the required LocalTableHeaderAxisConfiguration diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractTableHandler.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractTableHandler.java index 1ab42467f20..2a50d8813ea 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractTableHandler.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractTableHandler.java @@ -19,17 +19,13 @@ import java.util.List; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.expressions.IEvaluationContext; -import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.nebula.widgets.nattable.NatTable; import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer; import org.eclipse.nebula.widgets.nattable.ui.NatEventData; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject; -import org.eclipse.papyrus.infra.nattable.Activator; import org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager; import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager; -import org.eclipse.papyrus.infra.nattable.messages.Messages; +import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainUtils; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Control; @@ -86,15 +82,8 @@ public abstract class AbstractTableHandler extends AbstractHandler { * * @return */ - protected EditingDomain getTableEditingDomain() {//duplicated code from NattableModelManager - ServicesRegistry registry = null; - try { - registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(getCurrentNattableModelManager().getTable()); - return registry.getService(EditingDomain.class); - } catch (final ServiceException e) { - Activator.log.error(Messages.NattableModelManager_ServiceRegistryNotFound, e); - } - return null; + protected TransactionalEditingDomain getTableEditingDomain() {//duplicated code from NattableModelManager + return TableEditingDomainUtils.getTableEditingDomain(getCurrentNattableModelManager().getTable()); } /** @@ -102,16 +91,8 @@ public abstract class AbstractTableHandler extends AbstractHandler { * * @return */ - protected EditingDomain getContextEditingDomain() {//duplicated code from NattableModelManager - ServicesRegistry registry = null; - try { - registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(getCurrentNattableModelManager().getTable()); - return registry.getService(EditingDomain.class); - } catch (final ServiceException e) { - Activator.log.error(Messages.NattableModelManager_ServiceRegistryNotFound, e); - } - - return null; + protected TransactionalEditingDomain getContextEditingDomain() {//duplicated code from NattableModelManager + return TableEditingDomainUtils.getTableContextEditingDomain(getCurrentNattableModelManager().getTable()); } /** diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractAxisManager.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractAxisManager.java index c9a821588b8..45632fe90fc 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractAxisManager.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractAxisManager.java @@ -24,7 +24,6 @@ import org.eclipse.emf.common.command.CompoundCommand; import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.impl.AdapterImpl; import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; import org.eclipse.gmf.runtime.common.core.command.ICommand; @@ -188,14 +187,14 @@ public abstract class AbstractAxisManager implements IAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getAddAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain * @param objectToAdd * @return */ - public Command getAddAxisCommand(final EditingDomain domain, final Collection objectToAdd) { + public Command getAddAxisCommand(final TransactionalEditingDomain domain, final Collection objectToAdd) { return null; } @@ -213,14 +212,14 @@ public abstract class AbstractAxisManager implements IAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getComplementaryAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getComplementaryAddAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain * @param objectToAdd * @return */ - public Command getComplementaryAddAxisCommand(final EditingDomain domain, final Collection objectToAdd) { + public Command getComplementaryAddAxisCommand(final TransactionalEditingDomain domain, final Collection objectToAdd) { return null; } @@ -279,18 +278,10 @@ public abstract class AbstractAxisManager implements IAxisManager { } + /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, - * java.util.Collection) - * - * @param domain - * @param objectToDestroy - * @return - */ - /** - * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getDestroyAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getDestroyAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -298,7 +289,7 @@ public abstract class AbstractAxisManager implements IAxisManager { * @return */ @Override - public Command getDestroyAxisCommand(EditingDomain domain, Collection objectToDestroy) {//FIXME must be done in the abstract class + public Command getDestroyAxisCommand(TransactionalEditingDomain domain, Collection objectToDestroy) {//FIXME must be done in the abstract class IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getRepresentedContentProvider()); final CompositeCommand compositeCommand = new CompositeCommand("Destroy IAxis Command"); for(final IAxis current : getRepresentedContentProvider().getAxis()) { @@ -347,11 +338,11 @@ public abstract class AbstractAxisManager implements IAxisManager { * * @return */ - protected EditingDomain getTableEditingDomain() {//Duplicated from NatTableModelManager + protected TransactionalEditingDomain getTableEditingDomain() {//Duplicated from NatTableModelManager ServicesRegistry registry = null; try { registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(getTableManager().getTable()); - return registry.getService(EditingDomain.class); + return registry.getService(TransactionalEditingDomain.class); } catch (final ServiceException e) { Activator.log.error(Messages.NattableModelManager_ServiceRegistryNotFound, e); } @@ -364,7 +355,7 @@ public abstract class AbstractAxisManager implements IAxisManager { * * @return */ - protected EditingDomain getContextEditingDomain() { //Duplicated from NatTableModelManager + protected TransactionalEditingDomain getContextEditingDomain() { //Duplicated from NatTableModelManager ServicesRegistry registry = null; try { registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(getTableContext()); @@ -479,7 +470,7 @@ public abstract class AbstractAxisManager implements IAxisManager { @Override public void destroyAxis(final List axisPositions) { final List toDestroy = getElements(axisPositions); - EditingDomain domain = getTableEditingDomain(); + TransactionalEditingDomain domain = getTableEditingDomain(); final Command cmd = getDestroyAxisCommand(domain, toDestroy); domain.getCommandStack().execute(cmd); } @@ -522,7 +513,7 @@ public abstract class AbstractAxisManager implements IAxisManager { @Override public void destroyAxisElement(final List axisPosition) { final CompoundCommand cmd = new CompoundCommand("Destroy Axis Element Command"); - EditingDomain domain = getContextEditingDomain(); + TransactionalEditingDomain domain = getContextEditingDomain(); for(Integer integer : axisPosition) { cmd.append(getDestroyAxisElementCommand(domain, integer)); } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/CompositeAxisManager.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/CompositeAxisManager.java index b2fa427521c..a5c753972fb 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/CompositeAxisManager.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/CompositeAxisManager.java @@ -25,7 +25,6 @@ import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.command.CompoundCommand; import org.eclipse.emf.common.command.UnexecutableCommand; import org.eclipse.emf.edit.command.MoveCommand; -import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.emf.transaction.util.TransactionUtil; import org.eclipse.gmf.runtime.common.core.command.ICommand; @@ -125,7 +124,7 @@ public class CompositeAxisManager extends AbstractAxisManager implements ICompos /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getAddAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -133,7 +132,7 @@ public class CompositeAxisManager extends AbstractAxisManager implements ICompos * @return */ @Override - public Command getAddAxisCommand(final EditingDomain domain, final Collection objectToAdd) { + public Command getAddAxisCommand(final TransactionalEditingDomain domain, final Collection objectToAdd) { final CompoundCommand cmd = new CompoundCommand(Messages.CompositeAxisManager_AddAxisCommand); for(final IAxisManager current : this.subManagers) { final Command tmp = current.getAddAxisCommand(domain, objectToAdd); @@ -149,7 +148,7 @@ public class CompositeAxisManager extends AbstractAxisManager implements ICompos /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getComplementaryAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getComplementaryAddAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -157,7 +156,7 @@ public class CompositeAxisManager extends AbstractAxisManager implements ICompos * @return */ @Override - public Command getComplementaryAddAxisCommand(final EditingDomain domain, final Collection objectToAdd) { + public Command getComplementaryAddAxisCommand(final TransactionalEditingDomain domain, final Collection objectToAdd) { final CompoundCommand cmd = new CompoundCommand(Messages.CompositeAxisManager_AddAxisCommand); for(final IAxisManager current : this.subManagers) { final Command tmp = current.getComplementaryAddAxisCommand(domain, objectToAdd); @@ -270,7 +269,7 @@ public class CompositeAxisManager extends AbstractAxisManager implements ICompos /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getDestroyAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getDestroyAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -278,7 +277,7 @@ public class CompositeAxisManager extends AbstractAxisManager implements ICompos * @return */ @Override - public Command getDestroyAxisCommand(EditingDomain domain, Collection objectToDestroy) { + public Command getDestroyAxisCommand(TransactionalEditingDomain domain, Collection objectToDestroy) { final CompoundCommand cmd = new CompoundCommand(Messages.CompositeAxisManager_DestroyAxisCommand); for(final IAxisManager current : this.subManagers) { final Command tmp = current.getDestroyAxisCommand(domain, objectToDestroy); @@ -369,7 +368,7 @@ public class CompositeAxisManager extends AbstractAxisManager implements ICompos */ public void moveAxis(Object elementToMove, int newIndex) { if(!isDynamic() && elementToMove instanceof IAxis) { - EditingDomain domain = getTableEditingDomain(); + TransactionalEditingDomain domain = getTableEditingDomain(); final Command command = MoveCommand.create(domain, getRepresentedContentProvider(), NattableaxisproviderPackage.eINSTANCE.getAxisProvider_Axis(), elementToMove, newIndex); domain.getCommandStack().execute(command); }; @@ -475,7 +474,7 @@ public class CompositeAxisManager extends AbstractAxisManager implements ICompos /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(TransactionalEditingDomain, * java.lang.Integer) * * @param domain @@ -483,7 +482,7 @@ public class CompositeAxisManager extends AbstractAxisManager implements ICompos * @return */ @Override - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { final List elements = tableManager.getElementsList(getRepresentedContentProvider());//FIXME create a util method for that final Object element = elements.get(axisPosition); if(element instanceof IAxis) { diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/IAxisManager.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/IAxisManager.java index 4e7cbeed2c3..da2eb0718ef 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/IAxisManager.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/IAxisManager.java @@ -17,7 +17,7 @@ import java.util.Collection; import java.util.List; import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.nebula.widgets.nattable.ui.NatEventData; import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager; import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager; @@ -55,7 +55,7 @@ public interface IAxisManager extends IDisposable { * the object to add * @return the command to add an axis to the emf model */ - public Command getAddAxisCommand(final EditingDomain domain, final Collection objectToAdd); + public Command getAddAxisCommand(final TransactionalEditingDomain domain, final Collection objectToAdd); /** * @@ -66,7 +66,7 @@ public interface IAxisManager extends IDisposable { * @return the complementary command, which is called by the master on the * slave to add required axis */ - public Command getComplementaryAddAxisCommand(final EditingDomain domain, final Collection objectToAdd); + public Command getComplementaryAddAxisCommand(final TransactionalEditingDomain domain, final Collection objectToAdd); /** * @@ -142,7 +142,7 @@ public interface IAxisManager extends IDisposable { * @param objectToDestroy * @return */ - public Command getDestroyAxisCommand(EditingDomain domain, Collection objectToDestroy); + public Command getDestroyAxisCommand(TransactionalEditingDomain domain, Collection objectToDestroy); /** * @@ -263,7 +263,7 @@ public interface IAxisManager extends IDisposable { * @param axisPosition * @return */ - public Command getDestroyAxisElementCommand(final EditingDomain domain, final Integer axisPosition); + public Command getDestroyAxisElementCommand(final TransactionalEditingDomain domain, final Integer axisPosition); /** * An axis provider determines if it can be saved as a configuration for later retrieval or not. It makes sense to save configurations of diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java index 3a2d7ca61be..6be08dbd245 100644 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java @@ -30,7 +30,6 @@ import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.impl.AdapterImpl; import org.eclipse.emf.edit.command.SetCommand; -import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; @@ -69,7 +68,7 @@ import org.eclipse.papyrus.infra.nattable.utils.AxisUtils; import org.eclipse.papyrus.infra.nattable.utils.HeaderAxisConfigurationManagementUtils; import org.eclipse.papyrus.infra.nattable.utils.NattableConfigAttributes; import org.eclipse.papyrus.infra.nattable.utils.StringComparator; -import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainuUtils; +import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainUtils; import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService; @@ -475,7 +474,7 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen * the list of the objects to add in rows */ public void addRows(final Collection objectsToAdd) { - final EditingDomain domain = getContextEditingDomain(); + final TransactionalEditingDomain domain = getContextEditingDomain(); final Command cmd = getAddRowElementCommand(objectsToAdd); if(cmd != null && cmd.canExecute()) { domain.getCommandStack().execute(cmd); @@ -505,7 +504,7 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen * the list of the objects to add in columns */ public void addColumns(final Collection objectsToAdd) { - final EditingDomain domain = getContextEditingDomain(); + final TransactionalEditingDomain domain = getContextEditingDomain(); final Command cmd = getAddColumnElementCommand(objectsToAdd); if(cmd != null && cmd.canExecute()) { domain.getCommandStack().execute(cmd); @@ -517,8 +516,8 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen * * @return */ - private EditingDomain getTableEditingDomain() { - return TableEditingDomainuUtils.getTableContextEditingDomain(getTable()); + private TransactionalEditingDomain getTableEditingDomain() { + return TableEditingDomainUtils.getTableContextEditingDomain(getTable()); } /** @@ -526,8 +525,8 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen * * @return */ - private EditingDomain getContextEditingDomain() { - return TableEditingDomainuUtils.getTableContextEditingDomain(getTable()); + private TransactionalEditingDomain getContextEditingDomain() { + return TableEditingDomainUtils.getTableContextEditingDomain(getTable()); } /** @@ -737,7 +736,7 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen */ public void invertAxis() { final CompoundCommand cmd = new CompoundCommand(Messages.NattableModelManager_SwitchLinesAndColumns); - final EditingDomain domain = getContextEditingDomain(); + final TransactionalEditingDomain domain = getContextEditingDomain(); boolean oldValue = getTable().isInvertAxis(); if(canInvertAxis()) { Command tmp = new SetCommand(domain, getTable(), NattablePackage.eINSTANCE.getTable_InvertAxis(), !oldValue); @@ -760,7 +759,7 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen } public Command getAddRowElementCommand(Collection objectsToAdd) { - final EditingDomain domain = getContextEditingDomain(); + final TransactionalEditingDomain domain = getContextEditingDomain(); final CompoundCommand cmd = new CompoundCommand(Messages.NattableModelManager_AddRowCommand); Command tmp = this.rowManager.getAddAxisCommand(domain, objectsToAdd); if(tmp != null) { @@ -779,7 +778,7 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen } public Command getAddColumnElementCommand(Collection objectsToAdd) { - final EditingDomain domain = getContextEditingDomain(); + final TransactionalEditingDomain domain = getContextEditingDomain(); final CompoundCommand cmd = new CompoundCommand(Messages.NattableModelManager_AddColumnCommand); Command tmp = this.columnManager.getAddAxisCommand(domain, objectsToAdd); if(tmp != null) { @@ -798,13 +797,13 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen } public Command getDestroyColumnElementCommand(Collection objectsToDestroy) { - final EditingDomain domain = getContextEditingDomain(); + final TransactionalEditingDomain domain = getContextEditingDomain(); final Command cmd = this.columnManager.getDestroyAxisCommand(domain, objectsToDestroy); return cmd; } public Command getDestroyRowElementCommand(Collection objectsToDestroy) { - final EditingDomain domain = getContextEditingDomain(); + final TransactionalEditingDomain domain = getContextEditingDomain(); final Command cmd = this.rowManager.getDestroyAxisCommand(domain, objectsToDestroy); return cmd; } diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableEditingDomainUtils.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableEditingDomainUtils.java new file mode 100644 index 00000000000..ee02a9c5342 --- /dev/null +++ b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableEditingDomainUtils.java @@ -0,0 +1,74 @@ +/***************************************************************************** + * 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.nattable.utils; + +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject; +import org.eclipse.papyrus.infra.nattable.Activator; +import org.eclipse.papyrus.infra.nattable.messages.Messages; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; + +/** + * + * Utils class to get the best editing domain to use + * + */ +public class TableEditingDomainUtils { + + /** + * + * Constructor. + * + */ + private TableEditingDomainUtils() { + //to prevent instanciation + } + + /** + * Returns the EditingDomain associated to the table + * + * @return + * the EditingDomain associated to the table + */ + public static final TransactionalEditingDomain getTableEditingDomain(final Table table) { + ServicesRegistry registry = null; + try { + registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(table); + return (TransactionalEditingDomain)registry.getService(TransactionalEditingDomain.class); + } catch (final ServiceException e) { + Activator.log.error(Messages.NattableModelManager_ServiceRegistryNotFound, e); + } + return null; + + } + + /** + * Returns the EditingDomain associated to the context + * + * @return + * the EditingDomain associated to the context + */ + public static final TransactionalEditingDomain getTableContextEditingDomain(final Table table) { + ServicesRegistry registry = null; + try { + registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(table.getContext()); + return (TransactionalEditingDomain)registry.getService(TransactionalEditingDomain.class); + } catch (final ServiceException e) { + Activator.log.error(Messages.NattableModelManager_ServiceRegistryNotFound, e); + } + return null; + } +} diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableEditingDomainuUtils.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableEditingDomainuUtils.java deleted file mode 100644 index 95d82922775..00000000000 --- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableEditingDomainuUtils.java +++ /dev/null @@ -1,75 +0,0 @@ -/***************************************************************************** - * 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.nattable.utils; - -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject; -import org.eclipse.papyrus.infra.nattable.Activator; -import org.eclipse.papyrus.infra.nattable.messages.Messages; -import org.eclipse.papyrus.infra.nattable.model.nattable.Table; - -/** - * - * Utils class to get the best editing domain to use - * - */ -public class TableEditingDomainuUtils { - - /** - * - * Constructor. - * - */ - private TableEditingDomainuUtils() { - //to prevent instanciation - } - - /** - * Returns the EditingDomain associated to the table - * - * @return - * the EditingDomain associated to the table - */ - public static final TransactionalEditingDomain getTableEditingDomain(final Table table) { - ServicesRegistry registry = null; - try { - registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(table); - return (TransactionalEditingDomain)registry.getService(EditingDomain.class); - } catch (final ServiceException e) { - Activator.log.error(Messages.NattableModelManager_ServiceRegistryNotFound, e); - } - return null; - - } - - /** - * Returns the EditingDomain associated to the context - * - * @return - * the EditingDomain associated to the context - */ - public static final TransactionalEditingDomain getTableContextEditingDomain(final Table table) { - ServicesRegistry registry = null; - try { - registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(table.getContext()); - return (TransactionalEditingDomain)registry.getService(EditingDomain.class); - } catch (final ServiceException e) { - Activator.log.error(Messages.NattableModelManager_ServiceRegistryNotFound, e); - } - return null; - } -} diff --git a/extraplugins/table/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/AllocateAxisManager.java b/extraplugins/table/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/AllocateAxisManager.java index e0a292d2354..3df877ea838 100644 --- a/extraplugins/table/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/AllocateAxisManager.java +++ b/extraplugins/table/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/AllocateAxisManager.java @@ -17,11 +17,9 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.impl.AdapterImpl; import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType; import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; @@ -116,14 +114,14 @@ public class AllocateAxisManager extends AbstractSynchronizedOnFeatureAxisManage /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(TransactionalEditingDomain, * java.lang.Integer) * * @param domain * @param axisPosition * @return */ - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { final Object current = getElements().get(axisPosition); EObject elementToDestroy = null; if(current instanceof EObjectAxis) { diff --git a/extraplugins/table/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java b/extraplugins/table/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java index bc96d4c2f8b..4da33e3596a 100644 --- a/extraplugins/table/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java +++ b/extraplugins/table/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java @@ -17,23 +17,18 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.AdapterImpl; import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType; import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; import org.eclipse.papyrus.infra.emf.utils.EMFHelper; -import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractSynchronizedOnFeatureAxisManager; import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.EObjectAxis; import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; import org.eclipse.papyrus.sysml.service.types.matcher.RequirementMatcher; import org.eclipse.papyrus.uml.nattable.manager.axis.AbstractUMLSynchronizedOnFeatureAxisManager; -import org.eclipse.uml2.uml.UMLPackage; /** @@ -118,14 +113,14 @@ public class RequirementAxisManager extends AbstractUMLSynchronizedOnFeatureAxis /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisElementCommand(TransactionalEditingDomain, * java.lang.Integer) * * @param domain * @param axisPosition * @return */ - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { final Object current = getElements().get(axisPosition); if(current instanceof EObjectAxis) { final EObject element = ((EObjectAxis)current).getElement(); diff --git a/extraplugins/table/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java b/extraplugins/table/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java index e36b83b1363..fe636f3b6ea 100644 --- a/extraplugins/table/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java +++ b/extraplugins/table/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java @@ -62,7 +62,7 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getComplementaryAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getComplementaryAddAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -70,7 +70,7 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager { * @return */ @Override - public Command getComplementaryAddAxisCommand(final EditingDomain domain, final Collection objectToAdd) { + public Command getComplementaryAddAxisCommand(final TransactionalEditingDomain domain, final Collection objectToAdd) { final Set appliedStereotypes = new HashSet(); for(final Object current : objectToAdd) { if(current instanceof Element) { @@ -105,7 +105,7 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getAddAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -113,7 +113,7 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager { * @return */ @Override - public Command getAddAxisCommand(EditingDomain domain, Collection objectToAdd) { + public Command getAddAxisCommand(TransactionalEditingDomain domain, Collection objectToAdd) { final List allPropertyQN = new ArrayList(); for(Object object : objectToAdd) { if(object instanceof Property) { @@ -157,7 +157,7 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager { * @return */ - public boolean canInsertAxis(EditingDomain domain, Collection objectsToAdd, int index) { + public boolean canInsertAxis(TransactionalEditingDomain domain, Collection objectsToAdd, int index) { return false; } @@ -189,7 +189,7 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager { /** * - * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisCommand(org.eclipse.emf.edit.domain.EditingDomain, + * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#getDestroyAxisCommand(TransactionalEditingDomain, * java.util.Collection) * * @param domain @@ -198,7 +198,7 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager { * @return */ @Override - public Command getDestroyAxisCommand(EditingDomain domain, Collection umlProperties) { + public Command getDestroyAxisCommand(TransactionalEditingDomain domain, Collection umlProperties) { IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getRepresentedContentProvider()); final CompositeCommand compositeCommand = new CompositeCommand("Destroy IAxis Command"); final List propIdToDestroy = new ArrayList(); @@ -290,7 +290,7 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager { return false; } - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { return UnexecutableCommand.INSTANCE; } diff --git a/sandbox/org.eclipse.papyrus.uml.nattable.ws.preferences/src/org/eclipse/papyrus/uml/nattable/ws/preferences/manager/axis/PropertyFileAxisManager.java b/sandbox/org.eclipse.papyrus.uml.nattable.ws.preferences/src/org/eclipse/papyrus/uml/nattable/ws/preferences/manager/axis/PropertyFileAxisManager.java index 48a852e4e98..ba02dd97372 100644 --- a/sandbox/org.eclipse.papyrus.uml.nattable.ws.preferences/src/org/eclipse/papyrus/uml/nattable/ws/preferences/manager/axis/PropertyFileAxisManager.java +++ b/sandbox/org.eclipse.papyrus.uml.nattable.ws.preferences/src/org/eclipse/papyrus/uml/nattable/ws/preferences/manager/axis/PropertyFileAxisManager.java @@ -26,7 +26,7 @@ import java.util.Properties; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.nebula.widgets.nattable.ui.NatEventData; import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractSynchronizedOnFeatureAxisManager; import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager; @@ -106,7 +106,7 @@ public class PropertyFileAxisManager extends AbstractSynchronizedOnFeatureAxisMa } @Override - public Command getAddAxisCommand(EditingDomain domain, Collection objectToAdd) { + public Command getAddAxisCommand(TransactionalEditingDomain domain, Collection objectToAdd) { return super.getAddAxisCommand(domain, objectToAdd); } @@ -116,7 +116,7 @@ public class PropertyFileAxisManager extends AbstractSynchronizedOnFeatureAxisMa } @Override - public Command getComplementaryAddAxisCommand(EditingDomain domain, Collection objectToAdd) { + public Command getComplementaryAddAxisCommand(TransactionalEditingDomain domain, Collection objectToAdd) { return super.getComplementaryAddAxisCommand(domain, objectToAdd); } @@ -146,7 +146,7 @@ public class PropertyFileAxisManager extends AbstractSynchronizedOnFeatureAxisMa } @Override - public Command getDestroyAxisCommand(EditingDomain domain, Collection objectToDestroy) { + public Command getDestroyAxisCommand(TransactionalEditingDomain domain, Collection objectToDestroy) { return super.getDestroyAxisCommand(domain, objectToDestroy); } @@ -211,15 +211,6 @@ public class PropertyFileAxisManager extends AbstractSynchronizedOnFeatureAxisMa return prop; } - @Override - protected EditingDomain getTableEditingDomain() { - return super.getTableEditingDomain(); - } - - @Override - protected EditingDomain getContextEditingDomain() { - return super.getContextEditingDomain(); - } @Override public void moveAxis(Object elementToMove, int newIndex) { @@ -297,7 +288,7 @@ public class PropertyFileAxisManager extends AbstractSynchronizedOnFeatureAxisMa } @Override - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { return null; } diff --git a/sandbox/org.eclipse.papyrus.uml.nattable.ws.preferences/src/org/eclipse/papyrus/uml/nattable/ws/preferences/manager/axis/PropertyFilePropertyAxisManager.java b/sandbox/org.eclipse.papyrus.uml.nattable.ws.preferences/src/org/eclipse/papyrus/uml/nattable/ws/preferences/manager/axis/PropertyFilePropertyAxisManager.java index 1658fad64ed..2afb7ae9574 100644 --- a/sandbox/org.eclipse.papyrus.uml.nattable.ws.preferences/src/org/eclipse/papyrus/uml/nattable/ws/preferences/manager/axis/PropertyFilePropertyAxisManager.java +++ b/sandbox/org.eclipse.papyrus.uml.nattable.ws.preferences/src/org/eclipse/papyrus/uml/nattable/ws/preferences/manager/axis/PropertyFilePropertyAxisManager.java @@ -24,7 +24,7 @@ import java.util.Properties; import java.util.Set; import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.nebula.widgets.nattable.ui.NatEventData; import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager; import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager; @@ -79,7 +79,7 @@ public class PropertyFilePropertyAxisManager extends AbstractAxisManager { } @Override - public Command getAddAxisCommand(EditingDomain domain, Collection objectToAdd) { + public Command getAddAxisCommand(TransactionalEditingDomain domain, Collection objectToAdd) { return super.getAddAxisCommand(domain, objectToAdd); } @@ -89,7 +89,7 @@ public class PropertyFilePropertyAxisManager extends AbstractAxisManager { } @Override - public Command getComplementaryAddAxisCommand(EditingDomain domain, Collection objectToAdd) { + public Command getComplementaryAddAxisCommand(TransactionalEditingDomain domain, Collection objectToAdd) { return super.getComplementaryAddAxisCommand(domain, objectToAdd); } @@ -119,7 +119,7 @@ public class PropertyFilePropertyAxisManager extends AbstractAxisManager { } @Override - public Command getDestroyAxisCommand(EditingDomain domain, Collection objectToDestroy) { + public Command getDestroyAxisCommand(TransactionalEditingDomain domain, Collection objectToDestroy) { return super.getDestroyAxisCommand(domain, objectToDestroy); } @@ -169,16 +169,6 @@ public class PropertyFilePropertyAxisManager extends AbstractAxisManager { return values; } - @Override - protected EditingDomain getTableEditingDomain() { - return super.getTableEditingDomain(); - } - - @Override - protected EditingDomain getContextEditingDomain() { - return super.getContextEditingDomain(); - } - @Override public void moveAxis(Object elementToMove, int newIndex) { super.moveAxis(elementToMove, newIndex); @@ -255,7 +245,7 @@ public class PropertyFilePropertyAxisManager extends AbstractAxisManager { } @Override - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { return null; } @@ -264,4 +254,9 @@ public class PropertyFilePropertyAxisManager extends AbstractAxisManager { return true; } + @Override + public boolean canBeSavedAsConfig() { + return false; + } + } 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 7c696ca2701..2a8e1f0354f 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 @@ -14,7 +14,7 @@ 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.emf.transaction.TransactionalEditingDomain; import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager; /** @@ -47,7 +47,7 @@ public class DerivedUMLPropertiesAxisManager extends AbstractAxisManager { return false; } - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain 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 5279d4a8e7c..0d6fab4fb35 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 @@ -20,7 +20,6 @@ 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; @@ -63,7 +62,7 @@ public class SynchronizedFeatureValueAxisManager extends AbstractSynchronizedOnF return true; } - public Command getDestroyAxisElementCommand(EditingDomain domain, Integer axisPosition) { + public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) { final Object current = getElements().get(axisPosition); EObject elementToDestroy = null; if(current instanceof EObjectAxis) { 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 5e6639ff674..0542d21c911 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 @@ -14,7 +14,7 @@ package org.eclipse.papyrus.views.properties.table.cell; import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; 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; @@ -71,7 +71,7 @@ public class DerivedUMLPropertiesCellManager extends AbstractCellManager impleme /** * {@inheritDoc} */ - public Command getSetValueCommand(EditingDomain domain, Object columnElement, Object rowElemenet, Object newValue) { + public Command getSetValueCommand(TransactionalEditingDomain domain, Object columnElement, Object rowElemenet, Object newValue) { MultiplicityElement element = getMultiplicityElement(columnElement, rowElemenet); -- cgit v1.2.3