From 659f9609187e0ada22c6451d7a4927efa5a14583 Mon Sep 17 00:00:00 2001 From: vlorenzo Date: Mon, 29 Apr 2013 13:20:51 +0000 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 Correct a small name error in the table metamodel + fix the customization of the header and the label according to the new table metamodel + fix table icon problem --- .../META-INF/MANIFEST.MF | 8 +- .../common/factory/NattableEditorFactory.java | 8 +- ...EStructuralFeatureValueFillingConfiguration.gif | Bin 0 -> 223 bytes ...AxisConfigurations_FeatureAxisConfiguration.gif | Bin 0 -> 223 bytes ...ownedAxisConfigurations_IPasteConfiguration.gif | Bin 0 -> 223 bytes ...xisConfigurations_PasteEObjectConfiguration.gif | Bin 0 -> 223 bytes ...gurations_FeatureLabelProviderConfiguration.gif | Bin 0 -> 223 bytes ...igurations_ObjectLabelProviderConfiguration.gif | Bin 0 -> 223 bytes .../plugin.properties | 2 + ...bstractHeaderAxisConfigurationItemProvider.java | 20 +- .../plugin.xml | 6 + .../model/nattable.ecore | 4 +- .../AbstractHeaderAxisConfiguration.java | 24 +- .../NattableaxisconfigurationPackage.java | 48 +-- .../impl/AbstractHeaderAxisConfigurationImpl.java | 76 ++--- .../impl/NattableaxisconfigurationPackageImpl.java | 12 +- .../resources/viewpage.nattableconfiguration | 6 +- .../config/utils/TableViewCreationTester.java | 2 +- .../org.eclipse.papyrus.infra.nattable/plugin.xml | 10 +- .../nattable/configuration/EditConfiguration.java | 2 +- .../dataprovider/AbstractHeaderDataProvider.java | 21 +- .../dataprovider/ColumnHeaderDataProvider.java | 4 +- .../dataprovider/RowHeaderDataProvider.java | 2 +- .../AbstractChangeHeaderConfigurationHandler.java | 27 +- ...stractChangeLabelConfigurationValueHandler.java | 117 ++++++- ...ractColumnChangeHeaderConfigurationHandler.java | 20 +- ...ColumnChangeLabelConfigurationValueHandler.java | 47 ++- ...bstractRowChangeHeaderConfigurationHandler.java | 25 +- ...actRowChangeLabelConfigurationValueHandler.java | 47 ++- .../manager/table/NattableModelManager.java | 352 ++++++++++----------- .../nattable/provider/TableLabelProvider.java | 14 +- .../HeaderAxisConfigurationManagementUtils.java | 39 ++- .../utils/LabelConfigurationManagementUtils.java | 16 +- .../utils/NattableWidgetPropertyTester.java | 4 +- .../configs/requirement.nattableconfiguration | 14 +- .../configs/generic.nattableconfiguration | 10 +- 36 files changed, 635 insertions(+), 352 deletions(-) create mode 100644 sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_EStructuralFeatureValueFillingConfiguration.gif create mode 100644 sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_FeatureAxisConfiguration.gif create mode 100644 sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_IPasteConfiguration.gif create mode 100644 sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_PasteEObjectConfiguration.gif create mode 100644 sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedLabelConfigurations_FeatureLabelProviderConfiguration.gif create mode 100644 sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedLabelConfigurations_ObjectLabelProviderConfiguration.gif (limited to 'sandbox') diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF index 950e37de53b..af4dd2798f5 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF @@ -11,12 +11,12 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.infra.nattable;bundle-version="0.10.0", org.eclipse.papyrus.infra.nattable.model;bundle-version="0.10.0", org.eclipse.emf.edit, - org.eclipse.papyrus.infra.core, + org.eclipse.papyrus.infra.core;bundle-version="0.10.0", org.eclipse.emf.transaction, org.eclipse.nebula.widgets.nattable.core;bundle-version="1.0.0", - org.eclipse.papyrus.infra.widgets, - org.eclipse.papyrus.infra.emf, - org.eclipse.papyrus.infra.gmfdiag.common, + org.eclipse.papyrus.infra.widgets;bundle-version="0.10.0", + org.eclipse.papyrus.infra.emf;bundle-version="0.10.0", + org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.0", org.eclipse.e4.ui.workbench, org.eclipse.e4.core.contexts, org.eclipse.core.expressions diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/factory/NattableEditorFactory.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/factory/NattableEditorFactory.java index fff65c6aa32..a285f1e5203 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/factory/NattableEditorFactory.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/factory/NattableEditorFactory.java @@ -15,7 +15,6 @@ package org.eclipse.papyrus.infra.nattable.common.factory; import java.lang.reflect.Constructor; -import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.papyrus.infra.core.editor.BackboneException; import org.eclipse.papyrus.infra.core.extension.diagrameditor.AbstractEditorFactory; import org.eclipse.papyrus.infra.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry; @@ -189,12 +188,7 @@ public class NattableEditorFactory extends AbstractEditorFactory { * */ public Image getTabIcon() { - ImageDescriptor imageDescriptor = getEditorDescriptor().getIcon(); - if(imageDescriptor == null) { - return null; - } - - return imageDescriptor.createImage(); + return org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImage(this.rawModel.getTableConfiguration().getIconPath()); } /** diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_EStructuralFeatureValueFillingConfiguration.gif b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_EStructuralFeatureValueFillingConfiguration.gif new file mode 100644 index 00000000000..c2326eff67c Binary files /dev/null and b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_EStructuralFeatureValueFillingConfiguration.gif differ diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_FeatureAxisConfiguration.gif b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_FeatureAxisConfiguration.gif new file mode 100644 index 00000000000..fdabbc265f7 Binary files /dev/null and b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_FeatureAxisConfiguration.gif differ diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_IPasteConfiguration.gif b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_IPasteConfiguration.gif new file mode 100644 index 00000000000..dfe51cfa69b Binary files /dev/null and b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_IPasteConfiguration.gif differ diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_PasteEObjectConfiguration.gif b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_PasteEObjectConfiguration.gif new file mode 100644 index 00000000000..3388fd398d0 Binary files /dev/null and b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedAxisConfigurations_PasteEObjectConfiguration.gif differ diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedLabelConfigurations_FeatureLabelProviderConfiguration.gif b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedLabelConfigurations_FeatureLabelProviderConfiguration.gif new file mode 100644 index 00000000000..7839cb59536 Binary files /dev/null and b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedLabelConfigurations_FeatureLabelProviderConfiguration.gif differ diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedLabelConfigurations_ObjectLabelProviderConfiguration.gif b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedLabelConfigurations_ObjectLabelProviderConfiguration.gif new file mode 100644 index 00000000000..c5dab99a76c Binary files /dev/null and b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/icons/full/ctool16/CreateAbstractHeaderAxisConfiguration_ownedLabelConfigurations_ObjectLabelProviderConfiguration.gif differ diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/plugin.properties b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/plugin.properties index e01f91c4018..494b04e2fec 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/plugin.properties +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/plugin.properties @@ -193,3 +193,5 @@ _UI_ObjectAxis_localLabelConfiguration_feature = Local Label Configuration _UI_EStructuralFeatureAxis_element_feature = Element _UI_AxisManagerRepresentation_specificAxisConfigurations_feature = Specific Axis Configurations _UI_AxisManagerConfiguration_localSpecificConfigurations_feature = Local Specific Configurations +_UI_AbstractHeaderAxisConfiguration_ownedLabelConfigurations_feature = Owned Label Configurations +_UI_AbstractHeaderAxisConfiguration_ownedAxisConfigurations_feature = Owned Axis Configurations diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AbstractHeaderAxisConfigurationItemProvider.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AbstractHeaderAxisConfigurationItemProvider.java index 0ee9ed4638e..eb8f3eb6738 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AbstractHeaderAxisConfigurationItemProvider.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AbstractHeaderAxisConfigurationItemProvider.java @@ -187,8 +187,8 @@ public class AbstractHeaderAxisConfigurationItemProvider public Collection getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); - childrenFeatures.add(NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION); - childrenFeatures.add(NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION); + childrenFeatures.add(NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS); + childrenFeatures.add(NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS); } return childrenFeatures; } @@ -239,8 +239,8 @@ public class AbstractHeaderAxisConfigurationItemProvider case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION: - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION: + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS: + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -260,32 +260,32 @@ public class AbstractHeaderAxisConfigurationItemProvider newChildDescriptors.add (createChildParameter - (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION, + (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS, NattablelabelproviderFactory.eINSTANCE.createObjectLabelProviderConfiguration())); newChildDescriptors.add (createChildParameter - (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION, + (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS, NattablelabelproviderFactory.eINSTANCE.createFeatureLabelProviderConfiguration())); newChildDescriptors.add (createChildParameter - (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION, + (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS, NattableaxisconfigurationFactory.eINSTANCE.createFeatureAxisConfiguration())); newChildDescriptors.add (createChildParameter - (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION, + (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS, NattableaxisconfigurationFactory.eINSTANCE.createEStructuralFeatureValueFillingConfiguration())); newChildDescriptors.add (createChildParameter - (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION, + (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS, NattableaxisconfigurationFactory.eINSTANCE.createIPasteConfiguration())); newChildDescriptors.add (createChildParameter - (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION, + (NattableaxisconfigurationPackage.Literals.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS, NattableaxisconfigurationFactory.eINSTANCE.createPasteEObjectConfiguration())); } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml index ee1840bc292..947eab38383 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml @@ -72,6 +72,7 @@ +null null null @@ -104,6 +105,7 @@ null null null +null null @@ -133,6 +135,7 @@ null +null null null @@ -163,6 +166,7 @@ null +null null null @@ -193,6 +197,7 @@ null +null null null @@ -223,5 +228,6 @@ null +null null null diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/model/nattable.ecore b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/model/nattable.ecore index ab4c8f81c27..f73102d0407 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/model/nattable.ecore +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/model/nattable.ecore @@ -124,10 +124,10 @@ - - diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/AbstractHeaderAxisConfiguration.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/AbstractHeaderAxisConfiguration.java index 1fb0ce82023..2da25008eb9 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/AbstractHeaderAxisConfiguration.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/AbstractHeaderAxisConfiguration.java @@ -30,8 +30,8 @@ import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.I *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#isDisplayLabel Display Label}
  • *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#isDisplayFilter Display Filter}
  • *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#isDisplayIndex Display Index}
  • - *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedLabelConfiguration Owned Label Configuration}
  • - *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedAxisConfiguration Owned Axis Configuration}
  • + *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedLabelConfigurations Owned Label Configurations}
  • + *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedAxisConfigurations Owned Axis Configurations}
  • * *

    * @@ -151,35 +151,35 @@ public interface AbstractHeaderAxisConfiguration extends EModelElement { void setDisplayIndex(boolean value); /** - * Returns the value of the 'Owned Label Configuration' containment reference list. + * Returns the value of the 'Owned Label Configurations' containment reference list. * The list contents are of type {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ILabelProviderConfiguration}. * *

    - * If the meaning of the 'Owned Label Configuration' containment reference list isn't clear, + * If the meaning of the 'Owned Label Configurations' containment reference list isn't clear, * there really should be more of a description here... *

    * - * @return the value of the 'Owned Label Configuration' containment reference list. - * @see org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.NattableaxisconfigurationPackage#getAbstractHeaderAxisConfiguration_OwnedLabelConfiguration() + * @return the value of the 'Owned Label Configurations' containment reference list. + * @see org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.NattableaxisconfigurationPackage#getAbstractHeaderAxisConfiguration_OwnedLabelConfigurations() * @model containment="true" * @generated */ - EList getOwnedLabelConfiguration(); + EList getOwnedLabelConfigurations(); /** - * Returns the value of the 'Owned Axis Configuration' containment reference list. + * Returns the value of the 'Owned Axis Configurations' containment reference list. * The list contents are of type {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.IAxisConfiguration}. * *

    - * If the meaning of the 'Owned Axis Configuration' containment reference list isn't clear, + * If the meaning of the 'Owned Axis Configurations' containment reference list isn't clear, * there really should be more of a description here... *

    * - * @return the value of the 'Owned Axis Configuration' containment reference list. - * @see org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.NattableaxisconfigurationPackage#getAbstractHeaderAxisConfiguration_OwnedAxisConfiguration() + * @return the value of the 'Owned Axis Configurations' containment reference list. + * @see org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.NattableaxisconfigurationPackage#getAbstractHeaderAxisConfiguration_OwnedAxisConfigurations() * @model containment="true" * @generated */ - EList getOwnedAxisConfiguration(); + EList getOwnedAxisConfigurations(); } // AbstractHeaderAxisConfiguration diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/NattableaxisconfigurationPackage.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/NattableaxisconfigurationPackage.java index d76c69a59fd..3df3187fe0c 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/NattableaxisconfigurationPackage.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/NattableaxisconfigurationPackage.java @@ -124,22 +124,22 @@ public interface NattableaxisconfigurationPackage extends EPackage { int ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 3; /** - * The feature id for the 'Owned Label Configuration' containment reference list. + * The feature id for the 'Owned Label Configurations' containment reference list. * * * @generated * @ordered */ - int ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 4; + int ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 4; /** - * The feature id for the 'Owned Axis Configuration' containment reference list. + * The feature id for the 'Owned Axis Configurations' containment reference list. * * * @generated * @ordered */ - int ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 5; + int ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 5; /** * The number of structural features of the 'Abstract Header Axis Configuration' class. @@ -343,22 +343,22 @@ public interface NattableaxisconfigurationPackage extends EPackage { int TABLE_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX = ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX; /** - * The feature id for the 'Owned Label Configuration' containment reference list. + * The feature id for the 'Owned Label Configurations' containment reference list. * * * @generated * @ordered */ - int TABLE_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION = ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION; + int TABLE_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS = ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS; /** - * The feature id for the 'Owned Axis Configuration' containment reference list. + * The feature id for the 'Owned Axis Configurations' containment reference list. * * * @generated * @ordered */ - int TABLE_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION = ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION; + int TABLE_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS = ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS; /** * The feature id for the 'Axis Managers' containment reference list. @@ -452,22 +452,22 @@ public interface NattableaxisconfigurationPackage extends EPackage { int LOCAL_TABLE_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX = ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX; /** - * The feature id for the 'Owned Label Configuration' containment reference list. + * The feature id for the 'Owned Label Configurations' containment reference list. * * * @generated * @ordered */ - int LOCAL_TABLE_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION = ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION; + int LOCAL_TABLE_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS = ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS; /** - * The feature id for the 'Owned Axis Configuration' containment reference list. + * The feature id for the 'Owned Axis Configurations' containment reference list. * * * @generated * @ordered */ - int LOCAL_TABLE_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION = ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION; + int LOCAL_TABLE_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS = ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS; /** * The feature id for the 'Axis Manager Configurations' containment reference list. @@ -775,26 +775,26 @@ public interface NattableaxisconfigurationPackage extends EPackage { EAttribute getAbstractHeaderAxisConfiguration_DisplayIndex(); /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedLabelConfiguration Owned Label Configuration}'. + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedLabelConfigurations Owned Label Configurations}'. * * - * @return the meta object for the containment reference list 'Owned Label Configuration'. - * @see org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedLabelConfiguration() + * @return the meta object for the containment reference list 'Owned Label Configurations'. + * @see org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedLabelConfigurations() * @see #getAbstractHeaderAxisConfiguration() * @generated */ - EReference getAbstractHeaderAxisConfiguration_OwnedLabelConfiguration(); + EReference getAbstractHeaderAxisConfiguration_OwnedLabelConfigurations(); /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedAxisConfiguration Owned Axis Configuration}'. + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedAxisConfigurations Owned Axis Configurations}'. * * - * @return the meta object for the containment reference list 'Owned Axis Configuration'. - * @see org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedAxisConfiguration() + * @return the meta object for the containment reference list 'Owned Axis Configurations'. + * @see org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration#getOwnedAxisConfigurations() * @see #getAbstractHeaderAxisConfiguration() * @generated */ - EReference getAbstractHeaderAxisConfiguration_OwnedAxisConfiguration(); + EReference getAbstractHeaderAxisConfiguration_OwnedAxisConfigurations(); /** * Returns the meta object for class '{@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AxisManagerRepresentation Axis Manager Representation}'. @@ -1115,20 +1115,20 @@ public interface NattableaxisconfigurationPackage extends EPackage { EAttribute ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX = eINSTANCE.getAbstractHeaderAxisConfiguration_DisplayIndex(); /** - * The meta object literal for the 'Owned Label Configuration' containment reference list feature. + * The meta object literal for the 'Owned Label Configurations' containment reference list feature. * * * @generated */ - EReference ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION = eINSTANCE.getAbstractHeaderAxisConfiguration_OwnedLabelConfiguration(); + EReference ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS = eINSTANCE.getAbstractHeaderAxisConfiguration_OwnedLabelConfigurations(); /** - * The meta object literal for the 'Owned Axis Configuration' containment reference list feature. + * The meta object literal for the 'Owned Axis Configurations' containment reference list feature. * * * @generated */ - EReference ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION = eINSTANCE.getAbstractHeaderAxisConfiguration_OwnedAxisConfiguration(); + EReference ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS = eINSTANCE.getAbstractHeaderAxisConfiguration_OwnedAxisConfigurations(); /** * The meta object literal for the '{@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.impl.AxisManagerRepresentationImpl Axis Manager Representation}' class. diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/impl/AbstractHeaderAxisConfigurationImpl.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/impl/AbstractHeaderAxisConfigurationImpl.java index 72b51b43d85..1c11a036aa3 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/impl/AbstractHeaderAxisConfigurationImpl.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/impl/AbstractHeaderAxisConfigurationImpl.java @@ -46,8 +46,8 @@ import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.I *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.impl.AbstractHeaderAxisConfigurationImpl#isDisplayLabel Display Label}
  • *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.impl.AbstractHeaderAxisConfigurationImpl#isDisplayFilter Display Filter}
  • *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.impl.AbstractHeaderAxisConfigurationImpl#isDisplayIndex Display Index}
  • - *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.impl.AbstractHeaderAxisConfigurationImpl#getOwnedLabelConfiguration Owned Label Configuration}
  • - *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.impl.AbstractHeaderAxisConfigurationImpl#getOwnedAxisConfiguration Owned Axis Configuration}
  • + *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.impl.AbstractHeaderAxisConfigurationImpl#getOwnedLabelConfigurations Owned Label Configurations}
  • + *
  • {@link org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.impl.AbstractHeaderAxisConfigurationImpl#getOwnedAxisConfigurations Owned Axis Configurations}
  • * *

    * @@ -135,24 +135,24 @@ public abstract class AbstractHeaderAxisConfigurationImpl extends EModelElementI protected boolean displayIndex = DISPLAY_INDEX_EDEFAULT; /** - * The cached value of the '{@link #getOwnedLabelConfiguration() Owned Label Configuration}' containment reference list. + * The cached value of the '{@link #getOwnedLabelConfigurations() Owned Label Configurations}' containment reference list. * * - * @see #getOwnedLabelConfiguration() + * @see #getOwnedLabelConfigurations() * @generated * @ordered */ - protected EList ownedLabelConfiguration; + protected EList ownedLabelConfigurations; /** - * The cached value of the '{@link #getOwnedAxisConfiguration() Owned Axis Configuration}' containment reference list. + * The cached value of the '{@link #getOwnedAxisConfigurations() Owned Axis Configurations}' containment reference list. * * - * @see #getOwnedAxisConfiguration() + * @see #getOwnedAxisConfigurations() * @generated * @ordered */ - protected EList ownedAxisConfiguration; + protected EList ownedAxisConfigurations; /** * @@ -262,11 +262,11 @@ public abstract class AbstractHeaderAxisConfigurationImpl extends EModelElementI * * @generated */ - public EList getOwnedLabelConfiguration() { - if (ownedLabelConfiguration == null) { - ownedLabelConfiguration = new EObjectContainmentEList(ILabelProviderConfiguration.class, this, NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION); + public EList getOwnedLabelConfigurations() { + if (ownedLabelConfigurations == null) { + ownedLabelConfigurations = new EObjectContainmentEList(ILabelProviderConfiguration.class, this, NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS); } - return ownedLabelConfiguration; + return ownedLabelConfigurations; } /** @@ -274,11 +274,11 @@ public abstract class AbstractHeaderAxisConfigurationImpl extends EModelElementI * * @generated */ - public EList getOwnedAxisConfiguration() { - if (ownedAxisConfiguration == null) { - ownedAxisConfiguration = new EObjectContainmentEList(IAxisConfiguration.class, this, NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION); + public EList getOwnedAxisConfigurations() { + if (ownedAxisConfigurations == null) { + ownedAxisConfigurations = new EObjectContainmentEList(IAxisConfiguration.class, this, NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS); } - return ownedAxisConfiguration; + return ownedAxisConfigurations; } /** @@ -289,10 +289,10 @@ public abstract class AbstractHeaderAxisConfigurationImpl extends EModelElementI @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION: - return ((InternalEList)getOwnedLabelConfiguration()).basicRemove(otherEnd, msgs); - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION: - return ((InternalEList)getOwnedAxisConfiguration()).basicRemove(otherEnd, msgs); + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS: + return ((InternalEList)getOwnedLabelConfigurations()).basicRemove(otherEnd, msgs); + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS: + return ((InternalEList)getOwnedAxisConfigurations()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -313,10 +313,10 @@ public abstract class AbstractHeaderAxisConfigurationImpl extends EModelElementI return isDisplayFilter(); case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX: return isDisplayIndex(); - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION: - return getOwnedLabelConfiguration(); - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION: - return getOwnedAxisConfiguration(); + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS: + return getOwnedLabelConfigurations(); + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS: + return getOwnedAxisConfigurations(); } return super.eGet(featureID, resolve, coreType); } @@ -342,13 +342,13 @@ public abstract class AbstractHeaderAxisConfigurationImpl extends EModelElementI case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX: setDisplayIndex((Boolean)newValue); return; - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION: - getOwnedLabelConfiguration().clear(); - getOwnedLabelConfiguration().addAll((Collection)newValue); + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS: + getOwnedLabelConfigurations().clear(); + getOwnedLabelConfigurations().addAll((Collection)newValue); return; - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION: - getOwnedAxisConfiguration().clear(); - getOwnedAxisConfiguration().addAll((Collection)newValue); + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS: + getOwnedAxisConfigurations().clear(); + getOwnedAxisConfigurations().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); @@ -374,11 +374,11 @@ public abstract class AbstractHeaderAxisConfigurationImpl extends EModelElementI case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX: setDisplayIndex(DISPLAY_INDEX_EDEFAULT); return; - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION: - getOwnedLabelConfiguration().clear(); + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS: + getOwnedLabelConfigurations().clear(); return; - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION: - getOwnedAxisConfiguration().clear(); + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS: + getOwnedAxisConfigurations().clear(); return; } super.eUnset(featureID); @@ -400,10 +400,10 @@ public abstract class AbstractHeaderAxisConfigurationImpl extends EModelElementI return displayFilter != DISPLAY_FILTER_EDEFAULT; case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX: return displayIndex != DISPLAY_INDEX_EDEFAULT; - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION: - return ownedLabelConfiguration != null && !ownedLabelConfiguration.isEmpty(); - case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION: - return ownedAxisConfiguration != null && !ownedAxisConfiguration.isEmpty(); + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS: + return ownedLabelConfigurations != null && !ownedLabelConfigurations.isEmpty(); + case NattableaxisconfigurationPackage.ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS: + return ownedAxisConfigurations != null && !ownedAxisConfigurations.isEmpty(); } return super.eIsSet(featureID); } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/impl/NattableaxisconfigurationPackageImpl.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/impl/NattableaxisconfigurationPackageImpl.java index ad2f849970a..238e5f50e99 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/impl/NattableaxisconfigurationPackageImpl.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/impl/NattableaxisconfigurationPackageImpl.java @@ -285,7 +285,7 @@ public class NattableaxisconfigurationPackageImpl extends EPackageImpl implement * * @generated */ - public EReference getAbstractHeaderAxisConfiguration_OwnedLabelConfiguration() { + public EReference getAbstractHeaderAxisConfiguration_OwnedLabelConfigurations() { return (EReference)abstractHeaderAxisConfigurationEClass.getEStructuralFeatures().get(4); } @@ -294,7 +294,7 @@ public class NattableaxisconfigurationPackageImpl extends EPackageImpl implement * * @generated */ - public EReference getAbstractHeaderAxisConfiguration_OwnedAxisConfiguration() { + public EReference getAbstractHeaderAxisConfiguration_OwnedAxisConfigurations() { return (EReference)abstractHeaderAxisConfigurationEClass.getEStructuralFeatures().get(5); } @@ -547,8 +547,8 @@ public class NattableaxisconfigurationPackageImpl extends EPackageImpl implement createEAttribute(abstractHeaderAxisConfigurationEClass, ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_LABEL); createEAttribute(abstractHeaderAxisConfigurationEClass, ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_FILTER); createEAttribute(abstractHeaderAxisConfigurationEClass, ABSTRACT_HEADER_AXIS_CONFIGURATION__DISPLAY_INDEX); - createEReference(abstractHeaderAxisConfigurationEClass, ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATION); - createEReference(abstractHeaderAxisConfigurationEClass, ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATION); + createEReference(abstractHeaderAxisConfigurationEClass, ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_LABEL_CONFIGURATIONS); + createEReference(abstractHeaderAxisConfigurationEClass, ABSTRACT_HEADER_AXIS_CONFIGURATION__OWNED_AXIS_CONFIGURATIONS); axisManagerRepresentationEClass = createEClass(AXIS_MANAGER_REPRESENTATION); createEAttribute(axisManagerRepresentationEClass, AXIS_MANAGER_REPRESENTATION__AXIS_MANAGER_ID); @@ -634,8 +634,8 @@ public class NattableaxisconfigurationPackageImpl extends EPackageImpl implement initEAttribute(getAbstractHeaderAxisConfiguration_DisplayLabel(), theEcorePackage.getEBoolean(), "displayLabel", "true", 1, 1, AbstractHeaderAxisConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$ initEAttribute(getAbstractHeaderAxisConfiguration_DisplayFilter(), theEcorePackage.getEBoolean(), "displayFilter", "false", 1, 1, AbstractHeaderAxisConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$ initEAttribute(getAbstractHeaderAxisConfiguration_DisplayIndex(), theEcorePackage.getEBoolean(), "displayIndex", "true", 1, 1, AbstractHeaderAxisConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$ - initEReference(getAbstractHeaderAxisConfiguration_OwnedLabelConfiguration(), theNattablelabelproviderPackage.getILabelProviderConfiguration(), null, "ownedLabelConfiguration", null, 0, -1, AbstractHeaderAxisConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference(getAbstractHeaderAxisConfiguration_OwnedAxisConfiguration(), this.getIAxisConfiguration(), null, "ownedAxisConfiguration", null, 0, -1, AbstractHeaderAxisConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference(getAbstractHeaderAxisConfiguration_OwnedLabelConfigurations(), theNattablelabelproviderPackage.getILabelProviderConfiguration(), null, "ownedLabelConfigurations", null, 0, -1, AbstractHeaderAxisConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference(getAbstractHeaderAxisConfiguration_OwnedAxisConfigurations(), this.getIAxisConfiguration(), null, "ownedAxisConfigurations", null, 0, -1, AbstractHeaderAxisConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEClass(axisManagerRepresentationEClass, AxisManagerRepresentation.class, "AxisManagerRepresentation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEAttribute(getAxisManagerRepresentation_AxisManagerId(), ecorePackage.getEString(), "axisManagerId", null, 1, 1, AxisManagerRepresentation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration index 96196d7537c..3992a664634 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration @@ -2,11 +2,11 @@ - - + + - + diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/utils/TableViewCreationTester.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/utils/TableViewCreationTester.java index 978d96adfb0..181c31d91d7 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/utils/TableViewCreationTester.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/utils/TableViewCreationTester.java @@ -24,7 +24,7 @@ import org.eclipse.papyrus.uml.tools.model.UmlModel; public class TableViewCreationTester implements ITableTester { - @Override + public IStatus isAllowed(Object context) { if(context instanceof EObject) { final EObject current = (EObject)context; diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/plugin.xml b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/plugin.xml index 8499ea7f208..d05df3969a7 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/plugin.xml +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/plugin.xml @@ -165,7 +165,7 @@ variable="selection"> @@ -180,7 +180,7 @@ variable="selection"> @@ -195,7 +195,7 @@ variable="selection"> @@ -210,7 +210,7 @@ variable="selection"> @@ -448,7 +448,7 @@ class="org.eclipse.papyrus.infra.nattable.utils.NattableWidgetPropertyTester" id="org.eclipse.papyrus.infra.nattable.tester" namespace="org.eclipse.papyrus.infra.nattable.tester" - properties="isNattableWidget, hasFeatureRowHeaderConfiguration, isFeatureColumnHeaderConfiguration" + properties="isNattableWidget, hasFeatureRowHeaderConfiguration, hasFeatureColumnHeaderConfiguration" type="org.eclipse.jface.viewers.IStructuredSelection">
    diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/configuration/EditConfiguration.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/configuration/EditConfiguration.java index 2312fdf60c8..bed844a511b 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/configuration/EditConfiguration.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/configuration/EditConfiguration.java @@ -28,8 +28,8 @@ import org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumul import org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter; import org.eclipse.nebula.widgets.nattable.style.DisplayMode; import org.eclipse.osgi.util.NLS; -import org.eclipse.papyrus.commands.Activator; import org.eclipse.papyrus.infra.emf.providers.EMFLabelProvider; +import org.eclipse.papyrus.infra.nattable.Activator; import org.eclipse.papyrus.infra.nattable.accumulator.CustomRowOverrideLabelAccumulator; import org.eclipse.papyrus.infra.nattable.celleditor.config.CellEditorConfigurationFactory; import org.eclipse.papyrus.infra.nattable.celleditor.config.IAxisCellEditorConfiguration; diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/AbstractHeaderDataProvider.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/AbstractHeaderDataProvider.java index 3ae1b036c6d..0ded58331ae 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/AbstractHeaderDataProvider.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/AbstractHeaderDataProvider.java @@ -48,6 +48,11 @@ public abstract class AbstractHeaderDataProvider extends AbstractDataProvider { */ private Adapter axisListener; + /** + * listener on the table + */ + private Adapter localHeaderConfigListener; + /** * the listen axis configuration */ @@ -65,6 +70,7 @@ public abstract class AbstractHeaderDataProvider extends AbstractDataProvider { this.listenAxisConfiguration = getAxisConfiguration(); initListeners(); this.manager.getTable().eAdapters().add(this.invertedListener); + this.manager.getTable().eAdapters().add(this.localHeaderConfigListener); initFields(); } @@ -107,6 +113,16 @@ public abstract class AbstractHeaderDataProvider extends AbstractDataProvider { } } }; + + this.localHeaderConfigListener = new AdapterImpl() { + + @Override + public void notifyChanged(Notification msg) { + if(msg.getFeature() == NattablePackage.eINSTANCE.getTable_LocalColumnHeaderAxisConfiguration() || msg.getFeature() == NattablePackage.eINSTANCE.getTable_LocalRowHeaderAxisConfiguration()) { + initFields(); + } + } + }; } /** @@ -158,8 +174,11 @@ public abstract class AbstractHeaderDataProvider extends AbstractDataProvider { * remove the listener */ protected void removeListeners() { - this.listenAxisConfiguration.eAdapters().remove(this.axisListener); + if(this.listenAxisConfiguration != null) { + this.listenAxisConfiguration.eAdapters().remove(this.axisListener); + } this.manager.getTable().eAdapters().remove(this.invertedListener); + this.manager.getTable().eAdapters().remove(this.localHeaderConfigListener); } /** diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/ColumnHeaderDataProvider.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/ColumnHeaderDataProvider.java index adc65c8941c..c7ace9a9810 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/ColumnHeaderDataProvider.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/ColumnHeaderDataProvider.java @@ -106,7 +106,7 @@ public class ColumnHeaderDataProvider extends AbstractHeaderDataProvider { */ @Override protected AbstractHeaderAxisConfiguration getAxisConfiguration() { - return HeaderAxisConfigurationManagementUtils.getUsedColumnAbstractHeaderAxisInTableConfiguration(this.manager.getTable()); + return HeaderAxisConfigurationManagementUtils.getColumnAbstractHeaderAxisUsedInTable(this.manager.getTable()); } /** @@ -129,6 +129,4 @@ public class ColumnHeaderDataProvider extends AbstractHeaderDataProvider { this.rowCount = newAxisCOunt; } - - } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/RowHeaderDataProvider.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/RowHeaderDataProvider.java index 94ed253f75a..e1d733ba457 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/RowHeaderDataProvider.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/RowHeaderDataProvider.java @@ -116,7 +116,7 @@ public class RowHeaderDataProvider extends AbstractHeaderDataProvider { */ @Override protected AbstractHeaderAxisConfiguration getAxisConfiguration() { - return HeaderAxisConfigurationManagementUtils.getUsedRowAbstractHeaderAxisInTableConfiguration(this.manager.getTable()); + return HeaderAxisConfigurationManagementUtils.getAbstractHeaderAxisConfigurationUsedInTable(this.manager.getTable()); } /** diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractChangeHeaderConfigurationHandler.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractChangeHeaderConfigurationHandler.java index 2a748dfb53b..6e97bd1aa6a 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractChangeHeaderConfigurationHandler.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractChangeHeaderConfigurationHandler.java @@ -18,11 +18,14 @@ import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.TableHeaderAxisConfiguration; +import org.eclipse.papyrus.infra.nattable.utils.HeaderAxisConfigurationManagementUtils; import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; import org.eclipse.ui.handlers.HandlerUtil; @@ -44,17 +47,33 @@ public abstract class AbstractChangeHeaderConfigurationHandler extends AbstractT * @throws ExecutionException */ public Object execute(ExecutionEvent event) throws ExecutionException { - final AbstractHeaderAxisConfiguration configuration = getEditedAxisConfiguration(); + AbstractHeaderAxisConfiguration configuration = getEditedAxisConfiguration(); + final CompositeCommand cmd = new CompositeCommand("ChangeHeaderConfigurationCommand"); //$NON-NLS-1$ + TransactionalEditingDomain domain = getEditingDomain(); + if(configuration instanceof TableHeaderAxisConfiguration) { + //we can't edit it, because it's comes from the initial configuration + configuration = HeaderAxisConfigurationManagementUtils.transformToLocalHeaderConfiguration((TableHeaderAxisConfiguration)configuration); + final Table table = getCurrentNattableModelManager().getTable(); + final IEditCommandRequest request = new SetRequest(domain, table, getLocalHeaderAxisConfigurationFeature(), configuration); + final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(table); + cmd.add(provider.getEditCommand(request)); + } Command command = event.getCommand(); boolean oldValue = HandlerUtil.toggleCommandState(command); - TransactionalEditingDomain domain = getEditingDomain(); final IEditCommandRequest request = new SetRequest(domain, configuration, getEditedFeature(), !oldValue); final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(configuration); - final ICommand cmd = provider.getEditCommand(request); + cmd.add(provider.getEditCommand(request)); domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd)); return null; } + /** + * + * @return + * + */ + protected abstract EStructuralFeature getLocalHeaderAxisConfigurationFeature(); + /** * * @return diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractChangeLabelConfigurationValueHandler.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractChangeLabelConfigurationValueHandler.java index 2b189838daa..76085e4b5d3 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractChangeLabelConfigurationValueHandler.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractChangeLabelConfigurationValueHandler.java @@ -13,16 +13,30 @@ *****************************************************************************/ package org.eclipse.papyrus.infra.nattable.handler; +import java.util.ArrayList; +import java.util.List; + import org.eclipse.core.commands.Command; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AxisManagerConfiguration; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AxisManagerRepresentation; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.LocalTableHeaderAxisConfiguration; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.NattableaxisconfigurationFactory; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.NattableaxisconfigurationPackage; +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.services.edit.service.ElementEditServiceUtils; import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; import org.eclipse.ui.handlers.HandlerUtil; @@ -44,13 +58,21 @@ public abstract class AbstractChangeLabelConfigurationValueHandler extends Abstr * @throws ExecutionException */ public Object execute(ExecutionEvent event) throws ExecutionException { - final ILabelProviderConfiguration labelConf = getEditedLabelConfiguration(); - TransactionalEditingDomain domain = getEditingDomain(); + final CompositeCommand cmd = new CompositeCommand("ChangeLabelConfigurationValueCommand"); //$NON-NLS-1$ + final TransactionalEditingDomain domain = getEditingDomain(); + ILabelProviderConfiguration labelConf = getLabelProviderConfiguration(); + ILabelProviderConfiguration editedLabelConf; + if(labelConf.eContainer() instanceof TableHeaderAxisConfiguration) { + editedLabelConf = EcoreUtil.copy(labelConf); + cmd.add(getRegisterLocalLabelConfigurationCommand(labelConf, editedLabelConf)); + } else { + editedLabelConf = labelConf; + } Command command = event.getCommand(); boolean oldValue = HandlerUtil.toggleCommandState(command); - final IEditCommandRequest request = new SetRequest(domain, labelConf, getEditedFeature(), !oldValue); - final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(labelConf); - final ICommand cmd = provider.getEditCommand(request); + final IEditCommandRequest request = new SetRequest(domain, editedLabelConf, getEditedFeature(), !oldValue); + final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(editedLabelConf); + cmd.add(provider.getEditCommand(request)); domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd)); return null; } @@ -60,7 +82,7 @@ public abstract class AbstractChangeLabelConfigurationValueHandler extends Abstr * @return * the edited label configuration */ - protected abstract ILabelProviderConfiguration getEditedLabelConfiguration(); + protected abstract ILabelProviderConfiguration getLabelProviderConfiguration(); /** * @@ -69,4 +91,87 @@ public abstract class AbstractChangeLabelConfigurationValueHandler extends Abstr */ protected abstract EStructuralFeature getEditedFeature(); + /** + * + * @param conf + * + */ + protected ICommand getRegisterLocalLabelConfigurationCommand(ILabelProviderConfiguration tableLabelConfiguration, ILabelProviderConfiguration localTableLabelConfiguration) { + TransactionalEditingDomain domain = getEditingDomain(); + final CompositeCommand cmd = new CompositeCommand("ChangeHeaderLabelConfigurationCommand"); //$NON-NLS-1$ + final Table table = getCurrentNattableModelManager().getTable(); + + //1. we must get or create the required LocalTableHeaderAxisConfiguration + AbstractHeaderAxisConfiguration configuration = getHeaderAxisConfiguration(); + LocalTableHeaderAxisConfiguration localConfig = null; + if(configuration instanceof LocalTableHeaderAxisConfiguration) { + localConfig = (LocalTableHeaderAxisConfiguration)configuration; + } else if(configuration instanceof TableHeaderAxisConfiguration) { + //we can't edit it, because it's comes from the initial configuration + configuration = HeaderAxisConfigurationManagementUtils.transformToLocalHeaderConfiguration((TableHeaderAxisConfiguration)configuration); + localConfig = (LocalTableHeaderAxisConfiguration)configuration; + final IEditCommandRequest request = new SetRequest(domain, table, getLocalHeaderAxisConfigurationFeature(), configuration); + final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(table); + cmd.add(provider.getEditCommand(request)); + } + + //2. this one must store the new label configuration + final IEditCommandRequest request = new SetRequest(domain, configuration, NattableaxisconfigurationPackage.eINSTANCE.getAbstractHeaderAxisConfiguration_OwnedLabelConfigurations(), localTableLabelConfiguration); + final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(configuration); + cmd.add(provider.getEditCommand(request)); + + //3. we must get or create the AxisManagerConfiguration(s) + final TableHeaderAxisConfiguration headerAxisConfig = getTableHeaderAxisConfiguration(); + + final List axisManagerConfiguration = new ArrayList(); + for(final AxisManagerRepresentation current : headerAxisConfig.getAxisManagers()) { + //we look for defined axis manager which uses the labelconfiguration defined in the table config + if(current.getHeaderLabelConfiguration() == tableLabelConfiguration) { + AxisManagerConfiguration currentConf = null; + //we look for an axis manager configuration mapped in this axis manager representation + for(final AxisManagerConfiguration axisConf : localConfig.getAxisManagerConfigurations()) { + if(axisConf.getAxisManager() == current) { + currentConf = axisConf; + } + } + if(currentConf == null) { + currentConf = NattableaxisconfigurationFactory.eINSTANCE.createAxisManagerConfiguration(); + currentConf.setAxisManager(current); + final IEditCommandRequest request2 = new SetRequest(domain, localConfig, NattableaxisconfigurationPackage.eINSTANCE.getLocalTableHeaderAxisConfiguration_AxisManagerConfigurations(), currentConf); + final IElementEditService provider2 = ElementEditServiceUtils.getCommandProvider(localConfig); + cmd.add(provider2.getEditCommand(request2)); + } + axisManagerConfiguration.add(currentConf); + } + } + + //4. these one must reference the LabelConfiguration + for(final AxisManagerConfiguration current : axisManagerConfiguration) { + final IEditCommandRequest request2 = new SetRequest(domain, current, NattableaxisconfigurationPackage.eINSTANCE.getAxisManagerConfiguration_LocalHeaderLabelConfiguration(), localTableLabelConfiguration); + final IElementEditService provider2 = ElementEditServiceUtils.getCommandProvider(current); + cmd.add(provider2.getEditCommand(request2)); + } + return cmd; + } + + /** + * + * @return + * the feature to use to edit the local header axis configuration + */ + protected abstract EStructuralFeature getLocalHeaderAxisConfigurationFeature(); + + /** + * + * @return + * the edited axis configuration + */ + protected abstract AbstractHeaderAxisConfiguration getHeaderAxisConfiguration(); + + /** + * + * @return + * the table header axis defined in the TableConfiguration and used for edited label axis configuration + */ + protected abstract TableHeaderAxisConfiguration getTableHeaderAxisConfiguration(); } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractColumnChangeHeaderConfigurationHandler.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractColumnChangeHeaderConfigurationHandler.java index e8eadd86b9e..ae1a6ee03c7 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractColumnChangeHeaderConfigurationHandler.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractColumnChangeHeaderConfigurationHandler.java @@ -13,6 +13,9 @@ *****************************************************************************/ package org.eclipse.papyrus.infra.nattable.handler; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.papyrus.infra.nattable.model.nattable.NattablePackage; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration; import org.eclipse.papyrus.infra.nattable.utils.HeaderAxisConfigurationManagementUtils; @@ -31,6 +34,21 @@ public abstract class AbstractColumnChangeHeaderConfigurationHandler extends Abs */ @Override protected AbstractHeaderAxisConfiguration getEditedAxisConfiguration() { - return HeaderAxisConfigurationManagementUtils.getColumnAbstractHeaderAxisInTable(getCurrentNattableModelManager().getTable()); + return HeaderAxisConfigurationManagementUtils.getColumnAbstractHeaderAxisUsedInTable(getCurrentNattableModelManager().getTable()); + } + + /** + * + * @see org.eclipse.papyrus.infra.nattable.handler.AbstractChangeHeaderConfigurationHandler#getLocalHeaderAxisConfigurationFeature() + * + * @return + */ + @Override + protected EStructuralFeature getLocalHeaderAxisConfigurationFeature() { + final Table table = getCurrentNattableModelManager().getTable(); + if(!table.isInvertAxis()) { + return NattablePackage.eINSTANCE.getTable_LocalColumnHeaderAxisConfiguration(); + } + return NattablePackage.eINSTANCE.getTable_LocalRowHeaderAxisConfiguration(); } } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractColumnChangeLabelConfigurationValueHandler.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractColumnChangeLabelConfigurationValueHandler.java index 6feb0642178..2abbce920f3 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractColumnChangeLabelConfigurationValueHandler.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractColumnChangeLabelConfigurationValueHandler.java @@ -13,7 +13,13 @@ *****************************************************************************/ package org.eclipse.papyrus.infra.nattable.handler; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.papyrus.infra.nattable.model.nattable.NattablePackage; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration; +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.LabelConfigurationManagementUtils; /** @@ -26,13 +32,48 @@ public abstract class AbstractColumnChangeLabelConfigurationValueHandler extends /** * - * @see org.eclipse.papyrus.infra.nattable.handler.AbstractChangeLabelConfigurationValueHandler#getEditedLabelConfiguration() + * @see org.eclipse.papyrus.infra.nattable.handler.AbstractChangeLabelConfigurationValueHandler#getLabelProviderConfiguration() * * @return */ @Override - protected ILabelProviderConfiguration getEditedLabelConfiguration() { - return LabelConfigurationManagementUtils.getColumnFeatureLabelConfigurationInTable(getCurrentNattableModelManager().getTable()); + protected ILabelProviderConfiguration getLabelProviderConfiguration() { + return LabelConfigurationManagementUtils.getUsedColumnFeatureLabelConfiguration(getCurrentNattableModelManager().getTable()); } + /** + * + * @see org.eclipse.papyrus.infra.nattable.handler.AbstractChangeLabelConfigurationValueHandler#getLocalHeaderAxisConfigurationFeature() + * + * @return + */ + @Override + protected EStructuralFeature getLocalHeaderAxisConfigurationFeature() { + Table table = getCurrentNattableModelManager().getTable(); + if(!table.isInvertAxis()) { + return NattablePackage.eINSTANCE.getTable_LocalColumnHeaderAxisConfiguration(); + } + return NattablePackage.eINSTANCE.getTable_LocalRowHeaderAxisConfiguration(); + } + + /** + * + * @return + * the edited axis configuration + */ + @Override + protected AbstractHeaderAxisConfiguration getHeaderAxisConfiguration() { + return HeaderAxisConfigurationManagementUtils.getColumnAbstractHeaderAxisUsedInTable(getCurrentNattableModelManager().getTable()); + } + + + /** + * + * @return + * the table header axis defined in the TableConfiguration and used for edited label axis configuration + */ + @Override + protected TableHeaderAxisConfiguration getTableHeaderAxisConfiguration() { + return (TableHeaderAxisConfiguration)HeaderAxisConfigurationManagementUtils.getColumnAbstractHeaderAxisInTableConfiguration(getCurrentNattableModelManager().getTable()); + } } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractRowChangeHeaderConfigurationHandler.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractRowChangeHeaderConfigurationHandler.java index 386895d9e16..069e61acd12 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractRowChangeHeaderConfigurationHandler.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractRowChangeHeaderConfigurationHandler.java @@ -13,6 +13,9 @@ *****************************************************************************/ package org.eclipse.papyrus.infra.nattable.handler; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.papyrus.infra.nattable.model.nattable.NattablePackage; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration; import org.eclipse.papyrus.infra.nattable.utils.HeaderAxisConfigurationManagementUtils; @@ -27,10 +30,28 @@ public abstract class AbstractRowChangeHeaderConfigurationHandler extends Abstra /** * * @return - * the edited axis configuration or null if it doesn't exists in the table + * the axis configuration used by the table, can't be null; */ @Override protected AbstractHeaderAxisConfiguration getEditedAxisConfiguration() { - return HeaderAxisConfigurationManagementUtils.getRowAbstractHeaderAxisInTable(getCurrentNattableModelManager().getTable()); + AbstractHeaderAxisConfiguration conf = HeaderAxisConfigurationManagementUtils.getAbstractHeaderAxisConfigurationUsedInTable(getCurrentNattableModelManager().getTable()); + return conf; } + + /** + * + * @see org.eclipse.papyrus.infra.nattable.handler.AbstractChangeHeaderConfigurationHandler#getLocalHeaderAxisConfigurationFeature() + * + * @return + */ + @Override + protected EStructuralFeature getLocalHeaderAxisConfigurationFeature() { + final Table table = getCurrentNattableModelManager().getTable(); + if(table.isInvertAxis()) { + return NattablePackage.eINSTANCE.getTable_LocalColumnHeaderAxisConfiguration(); + } + return NattablePackage.eINSTANCE.getTable_LocalRowHeaderAxisConfiguration(); + } + + } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractRowChangeLabelConfigurationValueHandler.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractRowChangeLabelConfigurationValueHandler.java index 1ca9d73e3f3..a1917a8bc25 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractRowChangeLabelConfigurationValueHandler.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/AbstractRowChangeLabelConfigurationValueHandler.java @@ -13,7 +13,13 @@ *****************************************************************************/ package org.eclipse.papyrus.infra.nattable.handler; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.papyrus.infra.nattable.model.nattable.NattablePackage; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration; +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.LabelConfigurationManagementUtils; @@ -27,13 +33,48 @@ public abstract class AbstractRowChangeLabelConfigurationValueHandler extends Ab /** * - * @see org.eclipse.papyrus.infra.nattable.handler.AbstractChangeLabelConfigurationValueHandler#getEditedLabelConfiguration() + * @see org.eclipse.papyrus.infra.nattable.handler.AbstractChangeLabelConfigurationValueHandler#getLabelProviderConfiguration() * * @return */ @Override - protected ILabelProviderConfiguration getEditedLabelConfiguration() { - return LabelConfigurationManagementUtils.getRowFeatureLabelConfigurationInTable(getCurrentNattableModelManager().getTable()); + protected ILabelProviderConfiguration getLabelProviderConfiguration() { + return LabelConfigurationManagementUtils.getUsedRowObjectLabelConfiguration(getCurrentNattableModelManager().getTable()); } + /** + * + * @see org.eclipse.papyrus.infra.nattable.handler.AbstractChangeLabelConfigurationValueHandler#getLocalHeaderAxisConfigurationFeature() + * + * @return + */ + @Override + protected EStructuralFeature getLocalHeaderAxisConfigurationFeature() { + Table table = getCurrentNattableModelManager().getTable(); + if(table.isInvertAxis()) { + return NattablePackage.eINSTANCE.getTable_LocalColumnHeaderAxisConfiguration(); + } + return NattablePackage.eINSTANCE.getTable_LocalRowHeaderAxisConfiguration(); + } + + /** + * + * @return + * the edited axis configuration + */ + @Override + protected AbstractHeaderAxisConfiguration getHeaderAxisConfiguration() { + return HeaderAxisConfigurationManagementUtils.getRowAbstractHeaderAxisUsedInTable(getCurrentNattableModelManager().getTable()); + } + + + /** + * + * @return + * the table header axis defined in the TableConfiguration and used for edited label axis configuration + */ + @Override + protected TableHeaderAxisConfiguration getTableHeaderAxisConfiguration() { + return (TableHeaderAxisConfiguration)HeaderAxisConfigurationManagementUtils.getRowAbstractHeaderAxisInTableConfiguration(getCurrentNattableModelManager().getTable()); + } } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java index 5f3a893695a..6cbc4e32524 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java @@ -19,6 +19,7 @@ import java.util.Collection; import java.util.EventObject; import java.util.List; +import org.eclipse.core.commands.State; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.command.CommandStack; import org.eclipse.emf.common.command.CommandStackListener; @@ -41,6 +42,7 @@ 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.command.CommandIds; import org.eclipse.papyrus.infra.nattable.manager.axis.AxisManagerFactory; import org.eclipse.papyrus.infra.nattable.manager.axis.CompositeAxisManager; import org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager; @@ -49,8 +51,13 @@ import org.eclipse.papyrus.infra.nattable.messages.Messages; import org.eclipse.papyrus.infra.nattable.model.nattable.NattablePackage; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.IAxis; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration; import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AxisManagerRepresentation; import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisprovider.AbstractAxisProvider; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.FeatureLabelProviderConfiguration; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ILabelProviderConfiguration; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ObjectLabelProviderConfiguration; +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.services.labelprovider.service.LabelProviderService; @@ -64,6 +71,8 @@ import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IWorkbenchPartSite; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.commands.ICommandService; public class NattableModelManager extends AbstractNattableWidgetManager implements INattableModelManager { @@ -209,168 +218,168 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen * this command update the status of the toggle actions */ protected void updateToggleActionState() {//FIXME - // final ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class); - // if(commandService != null) { - // final AbstractAxisConfiguration verticalAxisConfiguration = getColumnAxisConfiguration(); - // final AbstractAxisConfiguration horizontalAxisConfiguration = getRowAxisConfiguration(); - // if(verticalAxisConfiguration instanceof DefaultAxisConfiguration) { - // org.eclipse.core.commands.Command command = commandService.getCommand(CommandIds.COMMAND_COLUMN_DISPLAY_INDEX_ID); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(((DefaultAxisConfiguration)verticalAxisConfiguration).isDisplayIndex()); - // } - // } - // command = commandService.getCommand(CommandIds.COMMAND_COLUMN_DISPLAY_LABEL_ID); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(((DefaultAxisConfiguration)verticalAxisConfiguration).isDisplayLabel()); - // } - // } - // command = commandService.getCommand(CommandIds.COMMAND_COLUMN_DISPLAY_INDEX_STYLE_ID); - // if(command != null) { - // final State state = command.getState(CommandIds.RADIO_STATE); - // if(state != null) { - // state.setValue(((DefaultAxisConfiguration)verticalAxisConfiguration).getIndexStyle().getLiteral()); - // } - // } - // } - // - // if(horizontalAxisConfiguration instanceof DefaultAxisConfiguration) { - // - // org.eclipse.core.commands.Command command = commandService.getCommand(CommandIds.COMMAND_ROW_DISPLAY_INDEX_ID); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(((DefaultAxisConfiguration)horizontalAxisConfiguration).isDisplayIndex()); - // } - // } - // command = commandService.getCommand(CommandIds.COMMAND_ROW_DISPLAY_LABEL_ID); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(((DefaultAxisConfiguration)horizontalAxisConfiguration).isDisplayLabel()); - // } - // } - // command = commandService.getCommand(CommandIds.COMMAND_ROW_DISPLAY_INDEX_STYLE_ID); - // if(command != null) { - // final State state = command.getState(CommandIds.RADIO_STATE); - // if(state != null) { - // state.setValue(((DefaultAxisConfiguration)horizontalAxisConfiguration).getIndexStyle().getLiteral()); - // } - // } - // } - // - // - // //update the label header configuration - // final ILabelConfiguration columnLabelConfiguration = verticalAxisConfiguration.getLabelConfiguration(); - // final ILabelConfiguration rowLabelConfiguration = horizontalAxisConfiguration.getLabelConfiguration(); - // if(columnLabelConfiguration instanceof ObjectLabelProviderConfiguration) { - // final ObjectLabelProviderConfiguration labelConfig = (ObjectLabelProviderConfiguration)columnLabelConfiguration; - // org.eclipse.core.commands.Command command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_DISPLAY_ICON); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelConfig.isDisplayIcon()); - // } - // } - // - // command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_DISPLAY_LABEL); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelConfig.isDisplayLabel()); - // } - // } - // if(labelConfig instanceof FeatureLabelProviderConfiguration) { - // final FeatureLabelProviderConfiguration labelFeatureConf = (FeatureLabelProviderConfiguration)labelConfig; - // command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_FEATURE_DISPLAY_IS_DERIVED); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelFeatureConf.isDisplayIsDerived()); - // } - // } - // command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_FEATURE_DISPLAY_MULTIPLICITY); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelFeatureConf.isDisplayMultiplicity()); - // } - // } - // command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_FEATURE_DISPLAY_TYPE); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelFeatureConf.isDisplayType()); - // } - // } - // - // command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_FEATURE_DISPLAY_NAME); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelFeatureConf.isDisplayName()); - // } - // } - // } - // } - // - // if(rowLabelConfiguration instanceof ObjectLabelProviderConfiguration) { - // final ObjectLabelProviderConfiguration labelConfig = (ObjectLabelProviderConfiguration)rowLabelConfiguration; - // org.eclipse.core.commands.Command command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_DISPLAY_ICON); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelConfig.isDisplayIcon()); - // } - // } - // - // command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_DISPLAY_LABEL); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelConfig.isDisplayLabel()); - // } - // } - // if(labelConfig instanceof FeatureLabelProviderConfiguration) { - // final FeatureLabelProviderConfiguration labelFeatureConf = (FeatureLabelProviderConfiguration)labelConfig; - // command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_FEATURE_DISPLAY_IS_DERIVED); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelFeatureConf.isDisplayIsDerived()); - // } - // } - // command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_FEATURE_DISPLAY_MULTIPLICITY); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelFeatureConf.isDisplayMultiplicity()); - // } - // } - // command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_FEATURE_DISPLAY_TYPE); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelFeatureConf.isDisplayType()); - // } - // } - // - // command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_FEATURE_DISPLAY_NAME); - // if(command != null) { - // final State state = command.getState(CommandIds.TOGGLE_STATE); - // if(state != null) { - // state.setValue(labelFeatureConf.isDisplayName()); - // } - // } - // } - // } - // - // } else { - // throw new RuntimeException(String.format("The Eclipse service {0} has not been found", ICommandService.class)); - // } + final ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class); + if(commandService != null) { + + final AbstractHeaderAxisConfiguration columnAxisConfiguration = HeaderAxisConfigurationManagementUtils.getColumnAbstractHeaderAxisUsedInTable(this.table); + final AbstractHeaderAxisConfiguration rowAxisConfiguration = HeaderAxisConfigurationManagementUtils.getRowAbstractHeaderAxisUsedInTable(this.table); + //update the header configuration + org.eclipse.core.commands.Command command = commandService.getCommand(CommandIds.COMMAND_COLUMN_DISPLAY_INDEX_ID); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(columnAxisConfiguration.isDisplayIndex()); + } + } + command = commandService.getCommand(CommandIds.COMMAND_COLUMN_DISPLAY_LABEL_ID); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(columnAxisConfiguration.isDisplayLabel()); + } + } + command = commandService.getCommand(CommandIds.COMMAND_COLUMN_DISPLAY_INDEX_STYLE_ID); + if(command != null) { + final State state = command.getState(CommandIds.RADIO_STATE); + if(state != null) { + state.setValue(columnAxisConfiguration.getIndexStyle().getLiteral()); + } + } + + command = commandService.getCommand(CommandIds.COMMAND_ROW_DISPLAY_INDEX_ID); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(rowAxisConfiguration.isDisplayIndex()); + } + } + command = commandService.getCommand(CommandIds.COMMAND_ROW_DISPLAY_LABEL_ID); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(rowAxisConfiguration.isDisplayLabel()); + } + } + command = commandService.getCommand(CommandIds.COMMAND_ROW_DISPLAY_INDEX_STYLE_ID); + if(command != null) { + final State state = command.getState(CommandIds.RADIO_STATE); + if(state != null) { + state.setValue(rowAxisConfiguration.getIndexStyle().getLiteral()); + } + } + + //update the label header configuration + final List columnLabelConfigurations = columnAxisConfiguration.getOwnedLabelConfigurations(); + final List rowLabelConfigurations = rowAxisConfiguration.getOwnedLabelConfigurations(); + for(final ILabelProviderConfiguration current : columnLabelConfigurations) { + if(current instanceof ObjectLabelProviderConfiguration) { + final ObjectLabelProviderConfiguration labelConfig = (ObjectLabelProviderConfiguration)current; + command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_DISPLAY_ICON); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelConfig.isDisplayIcon()); + } + } + + command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_DISPLAY_LABEL); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelConfig.isDisplayLabel()); + } + } + if(labelConfig instanceof FeatureLabelProviderConfiguration) { + final FeatureLabelProviderConfiguration labelFeatureConf = (FeatureLabelProviderConfiguration)labelConfig; + command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_FEATURE_DISPLAY_IS_DERIVED); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelFeatureConf.isDisplayIsDerived()); + } + } + command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_FEATURE_DISPLAY_MULTIPLICITY); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelFeatureConf.isDisplayMultiplicity()); + } + } + command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_FEATURE_DISPLAY_TYPE); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelFeatureConf.isDisplayType()); + } + } + + command = commandService.getCommand(CommandIds.COMMAND_COLUMN_LABEL_FEATURE_DISPLAY_NAME); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelFeatureConf.isDisplayName()); + } + } + } + } + } + + for(final ILabelProviderConfiguration current : rowLabelConfigurations) { + if(current instanceof ObjectLabelProviderConfiguration) { + final ObjectLabelProviderConfiguration labelConfig = (ObjectLabelProviderConfiguration)current; + command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_DISPLAY_ICON); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelConfig.isDisplayIcon()); + } + } + + command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_DISPLAY_LABEL); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelConfig.isDisplayLabel()); + } + } + if(labelConfig instanceof FeatureLabelProviderConfiguration) { + final FeatureLabelProviderConfiguration labelFeatureConf = (FeatureLabelProviderConfiguration)labelConfig; + command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_FEATURE_DISPLAY_IS_DERIVED); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelFeatureConf.isDisplayIsDerived()); + } + } + command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_FEATURE_DISPLAY_MULTIPLICITY); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelFeatureConf.isDisplayMultiplicity()); + } + } + command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_FEATURE_DISPLAY_TYPE); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelFeatureConf.isDisplayType()); + } + } + + command = commandService.getCommand(CommandIds.COMMAND_ROW_LABEL_FEATURE_DISPLAY_NAME); + if(command != null) { + final State state = command.getState(CommandIds.TOGGLE_STATE); + if(state != null) { + state.setValue(labelFeatureConf.isDisplayName()); + } + } + } + } + } + + } else { + throw new RuntimeException(String.format("The Eclipse service {0} has not been found", ICommandService.class)); + } } @@ -912,23 +921,4 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen return this.table.getCurrentRowAxisProvider(); } } - - // /** - // * - // * @return - // * the vertical axis configuration - // */ - // public AbstractHeaderAxisConfiguration getColumnAxisConfiguration() { - // return getVerticalAxisProvider().getAxisConfiguration(); - // } - // - // /** - // * - // * @return - // * the horizontal axis configuration - // */ - // public AbstractHeaderAxisConfiguration getRowAxisConfiguration() { - // return getHorizontalAxisProvider().getAxisConfiguration(); - // } - } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/TableLabelProvider.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/TableLabelProvider.java index 3f2118578e9..73db2e6b047 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/TableLabelProvider.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/TableLabelProvider.java @@ -13,13 +13,11 @@ package org.eclipse.papyrus.infra.nattable.provider; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry; -import org.eclipse.papyrus.infra.core.services.ServiceException; import org.eclipse.papyrus.infra.emf.providers.EMFLabelProvider; import org.eclipse.papyrus.infra.emf.utils.EMFHelper; -import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.services.labelprovider.service.IFilteredLabelProvider; +import org.eclipse.papyrus.infra.widgets.Activator; import org.eclipse.swt.graphics.Image; /** @@ -47,15 +45,11 @@ public class TableLabelProvider extends EMFLabelProvider implements IFilteredLab table = ((IAdaptable)table).getAdapter(EObject.class); } if(table instanceof Table) { - IPageIconsRegistry registry = null; - try { - registry = ServiceUtilsForEObject.getInstance().getService(IPageIconsRegistry.class, (Table)table); - } catch (ServiceException e) { - return null; + final String iconPath = ((Table)table).getTableConfiguration().getIconPath(); + if(iconPath != null) { + return Activator.getDefault().getImage(iconPath); } - return registry.getEditorIcon(table); } - return null; } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/HeaderAxisConfigurationManagementUtils.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/HeaderAxisConfigurationManagementUtils.java index cdeebfd9ca0..3d05729d3c7 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/HeaderAxisConfigurationManagementUtils.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/HeaderAxisConfigurationManagementUtils.java @@ -15,6 +15,9 @@ package org.eclipse.papyrus.infra.nattable.utils; import org.eclipse.papyrus.infra.nattable.model.nattable.Table; import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AbstractHeaderAxisConfiguration; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.LocalTableHeaderAxisConfiguration; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.NattableaxisconfigurationFactory; +import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.TableHeaderAxisConfiguration; /** * Utils class for AxisConfiguration @@ -69,7 +72,7 @@ public class HeaderAxisConfigurationManagementUtils { * @return * the header configuration used for rows in the table. The result can't be null */ - public static final AbstractHeaderAxisConfiguration getUsedRowAbstractHeaderAxisInTableConfiguration(final Table table) { + public static final AbstractHeaderAxisConfiguration getAbstractHeaderAxisConfigurationUsedInTable(final Table table) { AbstractHeaderAxisConfiguration config = getRowAbstractHeaderAxisInTable(table); if(config == null) { config = getRowAbstractHeaderAxisInTableConfiguration(table); @@ -119,7 +122,7 @@ public class HeaderAxisConfigurationManagementUtils { * @return * the header configuration used for columns in the table. The result can't be null */ - public static final AbstractHeaderAxisConfiguration getUsedColumnAbstractHeaderAxisInTableConfiguration(final Table table) { + public static final AbstractHeaderAxisConfiguration getColumnAbstractHeaderAxisUsedInTable(final Table table) { AbstractHeaderAxisConfiguration config = getColumnAbstractHeaderAxisInTable(table); if(config == null) { config = getColumnAbstractHeaderAxisInTableConfiguration(table); @@ -128,4 +131,36 @@ public class HeaderAxisConfigurationManagementUtils { return config; } + /** + * + * @param table + * the table + * @return + * the header configuration used for row in the table. The result can't be null + */ + public static final AbstractHeaderAxisConfiguration getRowAbstractHeaderAxisUsedInTable(final Table table) { + AbstractHeaderAxisConfiguration config = getRowAbstractHeaderAxisInTable(table); + if(config == null) { + config = getRowAbstractHeaderAxisInTableConfiguration(table); + } + assert config != null; + return config; + } + + /** + * + * @param configuration + * the configuration to duplicate + * @return + * the {@link LocalTableHeaderAxisConfiguration} mapped on the {@link TableHeaderAxisConfiguration} + */ + public static LocalTableHeaderAxisConfiguration transformToLocalHeaderConfiguration(final TableHeaderAxisConfiguration configuration) { + LocalTableHeaderAxisConfiguration conf = NattableaxisconfigurationFactory.eINSTANCE.createLocalTableHeaderAxisConfiguration(); + conf.setDisplayFilter(configuration.isDisplayFilter()); + conf.setDisplayIndex(configuration.isDisplayIndex()); + conf.setDisplayLabel(configuration.isDisplayLabel()); + conf.setIndexStyle(configuration.getIndexStyle()); + return conf; + } + } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/LabelConfigurationManagementUtils.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/LabelConfigurationManagementUtils.java index 576ca2f900e..411f23cb9dd 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/LabelConfigurationManagementUtils.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/LabelConfigurationManagementUtils.java @@ -44,7 +44,7 @@ public class LabelConfigurationManagementUtils { config = table.getLocalColumnHeaderAxisConfiguration(); } if(config != null) { - for(final ILabelProviderConfiguration current : config.getOwnedLabelConfiguration()) { + for(final ILabelProviderConfiguration current : config.getOwnedLabelConfigurations()) { if(current instanceof FeatureLabelProviderConfiguration) { return (FeatureLabelProviderConfiguration)current; } @@ -66,7 +66,7 @@ public class LabelConfigurationManagementUtils { config = table.getTableConfiguration().getColumnHeaderAxisConfiguration(); } //can be null according to the metamodel - for(final ILabelProviderConfiguration current : config.getOwnedLabelConfiguration()) { + for(final ILabelProviderConfiguration current : config.getOwnedLabelConfigurations()) { if(current instanceof FeatureLabelProviderConfiguration) { return (FeatureLabelProviderConfiguration)current; } @@ -98,7 +98,7 @@ public class LabelConfigurationManagementUtils { config = table.getLocalColumnHeaderAxisConfiguration(); } if(config != null) { - for(final ILabelProviderConfiguration current : config.getOwnedLabelConfiguration()) { + for(final ILabelProviderConfiguration current : config.getOwnedLabelConfigurations()) { if(current instanceof FeatureLabelProviderConfiguration) { return (FeatureLabelProviderConfiguration)current; } @@ -120,7 +120,7 @@ public class LabelConfigurationManagementUtils { config = table.getTableConfiguration().getColumnHeaderAxisConfiguration(); } //can be null according to the metamodel - for(final ILabelProviderConfiguration current : config.getOwnedLabelConfiguration()) { + for(final ILabelProviderConfiguration current : config.getOwnedLabelConfigurations()) { if(current instanceof FeatureLabelProviderConfiguration) { return (FeatureLabelProviderConfiguration)current; } @@ -153,7 +153,7 @@ public class LabelConfigurationManagementUtils { config = table.getLocalColumnHeaderAxisConfiguration(); } if(config != null) { - for(final ILabelProviderConfiguration current : config.getOwnedLabelConfiguration()) { + for(final ILabelProviderConfiguration current : config.getOwnedLabelConfigurations()) { if(current instanceof ObjectLabelProviderConfiguration) { return (ObjectLabelProviderConfiguration)current; } @@ -175,7 +175,7 @@ public class LabelConfigurationManagementUtils { config = table.getTableConfiguration().getColumnHeaderAxisConfiguration(); } //can be null according to the metamodel - for(final ILabelProviderConfiguration current : config.getOwnedLabelConfiguration()) { + for(final ILabelProviderConfiguration current : config.getOwnedLabelConfigurations()) { if(current instanceof ObjectLabelProviderConfiguration) { return (ObjectLabelProviderConfiguration)current; } @@ -207,7 +207,7 @@ public class LabelConfigurationManagementUtils { config = table.getLocalColumnHeaderAxisConfiguration(); } if(config != null) { - for(final ILabelProviderConfiguration current : config.getOwnedLabelConfiguration()) { + for(final ILabelProviderConfiguration current : config.getOwnedLabelConfigurations()) { if(current instanceof ObjectLabelProviderConfiguration) { return (ObjectLabelProviderConfiguration)current; } @@ -229,7 +229,7 @@ public class LabelConfigurationManagementUtils { config = table.getTableConfiguration().getColumnHeaderAxisConfiguration(); } //can be null according to the metamodel - for(final ILabelProviderConfiguration current : config.getOwnedLabelConfiguration()) { + for(final ILabelProviderConfiguration current : config.getOwnedLabelConfigurations()) { if(current instanceof ObjectLabelProviderConfiguration) { return (ObjectLabelProviderConfiguration)current; } diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/NattableWidgetPropertyTester.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/NattableWidgetPropertyTester.java index f171dab1bb3..876d9bbae8f 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/NattableWidgetPropertyTester.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/NattableWidgetPropertyTester.java @@ -35,9 +35,9 @@ public class NattableWidgetPropertyTester extends PropertyTester { return expectedValue.equals(manager != null); } else if(HAS_FEATURE_ROW_HEADER_CONFIGURATION.equals(property) && expectedValue instanceof Boolean) { LabelConfigurationManagementUtils.getRowFeatureLabelConfigurationInTable(manager.getTable()); - return expectedValue.equals(LabelConfigurationManagementUtils.getRowFeatureLabelConfigurationInTable(manager.getTable()) != null); + return expectedValue.equals(LabelConfigurationManagementUtils.hasRowFeatureLabelConfiguration(manager.getTable())); } else if(HAS_FEATURE_COLUMN_HEADER_CONFIGURATION.equals(property) && expectedValue instanceof Boolean) { - return expectedValue.equals(LabelConfigurationManagementUtils.getColumnFeatureLabelConfigurationInTable(manager.getTable()) != null); + return expectedValue.equals(LabelConfigurationManagementUtils.hasColumnFeatureLabelConfiguration(manager.getTable())); } } return false; diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.requirement.config/configs/requirement.nattableconfiguration b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.requirement.config/configs/requirement.nattableconfiguration index 9df19a7a846..f3288b393a2 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.requirement.config/configs/requirement.nattableconfiguration +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.requirement.config/configs/requirement.nattableconfiguration @@ -2,16 +2,16 @@ - - + + - - + + - - - + + + diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration index faabd08ddbe..c9e78354015 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration +++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration @@ -2,13 +2,13 @@ - - + + - - - + + + -- cgit v1.2.3