diff options
author | Quentin Le Menez | 2018-01-09 10:09:46 +0000 |
---|---|---|
committer | Quentin Le Menez | 2018-01-09 13:18:15 +0000 |
commit | d98116b5b376f18b6cf626ba4158a35fe9a4a64e (patch) | |
tree | 4458c9c5ada0a216b385813a56ea9a9b8c7b6509 /plugins/infra/services/org.eclipse.papyrus.infra.services.edit | |
parent | 453e99bc2dcbd5fabad100f9d0d5f682013c3b19 (diff) | |
download | org.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.tar.gz org.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.tar.xz org.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.zip |
Bug 515367 - [releng] Uniformization of the end of lines to Unix standard
- Format the EOL of all the files matched by: grep -rIUs . | xargs -Ifile dos2unix -k 'file'
Change-Id: I5c41d540a9a67b50de9b912ab35e16cc9a912961
Signed-off-by: Quentin Le Menez <quentin.lemenez@cea.fr>
Diffstat (limited to 'plugins/infra/services/org.eclipse.papyrus.infra.services.edit')
16 files changed, 752 insertions, 752 deletions
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/about.html b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/about.html index 82d49bf5f81..d35d5aed64c 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/about.html +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/build.properties b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/build.properties index eeb935e5b6e..5cba31211dd 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/build.properties +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/build.properties @@ -1,11 +1,11 @@ -bin.includes = META-INF/,\
- .,\
- plugin.properties,\
- build.properties,\
- about.html,\
- messages.properties,\
- plugin.xml,\
- model/
-output.. = bin/
-src.includes = about.html
-source.. = src/
+bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + build.properties,\ + about.html,\ + messages.properties,\ + plugin.xml,\ + model/ +output.. = bin/ +src.includes = about.html +source.. = src/ diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/model/marker.elementtypesconfigurations b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/model/marker.elementtypesconfigurations index aad513ad460..605588300cf 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/model/marker.elementtypesconfigurations +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/model/marker.elementtypesconfigurations @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ASCII"?>
-<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmi:id="_rWI4YHPzEeSnGJwaJWHCSg" description="" identifier="org.eclipse.papyrus.infra.services.edit.marker.elementTypeSet" name="Marker" metamodelNsURI="http://www.eclipse.org/emf/2002/Ecore">
- <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_jxuLwPvzEeWw0r4E4rSXyw" description="" identifier="org.eclipse.papyrus.infra.services.edit.markerDeletionAdvice" editHelperAdviceClassName="org.eclipse.papyrus.infra.services.edit.internal.advice.MarkerDeletionAdvice"/>
-</elementtypesconfigurations:ElementTypeSetConfiguration>
+<?xml version="1.0" encoding="ASCII"?> +<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmi:id="_rWI4YHPzEeSnGJwaJWHCSg" description="" identifier="org.eclipse.papyrus.infra.services.edit.marker.elementTypeSet" name="Marker" metamodelNsURI="http://www.eclipse.org/emf/2002/Ecore"> + <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_jxuLwPvzEeWw0r4E4rSXyw" description="" identifier="org.eclipse.papyrus.infra.services.edit.markerDeletionAdvice" editHelperAdviceClassName="org.eclipse.papyrus.infra.services.edit.internal.advice.MarkerDeletionAdvice"/> +</elementtypesconfigurations:ElementTypeSetConfiguration> diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/plugin.properties b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/plugin.properties index 826d5d7244f..1a84d9a4188 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/plugin.properties +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/plugin.properties @@ -1,13 +1,13 @@ -#################################################################################
-# Copyright (c) 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
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
-# Yann Tanguy yann.tanguy@cea.fr - GMF Runtime based edit service for model type
-##################################################################################
-pluginName=Papyrus Edit Service
-providerName=Eclipse Modeling Project
+################################################################################# +# Copyright (c) 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 +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation +# Yann Tanguy yann.tanguy@cea.fr - GMF Runtime based edit service for model type +################################################################################## +pluginName=Papyrus Edit Service +providerName=Eclipse Modeling Project diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/pom.xml b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/pom.xml index 421960b2969..6a9aa72899e 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/pom.xml +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/pom.xml @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.eclipse.papyrus</groupId>
- <artifactId>org.eclipse.papyrus.infra-services</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <artifactId>org.eclipse.papyrus.infra.services.edit</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
+<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.infra-services</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>org.eclipse.papyrus.infra.services.edit</artifactId> + <version>3.0.0-SNAPSHOT</version> + <packaging>eclipse-plugin</packaging> </project>
\ No newline at end of file diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/Activator.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/Activator.java index ab2490b5b69..3d4c4ad5146 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/Activator.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/Activator.java @@ -1,61 +1,61 @@ -/*****************************************************************************
- * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
- *
- * 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:
- *
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- * Christian W. Damus - bug 485220
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends Plugin {
-
- /** Plug-in ID */
- public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.services.edit"; //$NON-NLS-1$
-
- /** Shared instance */
- private static Activator plugin;
-
- /** Default constructor */
- public Activator() {
- }
-
- /** Logging helper */
- public static LogHelper log;
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- log = new LogHelper(plugin);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others. + * + * 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: + * + * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation + * Christian W. Damus - bug 485220 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit; + +import org.eclipse.core.runtime.Plugin; +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends Plugin { + + /** Plug-in ID */ + public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.services.edit"; //$NON-NLS-1$ + + /** Shared instance */ + private static Activator plugin; + + /** Default constructor */ + public Activator() { + } + + /** Logging helper */ + public static LogHelper log; + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(plugin); + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/AbstractConfigureCommandFactory.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/AbstractConfigureCommandFactory.java index b209993d5bd..969f8dac147 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/AbstractConfigureCommandFactory.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/AbstractConfigureCommandFactory.java @@ -1,42 +1,42 @@ -/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-
-/**
- * <pre>
- * Abstract configure command factory with the possibility to create a configure element
- * command to cancel the creation command in progress.
- * </pre>
- */
-public abstract class AbstractConfigureCommandFactory implements IConfigureCommandFactory {
-
- /** Create a command to cancel the element creation currently configured. */
- protected ICommand cancelCommand(ConfigureRequest request) {
- return new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return CommandResult.newCancelledCommandResult();
- }
- };
- }
-}
+/***************************************************************************** + * Copyright (c) 2011 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: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit.commands; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand; +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; + +/** + * <pre> + * Abstract configure command factory with the possibility to create a configure element + * command to cancel the creation command in progress. + * </pre> + */ +public abstract class AbstractConfigureCommandFactory implements IConfigureCommandFactory { + + /** Create a command to cancel the element creation currently configured. */ + protected ICommand cancelCommand(ConfigureRequest request) { + return new ConfigureElementCommand(request) { + + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + return CommandResult.newCancelledCommandResult(); + } + }; + } +} diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/ConfigureFeatureCommandFactory.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/ConfigureFeatureCommandFactory.java index 5e7651fbd32..7b3721509fa 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/ConfigureFeatureCommandFactory.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/ConfigureFeatureCommandFactory.java @@ -1,62 +1,62 @@ -/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-
-/**
- * Configure command factory that set a {@link EStructuralFeature} of the new element.
- */
-public class ConfigureFeatureCommandFactory extends AbstractConfigureCommandFactory {
-
- /** The feature to set */
- private EStructuralFeature feature;
-
- /** The feature value */
- private Object value;
-
- /** Constructor */
- public ConfigureFeatureCommandFactory(EStructuralFeature feature, Object value) {
- super();
- this.feature = feature;
- this.value = value;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ConfigureElementCommand create(ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- EObject eObject = getElementToEdit();
- eObject.eSet(feature, value);
-
- return CommandResult.newOKCommandResult(eObject);
- }
-
- };
- }
-}
+/***************************************************************************** + * Copyright (c) 2011 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: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit.commands; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand; +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; + +/** + * Configure command factory that set a {@link EStructuralFeature} of the new element. + */ +public class ConfigureFeatureCommandFactory extends AbstractConfigureCommandFactory { + + /** The feature to set */ + private EStructuralFeature feature; + + /** The feature value */ + private Object value; + + /** Constructor */ + public ConfigureFeatureCommandFactory(EStructuralFeature feature, Object value) { + super(); + this.feature = feature; + this.value = value; + } + + /** + * {@inheritDoc} + */ + @Override + public ConfigureElementCommand create(ConfigureRequest request) { + + return new ConfigureElementCommand(request) { + + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + + EObject eObject = getElementToEdit(); + eObject.eSet(feature, value); + + return CommandResult.newOKCommandResult(eObject); + } + + }; + } +} diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/ConfigureFeatureListCommandFactory.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/ConfigureFeatureListCommandFactory.java index 9adf52795f4..6c00cf77a63 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/ConfigureFeatureListCommandFactory.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/ConfigureFeatureListCommandFactory.java @@ -1,62 +1,62 @@ -/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit.commands;
-
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-
-/**
- * Configure command factory that set a list of {@link EStructuralFeature} of the new element.
- */
-public class ConfigureFeatureListCommandFactory extends AbstractConfigureCommandFactory {
-
- /** A Map containing the {@link EStructuralFeature} to be set and their values. */
- private Map<EStructuralFeature, Object> featureValueMap;
-
- /** Constructor */
- public ConfigureFeatureListCommandFactory(Map<EStructuralFeature, Object> featureValueMap) {
- super();
- this.featureValueMap = featureValueMap;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ConfigureElementCommand create(ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- EObject eObject = getElementToEdit();
- for (EStructuralFeature feature : featureValueMap.keySet()) {
- eObject.eSet(feature, featureValueMap.get(feature));
- }
-
- return CommandResult.newOKCommandResult(eObject);
- }
-
- };
- }
-}
+/***************************************************************************** + * Copyright (c) 2011 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: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit.commands; + +import java.util.Map; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand; +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; + +/** + * Configure command factory that set a list of {@link EStructuralFeature} of the new element. + */ +public class ConfigureFeatureListCommandFactory extends AbstractConfigureCommandFactory { + + /** A Map containing the {@link EStructuralFeature} to be set and their values. */ + private Map<EStructuralFeature, Object> featureValueMap; + + /** Constructor */ + public ConfigureFeatureListCommandFactory(Map<EStructuralFeature, Object> featureValueMap) { + super(); + this.featureValueMap = featureValueMap; + } + + /** + * {@inheritDoc} + */ + @Override + public ConfigureElementCommand create(ConfigureRequest request) { + + return new ConfigureElementCommand(request) { + + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + + EObject eObject = getElementToEdit(); + for (EStructuralFeature feature : featureValueMap.keySet()) { + eObject.eSet(feature, featureValueMap.get(feature)); + } + + return CommandResult.newOKCommandResult(eObject); + } + + }; + } +} diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/IConfigureCommandFactory.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/IConfigureCommandFactory.java index 7f04731d7d5..c4291ec0764 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/IConfigureCommandFactory.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/commands/IConfigureCommandFactory.java @@ -1,38 +1,38 @@ -/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit.commands;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-
-/**
- * <pre>
- * This kind of factory may be added in an element creation request and used
- * by the configure command to complete the existing configure command.
- * </pre>
- */
-public interface IConfigureCommandFactory {
-
- /** ID to store {@link IConfigureCommandFactory} in request */
- public static final String CONFIGURE_COMMAND_FACTORY_ID = "IConfigureCommandFactory_ID"; //$NON-NLS-1$
-
- /**
- * Create a configure element command.
- *
- * @param request
- * the configure request.
- * @return the configure command.
- */
- public ICommand create(final ConfigureRequest request);
-}
+/***************************************************************************** + * Copyright (c) 2011 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: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit.commands; + +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; + +/** + * <pre> + * This kind of factory may be added in an element creation request and used + * by the configure command to complete the existing configure command. + * </pre> + */ +public interface IConfigureCommandFactory { + + /** ID to store {@link IConfigureCommandFactory} in request */ + public static final String CONFIGURE_COMMAND_FACTORY_ID = "IConfigureCommandFactory_ID"; //$NON-NLS-1$ + + /** + * Create a configure element command. + * + * @param request + * the configure request. + * @return the configure command. + */ + public ICommand create(final ConfigureRequest request); +} diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/internal/ElementEditService.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/internal/ElementEditService.java index 51714130860..8acded3cd36 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/internal/ElementEditService.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/internal/ElementEditService.java @@ -1,140 +1,140 @@ -/*****************************************************************************
- * Copyright (c) 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit.internal;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IClientContext;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-
-/**
- * <pre>
- *
- * This class implements {@link IElementEditService}.
- *
- * @see org.eclipse.papyrus.infra.services.edit.service.IElementEditService
- *
- * This class is the service in charge of providing edit command for
- * a specific type of element.
- *
- * This class relies for a large part on the GMF ExtensibleType framework,
- * mostly as a wrapper of {@link IElementType} for Papyrus. No added value
- * for Papyrus is expected in using this wrapper, except the fact that it ensures
- * Papyrus shared {@link IClientContext} is always explicitly used or set in
- * request while retrieving commands.
- *
- * </pre>
- */
-public class ElementEditService implements IElementEditService {
-
- /** The registered {@link IElementType} used to provide edit commands. */
- protected IElementType elementType;
-
- /** Papyrus shared {@link IClientContext} */
- protected IClientContext sharedClientContext;
-
- /**
- * <pre>
- *
- * Constructor.
- *
- * @param elementType the {@link IElementType} this service will use to provide edit commands
- * @param sharedClientContext the shared {@link IClientContext}
- *
- * </pre>
- */
- public ElementEditService(IElementType elementType, IClientContext sharedClientContext) {
- super();
- this.elementType = elementType;
- this.sharedClientContext = sharedClientContext;
- }
-
- /**
- * <pre>
- *
- * This method creates an edit command in response to an edit request.
- * This method directly uses the ElementType framework (through {@link IElementType} api,
- * making sure that the Papyrus shared {@link IClientContext} is explicitly set in the request.
- *
- * @see org.eclipse.papyrus.infra.services.edit.service.IElementEditService#getEditCommand(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
- * @param request the edit request
- * @return the edit command corresponding to the edit request
- *
- * </pre>
- */
- @Override
- public ICommand getEditCommand(IEditCommandRequest request) {
- // Make sure the share client context in passed in the request
- request.setClientContext(sharedClientContext);
-
- // Retrieve the desired edit command using GMF ExtensibleType API
- ICommand editCommand = elementType.getEditCommand(request);
-
- return editCommand;
- }
-
- /**
- * <pre>
- *
- * Get the display name of the element type.
- *
- * @see org.eclipse.papyrus.infra.services.edit.service.IElementEditService#getDisplayName()
- *
- * @return the display name of the {@link IElementType} used by current service.
- *
- * </pre>
- */
- @Override
- public String getDisplayName() {
- return elementType.getDisplayName();
- }
-
- /**
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- *
- * @param adapter
- * @return the adapted object
- */
- @Override
- public Object getAdapter(Class adapter) {
- if (adapter == IElementType.class) {
- return elementType;
- }
- return null;
- }
-
- /**
- * <pre>
- *
- * Test if current service can provide an edit command in response to the request.
- *
- * @see org.eclipse.papyrus.infra.services.edit.service.IElementEditService#canEdit(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
- * @param req the edit request to test
- * @return true is this service can provide edit command for the request
- *
- * </pre>
- */
- @Override
- public boolean canEdit(IEditCommandRequest req) {
- // Make sure the share client context in passed in the request
- req.setClientContext(sharedClientContext);
-
- return elementType.canEdit(req);
- }
-}
+/***************************************************************************** + * Copyright (c) 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit.internal; + +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.IClientContext; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; + +/** + * <pre> + * + * This class implements {@link IElementEditService}. + * + * @see org.eclipse.papyrus.infra.services.edit.service.IElementEditService + * + * This class is the service in charge of providing edit command for + * a specific type of element. + * + * This class relies for a large part on the GMF ExtensibleType framework, + * mostly as a wrapper of {@link IElementType} for Papyrus. No added value + * for Papyrus is expected in using this wrapper, except the fact that it ensures + * Papyrus shared {@link IClientContext} is always explicitly used or set in + * request while retrieving commands. + * + * </pre> + */ +public class ElementEditService implements IElementEditService { + + /** The registered {@link IElementType} used to provide edit commands. */ + protected IElementType elementType; + + /** Papyrus shared {@link IClientContext} */ + protected IClientContext sharedClientContext; + + /** + * <pre> + * + * Constructor. + * + * @param elementType the {@link IElementType} this service will use to provide edit commands + * @param sharedClientContext the shared {@link IClientContext} + * + * </pre> + */ + public ElementEditService(IElementType elementType, IClientContext sharedClientContext) { + super(); + this.elementType = elementType; + this.sharedClientContext = sharedClientContext; + } + + /** + * <pre> + * + * This method creates an edit command in response to an edit request. + * This method directly uses the ElementType framework (through {@link IElementType} api, + * making sure that the Papyrus shared {@link IClientContext} is explicitly set in the request. + * + * @see org.eclipse.papyrus.infra.services.edit.service.IElementEditService#getEditCommand(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest) + * + * @param request the edit request + * @return the edit command corresponding to the edit request + * + * </pre> + */ + @Override + public ICommand getEditCommand(IEditCommandRequest request) { + // Make sure the share client context in passed in the request + request.setClientContext(sharedClientContext); + + // Retrieve the desired edit command using GMF ExtensibleType API + ICommand editCommand = elementType.getEditCommand(request); + + return editCommand; + } + + /** + * <pre> + * + * Get the display name of the element type. + * + * @see org.eclipse.papyrus.infra.services.edit.service.IElementEditService#getDisplayName() + * + * @return the display name of the {@link IElementType} used by current service. + * + * </pre> + */ + @Override + public String getDisplayName() { + return elementType.getDisplayName(); + } + + /** + * + * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) + * + * @param adapter + * @return the adapted object + */ + @Override + public Object getAdapter(Class adapter) { + if (adapter == IElementType.class) { + return elementType; + } + return null; + } + + /** + * <pre> + * + * Test if current service can provide an edit command in response to the request. + * + * @see org.eclipse.papyrus.infra.services.edit.service.IElementEditService#canEdit(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest) + * + * @param req the edit request to test + * @return true is this service can provide edit command for the request + * + * </pre> + */ + @Override + public boolean canEdit(IEditCommandRequest req) { + // Make sure the share client context in passed in the request + req.setClientContext(sharedClientContext); + + return elementType.canEdit(req); + } +} diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/internal/matcher/NoContextEnablementMatcher.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/internal/matcher/NoContextEnablementMatcher.java index e098b65b050..786ee7e10f7 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/internal/matcher/NoContextEnablementMatcher.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/internal/matcher/NoContextEnablementMatcher.java @@ -1,38 +1,38 @@ -/*****************************************************************************
- * Copyright (c) 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit.internal.matcher;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
-
-/**
- * This matcher is used to always disable the context where the semantic
- * creation service are defined.
- * This means the the creation service requires to be called which explicit
- * context specification.
- *
- * This is a temporary matcher implementation used in order to avoid undesired
- * side effects from the centralized edit service and any possible use of
- * GMF extensible type framework made by diagram (either Papyrus or not) GMF tooling
- * generated diagrams.
- */
-public class NoContextEnablementMatcher implements IElementMatcher {
-
- @Override
- public boolean matches(EObject eObject) {
- return false;
- }
-
-}
+/***************************************************************************** + * Copyright (c) 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit.internal.matcher; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher; + +/** + * This matcher is used to always disable the context where the semantic + * creation service are defined. + * This means the the creation service requires to be called which explicit + * context specification. + * + * This is a temporary matcher implementation used in order to avoid undesired + * side effects from the centralized edit service and any possible use of + * GMF extensible type framework made by diagram (either Papyrus or not) GMF tooling + * generated diagrams. + */ +public class NoContextEnablementMatcher implements IElementMatcher { + + @Override + public boolean matches(EObject eObject) { + return false; + } + +} diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/messages/Messages.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/messages/Messages.java index 3cdbf69dcaa..b0060ce58c9 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/messages/Messages.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/messages/Messages.java @@ -1,42 +1,42 @@ -/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Internationalization messages class.
- */
-public class Messages extends NLS {
-
- public static String ElementTypeValidator_NoSelection;
- public static String ElementTypeValidator_ValidSelection;
- public static String ElementTypeValidator_InvalidSelection;
-
- public static String TypeContext_ContextNotFound;
-
- public static String ElementEditServiceProvider_UnexpectedParameterType;
- public static String ElementEditServiceProvider_NoIElementTypeFound;
-
- public static String ElementEditServiceUtils_UnableToFindElementType;
- public static String ElementEditServiceUtils_UnableToFindServiceProvider;
- public static String ElementEditServiceUtils_CantGetEditingDomainProvider;
-
- static {
- NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
- }
-
- private Messages() {
- }
-}
+/***************************************************************************** + * Copyright (c) 2011 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: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit.messages; + +import org.eclipse.osgi.util.NLS; + +/** + * Internationalization messages class. + */ +public class Messages extends NLS { + + public static String ElementTypeValidator_NoSelection; + public static String ElementTypeValidator_ValidSelection; + public static String ElementTypeValidator_InvalidSelection; + + public static String TypeContext_ContextNotFound; + + public static String ElementEditServiceProvider_UnexpectedParameterType; + public static String ElementEditServiceProvider_NoIElementTypeFound; + + public static String ElementEditServiceUtils_UnableToFindElementType; + public static String ElementEditServiceUtils_UnableToFindServiceProvider; + public static String ElementEditServiceUtils_CantGetEditingDomainProvider; + + static { + NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$ + } + + private Messages() { + } +} diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/service/IElementEditService.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/service/IElementEditService.java index 098422ad93a..103cdca5d31 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/service/IElementEditService.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/service/IElementEditService.java @@ -1,78 +1,78 @@ -/*****************************************************************************
- * Copyright (c) 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit.service;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-/**
- * <pre>
- *
- * This interface provide the public API for edit service in Papyrus.
- *
- * Currently the implementation mostly rely on GMF extensible type framework,
- * which was used as the basis to identify methods in this interface (also, it is
- * currently the only proposed implementation of the edit service for Papyrus.
- *
- * @see org.eclipse.gmf.runtime.emf.type.core.IElementType
- *
- * </pre>
- */
-public interface IElementEditService extends IAdaptable {
-
- /**
- * <pre>
- *
- * Test if the service can fulfill the request in parameter.
- *
- * @see {@link IElementType#canEdit(IEditCommandRequest)}
- *
- * @param req the edit request
- * @return true if the service can fulfill the request in parameter
- *
- * </pre>
- */
- public boolean canEdit(IEditCommandRequest req);
-
- /**
- * <pre>
- *
- * Get the edit command that fulfills the edit request
- *
- * @see {@link IElementType#getEditCommand(IEditCommandRequest)}
- *
- * @param request the edit request
- * @return the edit command
- *
- * </pre>
- */
- public ICommand getEditCommand(IEditCommandRequest request);
-
- /**
- * <pre>
- *
- * Get the display name associated to the element related to the edit service.
- *
- * @see {@link IElementType#getDisplayName()}
- *
- * @return the display name
- *
- * </pre>
- */
- public String getDisplayName();
-
-}
+/***************************************************************************** + * Copyright (c) 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit.service; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +/** + * <pre> + * + * This interface provide the public API for edit service in Papyrus. + * + * Currently the implementation mostly rely on GMF extensible type framework, + * which was used as the basis to identify methods in this interface (also, it is + * currently the only proposed implementation of the edit service for Papyrus. + * + * @see org.eclipse.gmf.runtime.emf.type.core.IElementType + * + * </pre> + */ +public interface IElementEditService extends IAdaptable { + + /** + * <pre> + * + * Test if the service can fulfill the request in parameter. + * + * @see {@link IElementType#canEdit(IEditCommandRequest)} + * + * @param req the edit request + * @return true if the service can fulfill the request in parameter + * + * </pre> + */ + public boolean canEdit(IEditCommandRequest req); + + /** + * <pre> + * + * Get the edit command that fulfills the edit request + * + * @see {@link IElementType#getEditCommand(IEditCommandRequest)} + * + * @param request the edit request + * @return the edit command + * + * </pre> + */ + public ICommand getEditCommand(IEditCommandRequest request); + + /** + * <pre> + * + * Get the display name associated to the element related to the edit service. + * + * @see {@link IElementType#getDisplayName()} + * + * @return the display name + * + * </pre> + */ + public String getDisplayName(); + +} diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/service/IElementEditServiceProvider.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/service/IElementEditServiceProvider.java index 33f53cb7d2a..6c4c1cb4419 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/service/IElementEditServiceProvider.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/service/IElementEditServiceProvider.java @@ -1,72 +1,72 @@ -/*****************************************************************************
- * Copyright (c) 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit.service;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.services.edit.internal.ElementEditServiceProvider;
-
-/**
- * <pre>
- *
- * This interface shows a public API for accessing edit service related to model elements.
- *
- * Class implementing this interface:
- * @see ElementEditServiceProvider
- *
- * </pre>
- */
-public interface IElementEditServiceProvider {
-
- /**
- * <pre>
- *
- * Get the registered edit service for the object in parameter
- *
- * @param objectToEdit the object to edit (an EObject, EClass or {@link IElementType})
- * @return the edit service
- * @throws ServiceException
- * </pre>
- */
- public IElementEditService getEditService(Object objectToEdit) throws ServiceException;
-
- /**
- * <pre>
- *
- * Get the edit services for any element registered that are possibly contained by the owner under
- * the desired containment reference.
- *
- * @param owner the owner or the element to edit
- * @param containmentReference the containment reference
- * @return a list of edit services
- * @throws ServiceException
- * </pre>
- */
- public List<IElementEditService> getContainedTypeEditServices(EObject owner, EReference containmentReference) throws ServiceException;
-
- /**
- * <pre>
- * Tests if the id
- * @param id the element type id to look for in the shared client context
- * @return true if the element type is bound to the shared client context
- * </pre>
- */
- public boolean isKnownElementType(String id);
-
-}
+/***************************************************************************** + * Copyright (c) 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * + * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit.service; + +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.services.edit.internal.ElementEditServiceProvider; + +/** + * <pre> + * + * This interface shows a public API for accessing edit service related to model elements. + * + * Class implementing this interface: + * @see ElementEditServiceProvider + * + * </pre> + */ +public interface IElementEditServiceProvider { + + /** + * <pre> + * + * Get the registered edit service for the object in parameter + * + * @param objectToEdit the object to edit (an EObject, EClass or {@link IElementType}) + * @return the edit service + * @throws ServiceException + * </pre> + */ + public IElementEditService getEditService(Object objectToEdit) throws ServiceException; + + /** + * <pre> + * + * Get the edit services for any element registered that are possibly contained by the owner under + * the desired containment reference. + * + * @param owner the owner or the element to edit + * @param containmentReference the containment reference + * @return a list of edit services + * @throws ServiceException + * </pre> + */ + public List<IElementEditService> getContainedTypeEditServices(EObject owner, EReference containmentReference) throws ServiceException; + + /** + * <pre> + * Tests if the id + * @param id the element type id to look for in the shared client context + * @return true if the element type is bound to the shared client context + * </pre> + */ + public boolean isKnownElementType(String id); + +} diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/GMFCommandUtils.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/GMFCommandUtils.java index e2594af27ae..349053cf4c3 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/GMFCommandUtils.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/GMFCommandUtils.java @@ -1,51 +1,51 @@ -/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.services.edit.utils;
-
-import java.util.ArrayList;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-
-/**
- * Utility methods for GMF commands.
- */
-public class GMFCommandUtils {
-
- /**
- * <pre>
- * This method return the EObject returned by a command (the first item if the result is a
- * Collection), or null if the result contains no value or if the value is not an EObject
- * @param command the command.
- * @return the EObject result or null.
- * </pre>
- */
- public static EObject getCommandEObjectResult(ICommand command) {
-
- Object returnValue = command.getCommandResult().getReturnValue();
-
- if (returnValue instanceof EObject) {
- return (EObject) returnValue;
- }
-
- if (returnValue instanceof ArrayList<?>) {
- ArrayList<?> returnValues = (ArrayList<?>) returnValue;
- if (!returnValues.isEmpty() && (returnValues.get(0) instanceof EObject)) {
- return (EObject) returnValues.get(0);
- }
- }
- return null;
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2011 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: + * + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.edit.utils; + +import java.util.ArrayList; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.common.core.command.ICommand; + +/** + * Utility methods for GMF commands. + */ +public class GMFCommandUtils { + + /** + * <pre> + * This method return the EObject returned by a command (the first item if the result is a + * Collection), or null if the result contains no value or if the value is not an EObject + * @param command the command. + * @return the EObject result or null. + * </pre> + */ + public static EObject getCommandEObjectResult(ICommand command) { + + Object returnValue = command.getCommandResult().getReturnValue(); + + if (returnValue instanceof EObject) { + return (EObject) returnValue; + } + + if (returnValue instanceof ArrayList<?>) { + ArrayList<?> returnValues = (ArrayList<?>) returnValue; + if (!returnValues.isEmpty() && (returnValues.get(0) instanceof EObject)) { + return (EObject) returnValues.get(0); + } + } + return null; + } + +} |