Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Maggi2015-04-17 08:54:45 -0400
committerGerrit Code Review @ Eclipse.org2017-02-03 04:20:49 -0500
commit4c87c83eec447b2ca5084b20078f2548bc461673 (patch)
tree17b577d16245df4c4b282b1f27ecf64e4f235ef7 /examples
parentbe602cab9bf0a5ebda436ee5e3c2f8c75be4f7b8 (diff)
downloadorg.eclipse.papyrus-4c87c83eec447b2ca5084b20078f2548bc461673.tar.gz
org.eclipse.papyrus-4c87c83eec447b2ca5084b20078f2548bc461673.tar.xz
org.eclipse.papyrus-4c87c83eec447b2ca5084b20078f2548bc461673.zip
Bug 464625: [All Diagrams] Direct edition should rely on service edit to
manipulate values https://bugs.eclipse.org/bugs/show_bug.cgi?id=464625 - Modify AbstractElementTypeBasedAttributeParser to use IElementEditService - Modify Template regenerate all diagrams (except InteractionOverview with the missing gmfgen) Change-Id: I19a0f8fe5a2e6b9ec4e5e92be6990753bc1dbf9b Signed-off-by: Gabriel Pascual <gabriel.pascual@all4tec.net> Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
Diffstat (limited to 'examples')
-rwxr-xr-x[-rw-r--r--]examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/MessageFormatParser.java408
1 files changed, 204 insertions, 204 deletions
diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/MessageFormatParser.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/MessageFormatParser.java
index 605b092148a..4c8ac2b656d 100644..100755
--- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/MessageFormatParser.java
+++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/MessageFormatParser.java
@@ -1,204 +1,204 @@
-package org.eclipse.papyrus.example.diagram.simplediagram.parsers;
-
-import java.text.FieldPosition;
-import java.text.MessageFormat;
-import java.text.ParsePosition;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.tooling.runtime.parsers.AbstractAttributeParser;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.example.diagram.simplediagram.part.Messages;
-import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class MessageFormatParser extends AbstractAttributeParser {
-
- /**
- * @generated
- */
- private String defaultPattern;
- /**
- * @generated
- */
- private String defaultEditablePattern;
-
- /**
- * @generated
- */
- private MessageFormat viewProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editorProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editProcessor;
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features) {
- super(features);
- }
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features,
- EAttribute[] editableFeatures) {
- super(features, editableFeatures);
- }
-
- /**
- * @generated
- */
- protected String getDefaultPattern() {
- if (defaultPattern == null) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < features.length; i++) {
- if (i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultPattern = sb.toString();
- }
- return defaultPattern;
- }
-
- /**
- * @generated
- */
- public void setViewPattern(String viewPattern) {
- super.setViewPattern(viewPattern);
- viewProcessor = null;
- }
-
- /**
- * @generated
- */
- public void setEditorPattern(String editorPattern) {
- super.setEditorPattern(editorPattern);
- editorProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getViewProcessor() {
- if (viewProcessor == null) {
- viewProcessor = new MessageFormat(
- getViewPattern() == null ? getDefaultPattern()
- : getViewPattern());
- }
- return viewProcessor;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditorProcessor() {
- if (editorProcessor == null) {
- editorProcessor = new MessageFormat(
- getEditorPattern() == null ? getDefaultEditablePattern()
- : getEditorPattern());
- }
- return editorProcessor;
- }
-
- /**
- * @generated
- */
- protected String getDefaultEditablePattern() {
- if (defaultEditablePattern == null) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < editableFeatures.length; i++) {
- if (i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultEditablePattern = sb.toString();
- }
- return defaultEditablePattern;
- }
-
- /**
- * @generated
- */
- public void setEditPattern(String editPattern) {
- super.setEditPattern(editPattern);
- editProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditProcessor() {
- if (editProcessor == null) {
- editProcessor = new MessageFormat(
- getEditPattern() == null ? getDefaultEditablePattern()
- : getEditPattern());
- }
- return editProcessor;
- }
-
- /**
- * @generated
- */
- public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject) adapter.getAdapter(EObject.class);
- return getEditorProcessor().format(getEditableValues(element),
- new StringBuffer(), new FieldPosition(0)).toString();
- }
-
- /**
- * @generated
- */
- public IParserEditStatus isValidEditString(IAdaptable adapter,
- String editString) {
- ParsePosition pos = new ParsePosition(0);
- Object[] values = getEditProcessor().parse(editString, pos);
- if (values == null) {
- return new ParserEditStatus(UMLDiagramEditorPlugin.ID,
- IParserEditStatus.UNEDITABLE, NLS.bind(
- Messages.MessageFormatParser_InvalidInputError,
- new Integer(pos.getErrorIndex())));
- }
- return validateNewValues(values);
- }
-
- /**
- * @generated
- */
- public ICommand getParseCommand(IAdaptable adapter, String newString,
- int flags) {
- Object[] values = getEditProcessor().parse(newString,
- new ParsePosition(0));
- return getParseCommand(adapter, values, flags);
- }
-
- /**
- * @generated
- */
- public String getPrintString(IAdaptable adapter, int flags) {
- EObject element = (EObject) adapter.getAdapter(EObject.class);
- return getViewProcessor().format(getValues(element),
- new StringBuffer(), new FieldPosition(0)).toString();
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.parsers;
+
+import java.text.FieldPosition;
+import java.text.MessageFormat;
+import java.text.ParsePosition;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.tooling.runtime.parsers.AbstractAttributeParser;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.example.diagram.simplediagram.part.Messages;
+import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLDiagramEditorPlugin;
+
+/**
+ * @generated
+ */
+public class MessageFormatParser extends AbstractAttributeParser {
+
+ /**
+ * @generated
+ */
+ private String defaultPattern;
+ /**
+ * @generated
+ */
+ private String defaultEditablePattern;
+
+ /**
+ * @generated
+ */
+ private MessageFormat viewProcessor;
+
+ /**
+ * @generated
+ */
+ private MessageFormat editorProcessor;
+
+ /**
+ * @generated
+ */
+ private MessageFormat editProcessor;
+
+ /**
+ * @generated
+ */
+ public MessageFormatParser(EAttribute[] features) {
+ super(features);
+ }
+
+ /**
+ * @generated
+ */
+ public MessageFormatParser(EAttribute[] features,
+ EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultPattern() {
+ if (defaultPattern == null) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < features.length; i++) {
+ if (i > 0) {
+ sb.append(' ');
+ }
+ sb.append('{');
+ sb.append(i);
+ sb.append('}');
+ }
+ defaultPattern = sb.toString();
+ }
+ return defaultPattern;
+ }
+
+ /**
+ * @generated
+ */
+ public void setViewPattern(String viewPattern) {
+ super.setViewPattern(viewPattern);
+ viewProcessor = null;
+ }
+
+ /**
+ * @generated
+ */
+ public void setEditorPattern(String editorPattern) {
+ super.setEditorPattern(editorPattern);
+ editorProcessor = null;
+ }
+
+ /**
+ * @generated
+ */
+ protected MessageFormat getViewProcessor() {
+ if (viewProcessor == null) {
+ viewProcessor = new MessageFormat(
+ getViewPattern() == null ? getDefaultPattern()
+ : getViewPattern());
+ }
+ return viewProcessor;
+ }
+
+ /**
+ * @generated
+ */
+ protected MessageFormat getEditorProcessor() {
+ if (editorProcessor == null) {
+ editorProcessor = new MessageFormat(
+ getEditorPattern() == null ? getDefaultEditablePattern()
+ : getEditorPattern());
+ }
+ return editorProcessor;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultEditablePattern() {
+ if (defaultEditablePattern == null) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < editableFeatures.length; i++) {
+ if (i > 0) {
+ sb.append(' ');
+ }
+ sb.append('{');
+ sb.append(i);
+ sb.append('}');
+ }
+ defaultEditablePattern = sb.toString();
+ }
+ return defaultEditablePattern;
+ }
+
+ /**
+ * @generated
+ */
+ public void setEditPattern(String editPattern) {
+ super.setEditPattern(editPattern);
+ editProcessor = null;
+ }
+
+ /**
+ * @generated
+ */
+ protected MessageFormat getEditProcessor() {
+ if (editProcessor == null) {
+ editProcessor = new MessageFormat(
+ getEditPattern() == null ? getDefaultEditablePattern()
+ : getEditPattern());
+ }
+ return editProcessor;
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditString(IAdaptable adapter, int flags) {
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
+ return getEditorProcessor().format(getEditableValues(element),
+ new StringBuffer(), new FieldPosition(0)).toString();
+ }
+
+ /**
+ * @generated
+ */
+ public IParserEditStatus isValidEditString(IAdaptable adapter,
+ String editString) {
+ ParsePosition pos = new ParsePosition(0);
+ Object[] values = getEditProcessor().parse(editString, pos);
+ if (values == null) {
+ return new ParserEditStatus(UMLDiagramEditorPlugin.ID,
+ IParserEditStatus.UNEDITABLE, NLS.bind(
+ Messages.MessageFormatParser_InvalidInputError,
+ new Integer(pos.getErrorIndex())));
+ }
+ return validateNewValues(values);
+ }
+
+ /**
+ * @generated
+ */
+ public ICommand getParseCommand(IAdaptable adapter, String newString,
+ int flags) {
+ Object[] values = getEditProcessor().parse(newString,
+ new ParsePosition(0));
+ return getParseCommand(adapter, values, flags);
+ }
+
+ /**
+ * @generated
+ */
+ public String getPrintString(IAdaptable adapter, int flags) {
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
+ return getViewProcessor().format(getValues(element),
+ new StringBuffer(), new FieldPosition(0)).toString();
+ }
+
+}

Back to the top