Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/src/org/eclipse/papyrus/customization/nattableconfiguration/pages/RowConfigurationWizardPage.java10
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/PasteHelperUtils.java5
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLMultiReferenceTextualCellEditorWithButtonConfiguration.java2
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/editor/DatatypeDialogCellEditor.java2
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/filter/configuration/UMLEnumerationEditorFilterConfiguration.java2
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java4
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/menu/CreateColumnStereotypePropertyMenuFactory.java4
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/menu/CreateRowStereotypePropertyMenuFactory.java4
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/markers/ValidationMarkerInTableHeaderTest.java6
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/META-INF/MANIFEST.MF2
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/plugin.xml18
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/src/org/eclipse/papyrus/uml/nattable/stereotyped/elements/tests/manager/cell/SysMLStereotypePropertyCellManager.java97
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/src/org/eclipse/papyrus/uml/nattable/stereotyped/elements/tests/provider/SysMLFlowPortDirectionLabelProvider.java93
13 files changed, 22 insertions, 227 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/src/org/eclipse/papyrus/customization/nattableconfiguration/pages/RowConfigurationWizardPage.java b/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/src/org/eclipse/papyrus/customization/nattableconfiguration/pages/RowConfigurationWizardPage.java
index feac88e3c95..2503ab14585 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/src/org/eclipse/papyrus/customization/nattableconfiguration/pages/RowConfigurationWizardPage.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/src/org/eclipse/papyrus/customization/nattableconfiguration/pages/RowConfigurationWizardPage.java
@@ -195,19 +195,19 @@ public class RowConfigurationWizardPage extends AbstractAxisConfigurationWizardP
final Menu menu = new Menu(addAxisConfiguration);
final MenuItem treeFillingItem = new MenuItem(menu, SWT.NONE);
treeFillingItem.setText(Messages.RowConfigurationWizardPage_treeFillingConfigurationLabel);
- treeFillingItem.setData(E_CLASS, NattableaxisconfigurationPackage.eINSTANCE.getEClassifier("TreeFillingConfiguration")); //$NON-NLS-1$ //$NON-NLS-2$
+ treeFillingItem.setData(E_CLASS, NattableaxisconfigurationPackage.eINSTANCE.getEClassifier("TreeFillingConfiguration")); //$NON-NLS-1$
treeFillingItem.addSelectionListener(selectionListener);
final MenuItem pasteEObjectItem = new MenuItem(menu, SWT.NONE);
pasteEObjectItem.setText(Messages.RowConfigurationWizardPage_pasteConfigurationLabel);
- pasteEObjectItem.setData(E_CLASS, NattableaxisconfigurationPackage.eINSTANCE.getEClassifier("PasteEObjectConfiguration")); //$NON-NLS-1$ //$NON-NLS-2$
+ pasteEObjectItem.setData(E_CLASS, NattableaxisconfigurationPackage.eINSTANCE.getEClassifier("PasteEObjectConfiguration")); //$NON-NLS-1$
pasteEObjectItem.addSelectionListener(selectionListener);
final MenuItem featureAxisItem = new MenuItem(menu, SWT.NONE);
featureAxisItem.setText(Messages.RowConfigurationWizardPage_featureAxisLabel);
- featureAxisItem.setData(E_CLASS, NattableaxisconfigurationPackage.eINSTANCE.getEClassifier("FeatureAxisConfiguration")); //$NON-NLS-1$ //$NON-NLS-2$
+ featureAxisItem.setData(E_CLASS, NattableaxisconfigurationPackage.eINSTANCE.getEClassifier("FeatureAxisConfiguration")); //$NON-NLS-1$
featureAxisItem.addSelectionListener(selectionListener);
final MenuItem featureValueFillingItem = new MenuItem(menu, SWT.NONE);
featureValueFillingItem.setText(Messages.RowConfigurationWizardPage_eStructuralFeatureValueFillingConfigurationLabel);
- featureValueFillingItem.setData(E_CLASS, NattableaxisconfigurationPackage.eINSTANCE.getEClassifier("EStructuralFeatureValueFillingConfiguration")); //$NON-NLS-1$ //$NON-NLS-2$
+ featureValueFillingItem.setData(E_CLASS, NattableaxisconfigurationPackage.eINSTANCE.getEClassifier("EStructuralFeatureValueFillingConfiguration")); //$NON-NLS-1$
featureValueFillingItem.addSelectionListener(selectionListener);
menu.setVisible(true);
@@ -220,7 +220,7 @@ public class RowConfigurationWizardPage extends AbstractAxisConfigurationWizardP
display.sleep();
}
} catch (Throwable ex) {
- System.out.println(ex);
+ Activator.log.error(ex);
}
}
if (!display.isDisposed()) {
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/PasteHelperUtils.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/PasteHelperUtils.java
index 0828162621b..80d43e244b5 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/PasteHelperUtils.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/PasteHelperUtils.java
@@ -16,6 +16,7 @@ package org.eclipse.papyrus.infra.nattable.utils;
import java.io.Reader;
import java.util.Map;
+import org.eclipse.papyrus.editor.Activator;
import org.eclipse.papyrus.infra.nattable.layerstack.RowHeaderHierarchicalLayerStack;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager;
@@ -168,9 +169,7 @@ public class PasteHelperUtils {
if (minDepth > ((TreeFillingConfiguration) selectedRows.get(rowIndex)).getDepth()) {
minDepth = ((TreeFillingConfiguration) selectedRows.get(rowIndex)).getDepth();
}
- } else {
- System.out.println(selectedRows.get(rowIndex));
- }
+ }
}
}
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLMultiReferenceTextualCellEditorWithButtonConfiguration.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLMultiReferenceTextualCellEditorWithButtonConfiguration.java
index dad1753331d..d929e651a6a 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLMultiReferenceTextualCellEditorWithButtonConfiguration.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLMultiReferenceTextualCellEditorWithButtonConfiguration.java
@@ -215,4 +215,4 @@ public class UMLMultiReferenceTextualCellEditorWithButtonConfiguration implement
}
-}
+} \ No newline at end of file
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/editor/DatatypeDialogCellEditor.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/editor/DatatypeDialogCellEditor.java
index fe9bd2392c3..3932110ffe5 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/editor/DatatypeDialogCellEditor.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/editor/DatatypeDialogCellEditor.java
@@ -124,7 +124,7 @@ public class DatatypeDialogCellEditor extends AbstractUMLMultiValueCellEditor {
*/
@Override
protected Object createDialog(final EObject realEditedObject, final EStructuralFeature realFeature, final Stereotype stereotype, final ResourceSet resourceSet) {
- return new EObjectTreeDialog(Display.getDefault().getActiveShell(), realEditedObject, realFeature, "DataType Edition") { // $NON-NLS-1$
+ return new EObjectTreeDialog(Display.getDefault().getActiveShell(), realEditedObject, realFeature, "DataType Edition") { //$NON-NLS-1$
@Override
protected void okPressed() {
super.okPressed();
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/filter/configuration/UMLEnumerationEditorFilterConfiguration.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/filter/configuration/UMLEnumerationEditorFilterConfiguration.java
index ca088ca0d9c..75e089db1a1 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/filter/configuration/UMLEnumerationEditorFilterConfiguration.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/filter/configuration/UMLEnumerationEditorFilterConfiguration.java
@@ -225,7 +225,7 @@ public class UMLEnumerationEditorFilterConfiguration extends EEnumFilterCellEdit
return null;
}
IAxis iaxis = (IAxis) axis;
- CompoundCommand cc = new CompoundCommand("Set Filter Value Command");
+ CompoundCommand cc = new CompoundCommand("Set Filter Value Command"); //$NON-NLS-1$
NamedStyle keyStyle = getValueToMatchStyle(iaxis);
if (newValue instanceof Collection<?>) {
Collection<?> coll = (Collection<?>) newValue;
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java
index 459d1549009..e8f51e3f1a2 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java
@@ -274,7 +274,7 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager {
EStructuralFeature steApFeature = null;
if (prop != null) {
if (stereotypes.isEmpty()) {
- if (newValue == null || newValue.isEmpty() || newValue.equalsIgnoreCase(org.eclipse.papyrus.infra.nattable.utils.Constants.NOT_AVALAIBLE)) { // $NON-NLS-1$
+ if (newValue == null || newValue.isEmpty() || newValue.equalsIgnoreCase(org.eclipse.papyrus.infra.nattable.utils.Constants.NOT_AVALAIBLE)) {
// Don't apply the stereotype if there's no value to set.
return null;
}
@@ -382,6 +382,7 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager {
* @param tableManager
* the table manager
*/
+ @SuppressWarnings("unchecked")
@Override
public void setStringValue(Object columnElement, Object rowElement, String valueAsString, AbstractStringValueConverter valueSolver, Map<?, ?> sharedMap, INattableModelManager tableManager) {
// commented to fix bug 480894: [Table]pasting an empty string in a stereotype property colonne throws a java.lang.IllegalStateException
@@ -405,7 +406,6 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager {
final String postActionId = Constants.POST_ACTION_APPLY_STEREOTYPE_PREFIX + ((NamedElement) element).getQualifiedName();
// we register a special post actions to conclude the stereotype application
- @SuppressWarnings("unchecked")
final Collection<String> postActionIds = (Collection<String>) sharedMap.get(org.eclipse.papyrus.infra.nattable.utils.Constants.ADDITIONAL_POST_ACTIONS_TO_CONCLUDE_PASTE_KEY);
postActionIds.add(postActionId);
// we do the post action : we apply the streotype
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/menu/CreateColumnStereotypePropertyMenuFactory.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/menu/CreateColumnStereotypePropertyMenuFactory.java
index ec8709ff734..eeff9ae4daa 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/menu/CreateColumnStereotypePropertyMenuFactory.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/menu/CreateColumnStereotypePropertyMenuFactory.java
@@ -36,12 +36,12 @@ import org.eclipse.uml2.uml.Property;
public class CreateColumnStereotypePropertyMenuFactory extends AbstractCreateStereotypePropertyMenuFactory {
/** the label of the menu */
- public static final String MENU_LABEL = "Select Stereotype Properties Columns";
+ public static final String MENU_LABEL = "Select Stereotype Properties Columns"; //$NON-NLS-1$
/**
* the path of the icon to use for this menu
*/
- private static final String ICON_PATH = "/icons/stereotypePropertyColumn.gif";
+ private static final String ICON_PATH = "/icons/stereotypePropertyColumn.gif"; //$NON-NLS-1$
/**
*
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/menu/CreateRowStereotypePropertyMenuFactory.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/menu/CreateRowStereotypePropertyMenuFactory.java
index 205a377129a..208c22d808b 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/menu/CreateRowStereotypePropertyMenuFactory.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/menu/CreateRowStereotypePropertyMenuFactory.java
@@ -36,12 +36,12 @@ import org.eclipse.uml2.uml.Property;
public class CreateRowStereotypePropertyMenuFactory extends AbstractCreateStereotypePropertyMenuFactory {
/** the label of the menu */
- public static final String MENU_LABEL = "Select Stereotype Properties Rows";
+ public static final String MENU_LABEL = "Select Stereotype Properties Rows"; //$NON-NLS-1$
/**
* the path of the icon to use for this menu
*/
- private static final String ICON_PATH = "/icons/stereotypePropertyRow.gif";
+ private static final String ICON_PATH = "/icons/stereotypePropertyRow.gif"; //$NON-NLS-1$
/**
*
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/markers/ValidationMarkerInTableHeaderTest.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/markers/ValidationMarkerInTableHeaderTest.java
index 04596de4790..294c85dfee6 100644
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/markers/ValidationMarkerInTableHeaderTest.java
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/src/org/eclipse/papyrus/uml/nattable/clazz/config/tests/markers/ValidationMarkerInTableHeaderTest.java
@@ -394,6 +394,8 @@ public class ValidationMarkerInTableHeaderTest extends AbstractPapyrusTest {
/**
* This method can be used to generate the map initialization for the test method {@link #testNattableTooltipProvider()}
+ * This method must not be called during the tests execution
+ *
*/
public void generateMapInitializationFortestNattableTooltipProviderTests() {
final NatTable natTable = (NatTable) manager.getAdapter(NatTable.class);
@@ -419,6 +421,10 @@ public class ValidationMarkerInTableHeaderTest extends AbstractPapyrusTest {
// code to generate the values to check
if (provider.shouldCreateToolTip(event)) {
String txt = provider.getText(event);
+
+ //these sysout are used to generate the body of the method initializeMapForToolTipTests.
+ //Please don't comment/remove them
+
System.out.println(NLS.bind("createToolTip.put(\"{0}\", true); //$NON-NLS-1$", new Object[] { key, rowPosition })); //$NON-NLS-1$
txt = txt.replaceAll("\n", "\\\\n"); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println(NLS.bind("valuesToCheck.put(\"{0}\", \"{1}\"); //$NON-NLS-1$ //$NON-NLS-2$", new Object[] { key, txt })); //$NON-NLS-1$
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/META-INF/MANIFEST.MF
index 2426335cf1f..de989da6936 100644
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/META-INF/MANIFEST.MF
@@ -19,8 +19,6 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.108.0,4.0.0)",
org.eclipse.papyrus.uml.dynamic.profile.tests;bundle-version="[1.2.0,2.0.0)"
Export-Package: org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests,
org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests.manager.axis,
- org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests.manager.cell,
- org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests.provider,
org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests.tests
Bundle-Vendor: %providerName
Bundle-Version: 1.0.0.qualifier
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/plugin.xml b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/plugin.xml
index 38098dd0f8a..904d3780787 100644
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/plugin.xml
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/plugin.xml
@@ -14,24 +14,6 @@
</extension>
<extension
- point="org.eclipse.papyrus.infra.services.labelprovider.labelProvider">
- <labelProvider
- priority="1700"
- provider="org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests.provider.SysMLFlowPortDirectionLabelProvider">
- <labelProviderContext
- context="org.eclipse.papyrus.infra.nattable.body.labelprovider">
- </labelProviderContext>
- </labelProvider>
- </extension>
- <extension
- point="org.eclipse.papyrus.infra.nattable.cellmanager">
- <cellManager
- id="org.eclipse.papyrus.uml.nattable.stereotyped.elements.property.cell.manager"
- manager="org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests.manager.cell.SysMLStereotypePropertyCellManager"
- order="245">
- </cellManager>
- </extension>
- <extension
point="org.eclipse.papyrus.infra.nattable.axismanager">
<axisManager
id="org.eclipse.papyrus.uml.nattable.dyanmic.requirement.axis.manager"
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/src/org/eclipse/papyrus/uml/nattable/stereotyped/elements/tests/manager/cell/SysMLStereotypePropertyCellManager.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/src/org/eclipse/papyrus/uml/nattable/stereotyped/elements/tests/manager/cell/SysMLStereotypePropertyCellManager.java
deleted file mode 100644
index 51e4278a3da..00000000000
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/src/org/eclipse/papyrus/uml/nattable/stereotyped/elements/tests/manager/cell/SysMLStereotypePropertyCellManager.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests.manager.cell;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
-import org.eclipse.papyrus.uml.nattable.manager.cell.StereotypePropertyCellManager;
-import org.eclipse.papyrus.uml.nattable.utils.Constants;
-import org.eclipse.uml2.uml.Port;
-
-/**
- *
- * This cell manager manages the cell displaying the direction of the FlowPort.
- * If the flowport is not atomic, the cell is not editable and the direction is N/A.
- *
- */
-public class SysMLStereotypePropertyCellManager extends StereotypePropertyCellManager {
-
- /**
- *
- * @see org.eclipse.papyrus.uml.nattable.manager.cell.manager.StereotypePropertyCellManager#handles(java.lang.Object, java.lang.Object, INattableModelManager)
- *
- * @param columnElement
- * @param rowElement
- * @return
- */
- @Override
- public boolean handles(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) {
- if (super.handles(columnElement, rowElement, tableManager)) {
- final List<Object> objects = organizeAndResolvedObjects(columnElement, rowElement, null);
- if (objects.size() == 2) {
- final EObject object = (EObject) objects.get(0);
- if (object instanceof Port) {
- String propertyQualifiedName = (String) objects.get(1);
- propertyQualifiedName = propertyQualifiedName.substring(Constants.PROPERTY_OF_STEREOTYPE_PREFIX.length(), propertyQualifiedName.length());
- return propertyQualifiedName.equals("SysMLCopy::PortAndFlows::FlowPort::direction");
- }
- }
- }
- return false;
- }
-
-
- /**
- *
- * @see org.eclipse.papyrus.uml.nattable.manager.cell.manager.StereotypePropertyCellManager#isCellEditable(java.lang.Object, java.lang.Object, INattableModelManager)
- *
- * @param columnElement
- * @param rowElement
- * @return
- */
- @Override
- public boolean isCellEditable(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) {
- boolean value = super.isCellEditable(columnElement, rowElement, tableManager);
- if (value) {
- final List<Object> objects = organizeAndResolvedObjects(columnElement, rowElement, null);
- if (objects.size() == 2) {
- final EObject object = (EObject) objects.get(0);
- if (matches(object)) {
- value = false;
- }
- }
- }
- return value;
- }
-
- public boolean matches(EObject eObject) {
-
- boolean isFlowPort_NA = false;
-
- if (eObject instanceof Port) {
-
- Port port = (Port) eObject;
- System.out.println(port);
- // FlowPort flowPort = UMLUtil.getStereotypeApplication(port, FlowPort.class);
- //
- // if ((flowPort != null) && (!flowPort.isAtomic())) {
- // isFlowPort_NA = true;
- // }
- }
-
- return isFlowPort_NA;
- }
-}
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/src/org/eclipse/papyrus/uml/nattable/stereotyped/elements/tests/provider/SysMLFlowPortDirectionLabelProvider.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/src/org/eclipse/papyrus/uml/nattable/stereotyped/elements/tests/provider/SysMLFlowPortDirectionLabelProvider.java
deleted file mode 100644
index 306955b6510..00000000000
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/src/org/eclipse/papyrus/uml/nattable/stereotyped/elements/tests/provider/SysMLFlowPortDirectionLabelProvider.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests.provider;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
-import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
-import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
-import org.eclipse.papyrus.infra.nattable.utils.Constants;
-import org.eclipse.papyrus.infra.nattable.utils.LabelProviderCellContextElementWrapper;
-import org.eclipse.papyrus.uml.nattable.provider.AbstractUMLNattableCellLabelProvider;
-import org.eclipse.uml2.uml.Port;
-
-/**
- * This label provider allows to display N/A for the direction of the FlowPort when its requred!
- *
- * @author Vincent Lorenzo
- *
- */
-public class SysMLFlowPortDirectionLabelProvider extends AbstractUMLNattableCellLabelProvider {
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.provider.GenericCellLabelProvider#accept(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public boolean accept(final Object element) {
- if (element instanceof LabelProviderCellContextElementWrapper) {
- final ILayerCell cell = ((LabelProviderCellContextElementWrapper) element);
- final IConfigRegistry registry = ((LabelProviderCellContextElementWrapper) element).getConfigRegistry();
- final Object columnObject = getColumnObject(cell, registry);
- String str = AxisUtils.getPropertyId(columnObject);
- if (str == null) {
- final Object rowObject = getRowObject(cell, registry);
- str = AxisUtils.getPropertyId(rowObject);
- }
- if (str != null) {
- return str.endsWith("SysMLCopy::PortAndFlows::FlowPort::direction");
- }
- }
- return false;
- }
-
- @Override
- public String getText(Object element) {
- final ILayerCell cell = ((LabelProviderCellContextElementWrapper) element);
- final IConfigRegistry configRegistry = ((LabelProviderCellContextElementWrapper) element).getConfigRegistry();
- final Object rowObject = getRowObject(cell, configRegistry);
- final Object columObject = getColumnObject(cell, configRegistry);
- Port port = null;
- if (rowObject instanceof Port) {
- port = (Port) rowObject;
- } else if (columObject instanceof Port) {
- port = (Port) columObject;
- }
- if (port != null && matches(port)) {
- return Constants.NOT_AVALAIBLE;
- }
- return super.getText(element);
- }
-
- public boolean matches(EObject eObject) {
-
- boolean isFlowPort_NA = false;
-
- if (eObject instanceof Port) {
-
- Port port = (Port) eObject;
- System.out.println(port);
- // FlowPort flowPort = UMLUtil.getStereotypeApplication(port, FlowPort.class);
- //
- // if ((flowPort != null) && (!flowPort.isAtomic())) {
- // isFlowPort_NA = true;
- // }
- }
-
- return isFlowPort_NA;
- }
-}

Back to the top