Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration26
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable.generic/plugin.xml5
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLFeatureCellEditorConfig.java12
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/dataprovider/UMLSingleReferenceComboBoxDataProvider.java27
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/dataprovider/UMLStereotypeSingleEnumerationComboBoxDataProvider.java19
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/editor/AbstractUMLMultiValueCellEditor.java29
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java19
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/UMLFeatureCellManager.java2
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/StereotypePropertyHeaderLabelProvider.java16
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/UMLStereotypeRestrictedPropertyContentProvider.java2
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/widget/UMLDialogComboAction.java27
11 files changed, 78 insertions, 106 deletions
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 aaf49d7f4db..faabd08ddbe 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
@@ -1,17 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
-<nattableconfiguration:TableConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nattableaxisconfiguration="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration" xmlns:nattableaxisprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider" xmlns:nattableconfiguration="http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration" xmlns:nattablelabelprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattablecontentprovider" xmlns:nattabletester="http://www.eclipse.org/papyrus/nattable/model/table/nattabletester" name="GenericTable" type="PapyruGenericNattable" iconPath="platform:/plugin/org.eclipse.papyrus.uml.nattable.generic.config/icons/uml_generic_table.gif">
- <rowAxisProvider xsi:type="nattableaxisprovider:DefaultAxisProvider">
- <javaAxisManagerIds>org.eclipse.papyrus.uml.nattable.element.axis.manager</javaAxisManagerIds>
- <axisConfiguration xsi:type="nattableaxisconfiguration:DefaultAxisConfiguration">
- <labelConfiguration xsi:type="nattablelabelprovider:ObjectLabelProviderConfiguration" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.labelprovider"/>
- </axisConfiguration>
- </rowAxisProvider>
- <columnAxisProvider xsi:type="nattableaxisprovider:DefaultAxisProvider">
- <javaAxisManagerIds>org.eclipse.papyrus.uml.nattable.feature.axis.manager</javaAxisManagerIds>
- <javaAxisManagerIds>org.eclipse.papyrus.uml.nattable.stereotype.property.axis.manager</javaAxisManagerIds>
- <axisConfiguration xsi:type="nattableaxisconfiguration:DefaultAxisConfiguration" indexStyle="ALPHABETIC">
- <labelConfiguration xsi:type="nattablelabelprovider:FeatureLabelProviderConfiguration" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider"/>
- </axisConfiguration>
- </columnAxisProvider>
+<nattableconfiguration:TableConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nattableaxisconfiguration="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration" xmlns:nattableaxisprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider" xmlns:nattableconfiguration="http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration" xmlns:nattablelabelprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattablecontentprovider" xmlns:nattabletester="http://www.eclipse.org/papyrus/nattable/model/table/nattabletester" description="The generic table allows to edit all UML elements of your model, dropping them from the ModelExplorer View" name="GenericTable" type="PapyrusGenericTable" iconPath="platform:/plugin/org.eclipse.papyrus.uml.nattable.generic.config/icons/uml_generic_table.gif" defaultRowAxisProvider="//@rowAxisProviders.0" defaultColumnAxisProvider="//@columnAxisProviders.0">
<creationTester xsi:type="nattabletester:JavaTableTester" tester="org.eclipse.papyrus.uml.nattable.tester.isumlelement"/>
+ <rowHeaderAxisConfiguration xsi:type="nattableaxisconfiguration:TableHeaderAxisConfiguration" indexStyle="NUMERIC">
+ <ownedLabelConfiguration xsi:type="nattablelabelprovider:ObjectLabelProviderConfiguration"/>
+ <axisManagers xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" axisManagerId="org.eclipse.papyrus.uml.nattable.element.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.labelprovider" headerLabelConfiguration="//@rowHeaderAxisConfiguration/@ownedLabelConfiguration.0"/>
+ </rowHeaderAxisConfiguration>
+ <columnHeaderAxisConfiguration xsi:type="nattableaxisconfiguration:TableHeaderAxisConfiguration">
+ <ownedLabelConfiguration xsi:type="nattablelabelprovider:FeatureLabelProviderConfiguration"/>
+ <axisManagers xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" axisManagerId="org.eclipse.papyrus.uml.nattable.feature.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider" headerLabelConfiguration="//@columnHeaderAxisConfiguration/@ownedLabelConfiguration.0"/>
+ <axisManagers xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" axisManagerId="org.eclipse.papyrus.uml.nattable.stereotype.property.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider" headerLabelConfiguration="//@columnHeaderAxisConfiguration/@ownedLabelConfiguration.0"/>
+ </columnHeaderAxisConfiguration>
+ <columnAxisProviders xsi:type="nattableaxisprovider:SlaveObjectAxisProvider" description="This axis provider provides available columns according to the rows of the table (features of the object displayed on the other axis)" name="UML Feature axis provider"/>
+ <rowAxisProviders xsi:type="nattableaxisprovider:MasterObjectAxisProvider" description="This axis provider contains the object dropped by the user into the table" name="DroppedElementAxisProvider"/>
</nattableconfiguration:TableConfiguration>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable.generic/plugin.xml b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable.generic/plugin.xml
index 8db0f097db2..f2a53748a02 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable.generic/plugin.xml
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable.generic/plugin.xml
@@ -26,7 +26,6 @@
locationURI="popup:org.eclipse.papyrus.infra.nattable.popupmenu.createnattable">
<command
commandId="org.eclipse.papyrus.uml.nattable.generic.create.command"
- label="UML Generic NatTable"
mnemonic="&amp;G"
style="push">
<visibleWhen>
@@ -44,7 +43,6 @@
locationURI="menu:org.eclipse.papyrus.infra.nattable.menu.createnattable">
<command
commandId="org.eclipse.papyrus.uml.nattable.generic.create.command"
- label="UML Generic NatTable"
mnemonic="&amp;G"
style="push">
<visibleWhen>
@@ -62,7 +60,6 @@
locationURI="toolbar:org.eclipse.papyrus.infra.nattable.toolbar.createnattable">
<command
commandId="org.eclipse.papyrus.uml.nattable.generic.create.command"
- label="UML Generic NatTable"
mnemonic="&amp;G"
style="push">
<visibleWhen>
@@ -84,7 +81,7 @@
class="org.eclipse.papyrus.infra.nattable.common.handlers.CreateNatTableEditorHandler">
<parameter
name="tableType"
- value="PapyruGenericNattable">
+ value="PapyrusGenericTable">
</parameter>
</class>
</handler>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLFeatureCellEditorConfig.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLFeatureCellEditorConfig.java
index e201f6133e9..924eff11530 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLFeatureCellEditorConfig.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLFeatureCellEditorConfig.java
@@ -22,9 +22,10 @@ import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.nattable.celleditor.ButtonConfiguration;
import org.eclipse.papyrus.infra.nattable.celleditor.ComboBoxWithButtonCellEditor;
import org.eclipse.papyrus.infra.nattable.manager.table.ITableAxisElementProvider;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IAxis;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IdAxis;
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.nattableaxis.IdAxis;
+import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
import org.eclipse.papyrus.uml.nattable.dataprovider.UMLSingleReferenceComboBoxDataProvider;
import org.eclipse.papyrus.uml.nattable.dataprovider.UMLStereotypeSingleEnumerationComboBoxDataProvider;
import org.eclipse.papyrus.uml.nattable.editor.MultiBooleanCellEditor;
@@ -90,12 +91,7 @@ public class UMLFeatureCellEditorConfig extends EStructuralFeatureEditorConfig {
@Override
public boolean handles(Table table, Object axisElement) {
boolean result = false;
- String id = null;
- if(axisElement instanceof IdAxis) {
- id = ((IdAxis)axisElement).getElement();
- } else if(axisElement instanceof String) {
- id = (String)axisElement;
- }
+ final String id = AxisUtils.getPropertyId(axisElement);
if(id != null) {
result = id.startsWith(UMLTableUtils.PROPERTY_OF_STEREOTYPE_PREFIX);
}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/dataprovider/UMLSingleReferenceComboBoxDataProvider.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/dataprovider/UMLSingleReferenceComboBoxDataProvider.java
index 3880b50200a..6e3ce9333cb 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/dataprovider/UMLSingleReferenceComboBoxDataProvider.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/dataprovider/UMLSingleReferenceComboBoxDataProvider.java
@@ -24,7 +24,7 @@ import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.nebula.widgets.nattable.edit.editor.IComboBoxDataProvider;
import org.eclipse.papyrus.infra.nattable.manager.table.ITableAxisElementProvider;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IdAxis;
+import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
import org.eclipse.papyrus.infra.widgets.providers.HierarchicToFlatContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.TreeToFlatContentProvider;
import org.eclipse.papyrus.uml.nattable.utils.UMLTableUtils;
@@ -73,15 +73,15 @@ public class UMLSingleReferenceComboBoxDataProvider implements IComboBoxDataProv
* @return
*/
public List<?> getValues(int columnIndex, int rowIndex) {
- final Object colElement = elementProvider.getColumnElement(columnIndex);
- final Object rowElement = elementProvider.getRowElement(rowIndex);
+ final Object colElement = this.elementProvider.getColumnElement(columnIndex);
+ final Object rowElement = this.elementProvider.getRowElement(rowIndex);
Element editedElement = null;
Object axis = null;
- if(colElement == axisElement && rowElement instanceof EObject) {
+ if(colElement == this.axisElement && rowElement instanceof EObject) {
editedElement = (Element)rowElement;
axis = colElement;
- } else if(colElement instanceof EObject && rowElement == axisElement) {
+ } else if(colElement instanceof EObject && rowElement == this.axisElement) {
editedElement = (Element)colElement;
axis = rowElement;
}
@@ -90,12 +90,7 @@ public class UMLSingleReferenceComboBoxDataProvider implements IComboBoxDataProv
if(axis instanceof EReference) {
return getPossibleValues(editedElement, (EReference)axis);
} else {
- String id = null;
- if(axis instanceof IdAxis) {
- id = ((IdAxis)axis).getElement();
- } else if(axis instanceof String) {
- id = (String)axis;
- }
+ final String id = AxisUtils.getPropertyId(this.axisElement);
return getPossibleValuesForStereotypeProperty(editedElement, id);
}
}
@@ -172,14 +167,14 @@ public class UMLSingleReferenceComboBoxDataProvider implements IComboBoxDataProv
*/
// FIXME : try to remove this method, improving the ComboAction...
public EObject getEditedEObject(int columnIndex, int rowIndex) {
- final Object colElement = elementProvider.getColumnElement(columnIndex);
- final Object rowElement = elementProvider.getRowElement(rowIndex);
+ final Object colElement = this.elementProvider.getColumnElement(columnIndex);
+ final Object rowElement = this.elementProvider.getRowElement(rowIndex);
Element el = (Element)rowElement;
- if(colElement == axisElement) {
+ if(colElement == this.axisElement) {
el = (Element)rowElement;
- } else if(rowElement == axisElement) {
+ } else if(rowElement == this.axisElement) {
el = (Element)colElement;
} else {
//There is a problem in the declaration of the editor...
@@ -198,7 +193,7 @@ public class UMLSingleReferenceComboBoxDataProvider implements IComboBoxDataProv
*/
//FIXME : try to remove this method, improving the ComboAction...
public Object getEditedFeature(int columnIndex, int rowIndex) {
- return axisElement;
+ return this.axisElement;
}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/dataprovider/UMLStereotypeSingleEnumerationComboBoxDataProvider.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/dataprovider/UMLStereotypeSingleEnumerationComboBoxDataProvider.java
index 4dc984f6059..a6e32e76e04 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/dataprovider/UMLStereotypeSingleEnumerationComboBoxDataProvider.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/dataprovider/UMLStereotypeSingleEnumerationComboBoxDataProvider.java
@@ -22,7 +22,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.nebula.widgets.nattable.edit.editor.IComboBoxDataProvider;
import org.eclipse.papyrus.infra.nattable.manager.table.ITableAxisElementProvider;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IdAxis;
+import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
import org.eclipse.papyrus.uml.nattable.utils.UMLTableUtils;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Property;
@@ -71,23 +71,16 @@ public class UMLStereotypeSingleEnumerationComboBoxDataProvider implements IComb
*/
public List<?> getValues(int columnIndex, int rowIndex) {
final List<Object> literals = new ArrayList<Object>();
- Object el = elementProvider.getColumnElement(columnIndex);
- Object rowElement = elementProvider.getRowElement(rowIndex);
+ Object el = this.elementProvider.getColumnElement(columnIndex);
+ Object rowElement = this.elementProvider.getRowElement(rowIndex);
Element modelElement = null;
- if(rowElement instanceof Element && el == axisElement) {
+ if(rowElement instanceof Element && el == this.axisElement) {
modelElement = (Element)rowElement;
- } else if(rowElement == axisElement && el instanceof Element) {
+ } else if(rowElement == this.axisElement && el instanceof Element) {
modelElement = (Element)el;
}
if(modelElement != null) {
- final String id;
- if(axisElement instanceof IdAxis) {
- id = ((IdAxis)axisElement).getElement();
- } else if(axisElement instanceof String) {
- id = (String)axisElement;
- } else {
- id = null;
- }
+ final String id = AxisUtils.getPropertyId(this.axisElement);
final Property property = UMLTableUtils.getRealStereotypeProperty(modelElement, id);
final List<Stereotype> ste = UMLTableUtils.getAppliedSteretoypesWithThisProperty(modelElement, id);
if(ste.size() == 1) {
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/editor/AbstractUMLMultiValueCellEditor.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/editor/AbstractUMLMultiValueCellEditor.java
index 6ebdaa5f3da..a71b8591389 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/editor/AbstractUMLMultiValueCellEditor.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/editor/AbstractUMLMultiValueCellEditor.java
@@ -24,7 +24,7 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.nebula.widgets.nattable.edit.gui.AbstractDialogCellEditor;
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.MoveDirectionEnum;
import org.eclipse.papyrus.infra.nattable.manager.table.ITableAxisElementProvider;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IdAxis;
+import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
import org.eclipse.papyrus.infra.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.infra.widgets.editors.IElementSelector;
import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectorDialog;
@@ -80,7 +80,7 @@ public abstract class AbstractUMLMultiValueCellEditor extends AbstractDialogCell
*/
@Override
public int open() {
- return ((MultipleValueSelectorDialog)dialog).open();
+ return ((MultipleValueSelectorDialog)this.dialog).open();
}
/**
@@ -91,13 +91,13 @@ public abstract class AbstractUMLMultiValueCellEditor extends AbstractDialogCell
*/
@Override
public Object createDialogInstance() {
- int columnIndex = layerCell.getColumnIndex();
- int rowIndex = layerCell.getRowIndex();
+ int columnIndex = this.layerCell.getColumnIndex();
+ int rowIndex = this.layerCell.getRowIndex();
final Object row = this.manager.getRowElement(rowIndex);
final Object column = this.manager.getColumnElement(columnIndex);
Element editedElement = null;
Object feature = null;
- if(row instanceof EObject && column == axisElement) {
+ if(row instanceof EObject && column == this.axisElement) {
editedElement = (Element)row;
feature = column;
} else {
@@ -113,12 +113,7 @@ public abstract class AbstractUMLMultiValueCellEditor extends AbstractDialogCell
realFeature = (EStructuralFeature)feature;
realEditedObject = editedElement;
} else {
- String id = null;
- if(feature instanceof IdAxis) {
- id = ((IdAxis)feature).getElement();
- } else if(feature instanceof String) {
- id = (String)feature;
- }
+ final String id = AxisUtils.getPropertyId(this.axisElement);
stereotypesWithEditedFeatureAppliedOnElement = UMLTableUtils.getAppliedSteretoypesWithThisProperty(editedElement, id);
stereotype = stereotypesWithEditedFeatureAppliedOnElement.get(0);
realEditedObject = editedElement.getStereotypeApplication(stereotypesWithEditedFeatureAppliedOnElement.get(0));
@@ -128,9 +123,9 @@ public abstract class AbstractUMLMultiValueCellEditor extends AbstractDialogCell
if(stereotypesWithEditedFeatureAppliedOnElement != null && stereotypesWithEditedFeatureAppliedOnElement.size() > 1) {
//FIXME : not yet managed
} else {
- dialog = createDialog(realEditedObject, realFeature, stereotype, editedElement.eResource().getResourceSet());
+ this.dialog = createDialog(realEditedObject, realFeature, stereotype, editedElement.eResource().getResourceSet());
}
- return dialog;
+ return this.dialog;
}
/**
@@ -165,8 +160,8 @@ public abstract class AbstractUMLMultiValueCellEditor extends AbstractDialogCell
newValue.add(object);
}
- returnedValue = newValue;
- editHandler.commit(newValue, MoveDirectionEnum.NONE);
+ AbstractUMLMultiValueCellEditor.this.returnedValue = newValue;
+ AbstractUMLMultiValueCellEditor.this.editHandler.commit(newValue, MoveDirectionEnum.NONE);
}
};
@@ -206,7 +201,7 @@ public abstract class AbstractUMLMultiValueCellEditor extends AbstractDialogCell
@Override
public Object getDialogInstance() {
- return dialog;
+ return this.dialog;
}
/**
@@ -217,7 +212,7 @@ public abstract class AbstractUMLMultiValueCellEditor extends AbstractDialogCell
*/
@Override
public Object getEditorValue() {
- return returnedValue;
+ return this.returnedValue;
}
/**
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java
index 9e1ea3b61ca..956d17311e9 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLStereotypePropertyAxisManager.java
@@ -31,10 +31,12 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IAxis;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IdAxis;
-import org.eclipse.papyrus.infra.nattable.model.nattable.NattableFactory;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.FeatureIdAxis;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.IAxis;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.IdAxis;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.NattableaxisFactory;
+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.nattableaxisprovider.NattableaxisproviderPackage;
import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
@@ -59,8 +61,8 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager {
// private Adapter listener;
@Override
- public void init(INattableModelManager manager, String managerId, Table table, AbstractAxisProvider provider, boolean mustRefreshOnAxisChanges) {
- super.init(manager, managerId, table, provider, mustRefreshOnAxisChanges);
+ public void init(INattableModelManager manager, AxisManagerRepresentation rep, Table table, AbstractAxisProvider provider, boolean mustRefreshOnAxisChanges) {
+ super.init(manager, rep, table, provider, mustRefreshOnAxisChanges);
// if(hasConfiguration()) {
// updateAxisContents();
// }
@@ -139,12 +141,13 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager {
if(!allPropertyQN.isEmpty()) {
final Collection<IAxis> toAdd = new ArrayList<IAxis>();
for(String propQN : allPropertyQN) {
- final IdAxis newAxis = NattableFactory.eINSTANCE.createIdAxis();
+ final IdAxis newAxis = NattableaxisFactory.eINSTANCE.createFeatureIdAxis();
newAxis.setElement(propQN);
+ newAxis.setManager(this.rep);
toAdd.add(newAxis);
}
//FIXME : we must use a factory and use the service edit
- return AddCommand.create(domain, getRepresentedContentProvider(), NattableaxisproviderPackage.eINSTANCE.getDefaultAxisProvider_Axis(), toAdd);
+ return AddCommand.create(domain, getRepresentedContentProvider(), NattableaxisproviderPackage.eINSTANCE.getAxisProvider_Axis(), toAdd);
}
// TODO Auto-generated method stub
@@ -163,7 +166,7 @@ public class UMLStereotypePropertyAxisManager extends AbstractAxisManager {
final List<Object> axisElements = getTableManager().getElementsList(getRepresentedContentProvider());
for(int i = 0; i < axis.size(); i++) {
final IAxis current = axis.get(i);
- if(current instanceof IdAxis) {
+ if(current instanceof FeatureIdAxis) {
int currentIndex = axisElements.indexOf(current);
if(currentIndex == -1) {//the element was not in the axis with its id representation
// currentIndex = axisElements.indexOf(current);
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/UMLFeatureCellManager.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/UMLFeatureCellManager.java
index 3d31f728e98..be618121c82 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/UMLFeatureCellManager.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/UMLFeatureCellManager.java
@@ -27,7 +27,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest
import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.infra.emf.nattable.manager.cell.EMFFeatureValueCellManager;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IdAxis;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.IdAxis;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.nattable.utils.UMLTableUtils;
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/StereotypePropertyHeaderLabelProvider.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/StereotypePropertyHeaderLabelProvider.java
index 39e1fdc8172..134eb960e54 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/StereotypePropertyHeaderLabelProvider.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/StereotypePropertyHeaderLabelProvider.java
@@ -22,10 +22,11 @@ import org.eclipse.papyrus.infra.emf.nattable.provider.EMFFeatureHeaderLabelProv
import org.eclipse.papyrus.infra.emf.nattable.registry.EStructuralFeatureImageRegistry;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.FeatureLabelProviderConfiguration;
-import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ILabelConfiguration;
+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.AxisUtils;
import org.eclipse.papyrus.infra.nattable.utils.ILabelProviderContextElement;
+import org.eclipse.papyrus.infra.nattable.utils.LabelConfigurationManagementUtils;
import org.eclipse.papyrus.infra.nattable.utils.LabelProviderCellContextElement;
import org.eclipse.papyrus.infra.nattable.utils.NattableConfigAttributes;
import org.eclipse.papyrus.infra.widgets.Activator;
@@ -77,15 +78,15 @@ public class StereotypePropertyHeaderLabelProvider extends EMFFeatureHeaderLabel
*/
@Override
public String getText(Object element) {
- ILabelConfiguration conf = null;
+ ILabelProviderConfiguration conf = null;
final IConfigRegistry configRegistry = ((ILabelProviderContextElement)element).getConfigRegistry();
if(element instanceof LabelProviderCellContextElement) {
INattableModelManager manager = configRegistry.getConfigAttribute(NattableConfigAttributes.NATTABLE_MODEL_MANAGER_CONFIG_ATTRIBUTE, DisplayMode.NORMAL, NattableConfigAttributes.NATTABLE_MODEL_MANAGER_ID);
LabelStack labels = ((LabelProviderCellContextElement)element).getCell().getConfigLabels();
if(labels.hasLabel(GridRegion.COLUMN_HEADER)) {
- conf = manager.getColumnAxisConfiguration().getLabelConfiguration();
+ conf = LabelConfigurationManagementUtils.getUsedColumnFeatureLabelConfiguration(manager.getTable());
} else if(labels.hasLabel(GridRegion.ROW_HEADER)) {
- conf = manager.getRowAxisConfiguration().getLabelConfiguration();
+ conf = LabelConfigurationManagementUtils.getUsedRowFeatureLabelConfiguration(manager.getTable());
}
}
@@ -117,16 +118,15 @@ public class StereotypePropertyHeaderLabelProvider extends EMFFeatureHeaderLabel
final Object value = ((ILabelProviderContextElement)element).getObject();
final IConfigRegistry configRegistry = ((ILabelProviderContextElement)element).getConfigRegistry();
final INattableModelManager modelManager = (INattableModelManager)getAxisContentProvider(configRegistry);
- ILabelConfiguration conf = null;
+ ILabelProviderConfiguration conf = null;
if(element instanceof LabelProviderCellContextElement) {
INattableModelManager manager = configRegistry.getConfigAttribute(NattableConfigAttributes.NATTABLE_MODEL_MANAGER_CONFIG_ATTRIBUTE, DisplayMode.NORMAL, NattableConfigAttributes.NATTABLE_MODEL_MANAGER_ID);
LabelStack labels = ((LabelProviderCellContextElement)element).getCell().getConfigLabels();
if(labels.hasLabel(GridRegion.COLUMN_HEADER)) {
- conf = manager.getColumnAxisConfiguration().getLabelConfiguration();
+ conf = LabelConfigurationManagementUtils.getUsedColumnFeatureLabelConfiguration(manager.getTable());
} else if(labels.hasLabel(GridRegion.ROW_HEADER)) {
- conf = manager.getRowAxisConfiguration().getLabelConfiguration();
+ conf = LabelConfigurationManagementUtils.getUsedRowFeatureLabelConfiguration(manager.getTable());
}
-
}
if(conf instanceof ObjectLabelProviderConfiguration && !((ObjectLabelProviderConfiguration)conf).isDisplayIcon()) {
return null;
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/UMLStereotypeRestrictedPropertyContentProvider.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/UMLStereotypeRestrictedPropertyContentProvider.java
index 9a4c07b651e..280abfc417f 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/UMLStereotypeRestrictedPropertyContentProvider.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/provider/UMLStereotypeRestrictedPropertyContentProvider.java
@@ -54,7 +54,7 @@ public class UMLStereotypeRestrictedPropertyContentProvider extends UMLStereotyp
Profile profile = (Profile)parentElement;
Set<Stereotype> restrictedStereotypes = new HashSet<Stereotype>();
if(this.isRestricted && !profile.getOwnedStereotypes().isEmpty()) {
- AbstractAxisProvider horizontalAxisProvider = this.umlStereotypePropertyManager.getTable().getRowAxisProvider();
+ AbstractAxisProvider horizontalAxisProvider = this.umlStereotypePropertyManager.getTable().getCurrentRowAxisProvider();
List<Object> elementsList = this.umlStereotypePropertyManager.getTableManager().getElementsList(horizontalAxisProvider);
for(Object object : elementsList) {
if(object instanceof Element) {
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/widget/UMLDialogComboAction.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/widget/UMLDialogComboAction.java
index 554b7b1c7f1..376fde6881d 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/widget/UMLDialogComboAction.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/widget/UMLDialogComboAction.java
@@ -26,7 +26,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.celleditor.AbstractComboAction;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IdAxis;
+import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
import org.eclipse.papyrus.uml.nattable.Activator;
@@ -68,19 +68,19 @@ public class UMLDialogComboAction extends AbstractComboAction {
@Override
public void run() {
- if(dataProvider instanceof UMLSingleReferenceComboBoxDataProvider) {
+ if(this.dataProvider instanceof UMLSingleReferenceComboBoxDataProvider) {
final TreeSelectorDialog dialog = new TreeSelectorDialog(Display.getDefault().getActiveShell());
- final Object rowElement = ((UMLSingleReferenceComboBoxDataProvider)dataProvider).getEditedEObject(columnIndex, rowIndex);
- final Object columnElement = ((UMLSingleReferenceComboBoxDataProvider)dataProvider).getEditedFeature(columnIndex, rowIndex);
+ final Object rowElement = ((UMLSingleReferenceComboBoxDataProvider)this.dataProvider).getEditedEObject(this.columnIndex, this.rowIndex);
+ final Object columnElement = ((UMLSingleReferenceComboBoxDataProvider)this.dataProvider).getEditedFeature(this.columnIndex, this.rowIndex);
EObject realEditedObject = null;
EStructuralFeature realFeature = null;
Element editedElement = null;
- Object feature = axisElement;
- if(rowElement instanceof Element && columnElement == axisElement) {
+ Object feature = this.axisElement;
+ if(rowElement instanceof Element && columnElement == this.axisElement) {
editedElement = (Element)rowElement;
- } else if(rowElement == axisElement && columnElement instanceof EObject) {
+ } else if(rowElement == this.axisElement && columnElement instanceof EObject) {
editedElement = (Element)columnElement;
}
@@ -91,12 +91,7 @@ public class UMLDialogComboAction extends AbstractComboAction {
realFeature = (EStructuralFeature)feature;
realEditedObject = editedElement;
} else {
- String id = null;
- if(feature instanceof IdAxis) {
- id = ((IdAxis)feature).getElement();
- } else if(feature instanceof String) {
- id = (String)feature;
- }
+ String id = AxisUtils.getPropertyId(feature);
stereotypesWithEditedFeatureAppliedOnElement = UMLTableUtils.getAppliedSteretoypesWithThisProperty(editedElement, id);
stereotype = stereotypesWithEditedFeatureAppliedOnElement.get(0);
realEditedObject = editedElement.getStereotypeApplication(stereotypesWithEditedFeatureAppliedOnElement.get(0));
@@ -111,8 +106,8 @@ public class UMLDialogComboAction extends AbstractComboAction {
dialog.setTitle(realFeature.getEType().getName());
dialog.setLabelProvider(getLabelProvider(editedElement));
- int currentIndex = combo.getSelectionIndex();
- List<?> values = dataProvider.getValues(columnIndex, rowIndex);
+ int currentIndex = this.combo.getSelectionIndex();
+ List<?> values = this.dataProvider.getValues(this.columnIndex, this.rowIndex);
Object initialSelection = null;
if(currentIndex != -1) {
initialSelection = values.get(currentIndex);
@@ -126,7 +121,7 @@ public class UMLDialogComboAction extends AbstractComboAction {
if(res == Window.OK) {
final Object[] result = dialog.getResult();
int index = values.indexOf(result[0]);
- combo.select(index);
+ this.combo.select(index);
}
}
}

Back to the top