Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael ADAM2014-09-09 15:00:59 +0000
committerMickael ADAM2014-09-23 12:06:57 +0000
commit3d8a37d4c55ba794588e8f17d5abc89aa9a8fcb4 (patch)
tree6072e6f533d7c79e7cde62a70c1cd5a1fef6445b /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu
parent802249ab83497e7e4f8b472a89c92b3486db874b (diff)
downloadorg.eclipse.papyrus-3d8a37d4c55ba794588e8f17d5abc89aa9a8fcb4.tar.gz
org.eclipse.papyrus-3d8a37d4c55ba794588e8f17d5abc89aa9a8fcb4.tar.xz
org.eclipse.papyrus-3d8a37d4c55ba794588e8f17d5abc89aa9a8fcb4.zip
440226: [All Diagrams] Allow Left side label edition (not only right
side ) https://bugs.eclipse.org/bugs/show_bug.cgi?id=440226 Patch Set 1: -Squach Previous commit Description of previous Patch Set: Patch set 1 - Applied new locator to Port of component diagram - add method to notationUtils to getIntValue etc.. Patch Set 3: -Implementation of text alignment for PortNameEP and PapyrusLabelEP(Label from connection) -Add button/command to set alignement -Fix custumStyleValueCommand Patch Set 4: -Implementation for SysML -Use of PapyrusEditPart for PortEditPart -Some Fix -TODO use generation to chance override of the portEditPart(xtend already change, but code not generated). This must be do for each diagram. It will be do on an other commit. Patch Set 2: -fix on xtend Patch set 3 et 4 et 5: -fix conflict resolved error Change-Id: Ie0699d213abd4a7c39f8cff457c7dfe27a41eba3 Signed-off-by: Mickael ADAM <mickael.adam@ALL4TEC.net>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/META-INF/MANIFEST.MF81
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignCenter.pngbin0 -> 234 bytes
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignLeft.pngbin0 -> 209 bytes
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignRight.pngbin0 -> 209 bytes
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml125
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/TextAlignmentAction.java101
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/handlers/TextAlignementHandler.java93
7 files changed, 360 insertions, 40 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/META-INF/MANIFEST.MF
index d2de32d3de7..fc1dcac2872 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/META-INF/MANIFEST.MF
@@ -1,40 +1,41 @@
-Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.uml.diagram.menu,
- org.eclipse.papyrus.uml.diagram.menu.actions,
- org.eclipse.papyrus.uml.diagram.menu.actions.handlers
-Require-Bundle: org.eclipse.ui,
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.1",
- org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="1.0.1",
- org.eclipse.gmf.runtime.diagram.ui.actions,
- org.eclipse.gmf.runtime.draw2d.ui.render;bundle-version="1.4.0",
- org.eclipse.core.expressions,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor,
- org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="1.1.0",
- org.eclipse.gmf.runtime.diagram.ui.properties;bundle-version="1.2.0",
- org.eclipse.gmf.runtime.diagram.ui.actions,
- org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="1.2.0",
- org.eclipse.papyrus.uml.diagram.wizards;bundle-version="1.0.1",
- org.eclipse.papyrus.uml.diagram.common;bundle-version="1.0.1",
- org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.1",
- org.eclipse.papyrus.uml.tools;bundle-version="1.0.1",
- org.eclipse.papyrus.infra.core.log;bundle-version="1.0.1",
- org.eclipse.uml2.uml;bundle-version="4.0.0",
- org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.1",
- org.eclipse.papyrus.infra.core;bundle-version="1.0.1",
- org.eclipse.ui.ide;bundle-version="3.8.0",
- org.eclipse.papyrus.infra.emf;bundle-version="1.0.1",
- org.eclipse.papyrus.infra.widgets;bundle-version="1.0.1",
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.1",
- org.eclipse.papyrus.infra.tools;bundle-version="1.0.1",
- org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.0.1"
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.0.1.qualifier
-Bundle-Localization: plugin
-Bundle-Name: %pluginName
-Bundle-Activator: org.eclipse.papyrus.uml.diagram.menu.Activator
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.menu;singleton:=t
- rue
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
+Manifest-Version: 1.0
+Export-Package: org.eclipse.papyrus.uml.diagram.menu,
+ org.eclipse.papyrus.uml.diagram.menu.actions,
+ org.eclipse.papyrus.uml.diagram.menu.actions.handlers
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.1",
+ org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="1.0.1",
+ org.eclipse.gmf.runtime.diagram.ui.actions,
+ org.eclipse.gmf.runtime.draw2d.ui.render;bundle-version="1.4.0",
+ org.eclipse.core.expressions,
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor,
+ org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="1.1.0",
+ org.eclipse.gmf.runtime.diagram.ui.properties;bundle-version="1.2.0",
+ org.eclipse.gmf.runtime.diagram.ui.actions,
+ org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.diagram.wizards;bundle-version="1.0.1",
+ org.eclipse.papyrus.uml.diagram.common;bundle-version="1.0.1",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.1",
+ org.eclipse.papyrus.uml.tools;bundle-version="1.0.1",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.1",
+ org.eclipse.uml2.uml;bundle-version="4.0.0",
+ org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.1",
+ org.eclipse.papyrus.infra.core;bundle-version="1.0.1",
+ org.eclipse.ui.ide;bundle-version="3.8.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.0.1",
+ org.eclipse.papyrus.infra.widgets;bundle-version="1.0.1",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.1",
+ org.eclipse.papyrus.infra.tools;bundle-version="1.0.1",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.0.1",
+ org.eclipse.gmf.runtime.notation.edit
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.0.1.qualifier
+Bundle-Localization: plugin
+Bundle-Name: %pluginName
+Bundle-Activator: org.eclipse.papyrus.uml.diagram.menu.Activator
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.menu;singleton:=t
+ rue
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignCenter.png b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignCenter.png
new file mode 100644
index 00000000000..57beb381397
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignCenter.png
Binary files differ
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignLeft.png b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignLeft.png
new file mode 100644
index 00000000000..6c8fcc1165a
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignLeft.png
Binary files differ
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignRight.png b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignRight.png
new file mode 100644
index 00000000000..a1502571c99
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/icons/textAlignRight.png
Binary files differ
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
index b0caae4320d..b935c20de16 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
@@ -294,6 +294,23 @@
</command>
<command
commandId="org.eclipse.papyrus.uml.diagram.menu.toolbar.command"
+ icon="icons/textAlignLeft.png"
+ id="org.eclipse.papyrus.menu.text_alignment.toolbar.command"
+ style="pulldown"
+ tooltip="Text Alignment Actions">
+ <visibleWhen>
+ <and>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.menu.toolbar.command"
icon="icons/fantom.gif"
id="org.eclipse.papyrus.menu.showhide.toolbar.command"
style="pulldown"
@@ -549,6 +566,27 @@
</command>
</menuContribution>
<menuContribution
+ locationURI="menu:org.eclipse.papyrus.menu.text_alignment.toolbar.command">
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.left"
+ icon="icons/textAlignLeft.png"
+ label="Text Align &amp;Left"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.center"
+ icon="icons/textAlignCenter.png"
+ label="Text Align &amp;Center"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.right"
+ icon="icons/textAlignRight.png"
+ label="Text Align &amp;Right"
+ style="push">
+ </command>
+ </menuContribution>
+ <menuContribution
locationURI="menu:org.eclipse.papyrus.menu.showhide.toolbar.command">
<command
commandId="org.eclipse.papyrus.uml.diagram.menu.commands.ShowHideContentsCommand"
@@ -1107,6 +1145,30 @@
</command>
</menu>
<menu
+ icon="icons/textAlignLeft.png"
+ id="org.eclipse.papyrus.uml.diagram.ui.menu.textAlignMenu"
+ label="Text Alignment"
+ tooltip="Text Alignement Menu">
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.left"
+ icon="icons/textAlignLeft.png"
+ label="Text Align &amp;Left"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.center"
+ icon="icons/textAlignCenter.png"
+ label="Text Align &amp;Center"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.right"
+ icon="icons/textAlignRight.png"
+ label="Text Align &amp;Right"
+ style="push">
+ </command>
+ </menu>
+ <menu
icon="icons/horizontal_by_left.gif"
id="org.eclipse.papyrus.uml.diagram.ui.menu.routingMenu"
label="&amp;Routing"
@@ -1804,6 +1866,30 @@
</command>
</menu>
<menu
+ icon="icons/textAlignLeft.png"
+ id="org.eclipse.papyrus.uml.diagram.ui.menu.textAlignMenu"
+ label="Text Alignment"
+ tooltip="Text Alignement Menu">
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.left"
+ icon="icons/textAlignLeft.png"
+ label="Text Align &amp;Left"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.center"
+ icon="icons/textAlignCenter.png"
+ label="Text Align &amp;Center"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.right"
+ icon="icons/textAlignRight.png"
+ label="Text Align &amp;Right"
+ style="push">
+ </command>
+ </menu>
+ <menu
icon="icons/horizontal_by_left.gif"
id="org.eclipse.papyrus.uml.diagram.ui.popupmenu.format.routingMenu"
label="&amp;Routing"
@@ -2449,6 +2535,45 @@
id="org.eclipse.papyrus.uml.diagram.menu.commands.SnapBack"
name="Snap Back">
</command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ description="Call the Text Align on Left Command"
+ id="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.left"
+ name="Text Align Left Command">
+ <defaultHandler
+ class="org.eclipse.papyrus.uml.diagram.menu.actions.handlers.TextAlignementHandler">
+ <parameter
+ name="org.eclipse.papyrus.uml.diagram.menu.commandTextAlignmentParameter"
+ value="parameter_left">
+ </parameter>
+ </defaultHandler>
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ description="Call the Text Align on Center Command"
+ id="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.center"
+ name="Text Align Center Command">
+ <defaultHandler
+ class="org.eclipse.papyrus.uml.diagram.menu.actions.handlers.TextAlignementHandler">
+ <parameter
+ name="org.eclipse.papyrus.uml.diagram.menu.commandTextAlignmentParameter"
+ value="parameter_center">
+ </parameter>
+ </defaultHandler>
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ description="Call the Text Align on Right Command"
+ id="org.eclipse.papyrus.uml.diagram.menu.command.text_alignment.right"
+ name="Text Align Right Command">
+ <defaultHandler
+ class="org.eclipse.papyrus.uml.diagram.menu.actions.handlers.TextAlignementHandler">
+ <parameter
+ name="org.eclipse.papyrus.uml.diagram.menu.commandTextAlignmentParameter"
+ value="parameter_right">
+ </parameter>
+ </defaultHandler>
+ </command>
</extension>
<extension
id="viewCommands"
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/TextAlignmentAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/TextAlignmentAction.java
new file mode 100644
index 00000000000..b81674e6ef2
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/TextAlignmentAction.java
@@ -0,0 +1,101 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.menu.actions;
+
+import java.util.List;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.databinding.custom.CustomStyleValueCommand;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
+
+
+/**
+ * The Class provides actions for the text alignment.
+ */
+public class TextAlignmentAction {
+
+ /** The alignment type. */
+ private int textAlignment;
+
+ /** the selected elements. */
+ private List<IGraphicalEditPart> selectedElements;
+
+ /**
+ * Constructor.
+ *
+ * @param textAlignment
+ * text Alignment Type
+ * @param selectedElements
+ * List of selected EditParts
+ */
+ public TextAlignmentAction(int textAlignment, List<IGraphicalEditPart> selectedElements) {
+ this.textAlignment = textAlignment;
+ this.selectedElements = selectedElements;
+ }
+
+ /**
+ * Returns the command according to the request.
+ *
+ * @return the command according to the request
+ */
+ public Command getCommand() {
+ CompoundCommand cc = new CompoundCommand("Change value for text alignment"); //$NON-NLS-1$
+ for (IGraphicalEditPart editPart : selectedElements) {
+ if (editPart instanceof PapyrusLabelEditPart && editPart.getModel() != null) {
+ // get the view
+ final View view = (View) editPart.getModel();
+ // set the edit command
+ Command command = new CustomStyleValueCommand(view, literalPositionConstant(textAlignment), NotationPackage.eINSTANCE.getStringValueStyle(), NotationPackage.eINSTANCE.getStringValueStyle_StringValue(), "textAlignment");
+ cc.append(command);
+ }
+ }
+ if (!cc.isEmpty() && cc.canExecute()) {
+ return cc;
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Literal position constant.
+ *
+ * @param textAlignment
+ * the text alignment
+ * @return the string of the position constant
+ */
+ private String literalPositionConstant(int textAlignment) {
+ String position;
+ switch (textAlignment) {
+ case PositionConstants.LEFT:
+ position = "left";
+ break;
+ case PositionConstants.CENTER:
+ position = "center";
+ break;
+ case PositionConstants.RIGHT:
+ position = "right";
+ break;
+ default:
+ position = "left";
+ break;
+ }
+ return position;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/handlers/TextAlignementHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/handlers/TextAlignementHandler.java
new file mode 100644
index 00000000000..a8d0cbaf225
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/handlers/TextAlignementHandler.java
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.menu.actions.handlers;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper;
+import org.eclipse.papyrus.uml.diagram.common.handlers.ParametricAndListeningHandler;
+import org.eclipse.papyrus.uml.diagram.common.layout.LayoutUtils;
+import org.eclipse.papyrus.uml.diagram.menu.actions.TextAlignmentAction;
+
+/**
+ *
+ * Handler for the AlignmentAction
+ *
+ */
+public class TextAlignementHandler extends ParametricAndListeningHandler {
+
+ /** the action executed by this handler */
+ protected TextAlignmentAction action = null;
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public TextAlignementHandler() {
+ super("org.eclipse.papyrus.uml.diagram.menu.commandTextAlignmentParameter"); //$NON-NLS-1$
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler#getCommand()
+ *
+ * @return
+ * @throws ExecutionException
+ */
+ @Override
+ protected Command getCommand() {
+ super.getCommand();
+ this.action = new TextAlignmentAction(getAlignment(this.parameter), this.getSelectedElements());
+ Command cmd = new EMFtoGEFCommandWrapper(action.getCommand());
+ return (cmd == null) ? UnexecutableCommand.INSTANCE : cmd;
+
+ }
+
+ /**
+ *
+ * @param param
+ * the parameter for the alignment action
+ * @return
+ * the value represented by this parameter, this value can be :
+ * <ul>
+ * <li> {@link PositionConstants#NONE}</li>
+ * <li> {@link PositionConstants#TOP}</li>
+ * <li> {@link PositionConstants#BOTTOM}</li>
+ * <li> {@link PositionConstants#MIDDLE}</li>
+ * <li> {@link PositionConstants#LEFT}</li>
+ * <li> {@link PositionConstants#RIGHT}</li>
+ * <li> {@link PositionConstants#CENTER}</li>
+ * </ul>
+ */
+ public int getAlignment(String param) {
+ if (param.equals(LayoutUtils.LEFT)) {
+ return PositionConstants.LEFT;
+ } else if (param.equals(LayoutUtils.CENTER)) {
+ return PositionConstants.CENTER;
+ } else if (param.equals(LayoutUtils.RIGHT)) {
+ return PositionConstants.RIGHT;
+ } else if (param.equals(LayoutUtils.BOTTOM)) {
+ return PositionConstants.BOTTOM;
+ } else if (param.equals(LayoutUtils.MIDDLE)) {
+ return PositionConstants.MIDDLE;
+ } else if (param.equals(LayoutUtils.TOP)) {
+ return PositionConstants.TOP;
+ }
+ return PositionConstants.NONE;
+ }
+
+}

Back to the top