Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/helper/ParameterLabelHelper.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/helper/ParameterLabelHelper.java42
1 files changed, 12 insertions, 30 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/helper/ParameterLabelHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/helper/ParameterLabelHelper.java
index ddc0b73e0b4..d23ffacaf31 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/helper/ParameterLabelHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/helper/ParameterLabelHelper.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 - 2010 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
@@ -11,19 +11,17 @@
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Customization for Parameter
*
*****************************************************************************/
-
package org.eclipse.papyrus.uml.diagram.composite.custom.helper;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import java.util.Set;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.helper.StereotypedElementLabelHelper;
-import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
+import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
import org.eclipse.papyrus.uml.tools.utils.ParameterUtil;
import org.eclipse.uml2.uml.Parameter;
@@ -44,20 +42,11 @@ public class ParameterLabelHelper extends StereotypedElementLabelHelper {
}
/** Map for masks */
- protected final Map<Integer, String> masks = new HashMap<Integer, String>(7);
-
- /**
- * Returns the mask name given the value of the mask
- *
- * @return the mask name or <code>null</code> if no masks has been found
- */
- public String getMaskLabel(int value) {
- return masks.get(value);
- }
+ protected final Map<String, String> masks = new HashMap<String, String>();
/**
* Returns the collection of mask names
- *
+ *
* @return the collection of mask names
*/
public Collection<String> getMaskLabels() {
@@ -66,37 +55,29 @@ public class ParameterLabelHelper extends StereotypedElementLabelHelper {
/**
* Returns the map of masks used to display a {@link Parameter}
- *
+ *
* @return the {@link Map} of masks used to display a {@link Parameter}
*/
- public Map<Integer, String> getMasks() {
+ public Map<String, String> getMasks() {
return masks;
}
- /**
- * Returns the collection of mask values
- *
- * @return the collection of mask values
- */
- public Set<Integer> getMaskValues() {
- return masks.keySet();
- }
-
/** Disable constructor (private) */
protected ParameterLabelHelper() {
super();
// initialize the map
masks.clear();
- masks.put(ICustomAppearence.DISP_PARAMETER_DIRECTION, "Direction");
- masks.put(ICustomAppearence.DISP_PARAMETER_NAME, "Name");
- masks.put(ICustomAppearence.DISP_PARAMETER_TYPE, "Type");
+ masks.put(ICustomAppearance.DISP_DIRECTION, "Direction");
+ masks.put(ICustomAppearance.DISP_NAME, "Name");
+ masks.put(ICustomAppearance.DISP_TYPE, "Type");
}
/**
* {@inheritDoc}
*/
+ @Override
protected String elementLabel(GraphicalEditPart editPart) {
- int displayValue = ICustomAppearence.DEFAULT_UML_PARAMETER;
+ Collection<String> displayValue = ICustomAppearance.DEFAULT_UML_PARAMETER;
IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy)editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
if(policy != null) {
@@ -112,6 +93,7 @@ public class ParameterLabelHelper extends StereotypedElementLabelHelper {
/**
* {@inheritDoc}
*/
+ @Override
public Parameter getUMLElement(GraphicalEditPart editPart) {
return (Parameter)((View)editPart.getModel()).getElement();
}

Back to the top