Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 11:43:07 +0000
committerCamille Letavernier2014-08-21 13:50:25 +0000
commitdbc038b44bcbb890ae256d15eb09eb285512f020 (patch)
tree757e736583eea3ae352ad9ac91a81df7e59b79ff /plugins/uml/org.eclipse.papyrus.uml.service.types
parentea48a20561464c3cbb7895d430583669a9f82fcc (diff)
downloadorg.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.gz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.xz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.zip
[Code style] Apply clean-up and formatter on Main plug-ins
Diffstat (limited to 'plugins/uml/org.eclipse.papyrus.uml.service.types')
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/element/UMLElementTypes.java494
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/filter/ICommandFilter.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/filter/UmlElementCommandFilter.java6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/Activator.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/AssociationReorientCommand.java77
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ComponentRealizationReorientCommand.java22
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientCommand.java283
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientSemanticCommand.java148
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ControlFlowReorientCommand.java37
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/CreateEditBasedElementCommand.java172
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/DependencyReorientCommand.java37
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ExceptionHandlerReorientCommand.java37
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ExtendReorientCommand.java37
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/GeneralizationReorientCommand.java53
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/IncludeReorientCommand.java37
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InformationFlowReorientCommand.java37
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InterfaceRealizationReorientCommand.java18
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageAbstractReorientCommand.java61
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageAsyncReorientCommand.java8
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageCreateReorientCommand.java12
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageDeleteReorientCommand.java22
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageFoundReorientCommand.java10
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageLostReorientCommand.java10
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageReplyReorientCommand.java6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageSyncReorientCommand.java6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/NotContainmentMoveCommand.java41
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ObjectFlowReorientCommand.java43
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ProtocolConformanceReorientCommand.java37
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/SubstitutionReorientCommand.java22
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/UnapplyAllStereotypesCommand.java2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractCommandHandler.java26
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractCreateCommandHandler.java53
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractUmlCreateCommandHandler.java8
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityGroupHelper.java47
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityHelper.java144
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityNodeHelper.java70
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityPartitionEditHelper.java40
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/AssociationBaseEditHelper.java34
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/BehavioredClassifierEditHelper.java8
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ClassEditHelper.java10
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/CollaborationEditHelper.java8
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ComponentEditHelper.java39
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ComponentRealizationEditHelper.java12
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConnectorEditHelper.java111
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConstraintEditHelper.java43
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ControlFlowEditHelper.java59
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DefaultEditHelper.java136
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DependencyEditHelper.java26
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DirectedRelationshipEditHelper.java47
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ElementEditHelper.java14
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExceptionHandlerEditHelper.java58
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExpansionNodeHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExpansionRegionHelper.java22
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExtendEditHelper.java14
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/GeneralizationEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/IncludeEditHelper.java12
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InformationFlowEditHelper.java10
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InterfaceRealizationEditHelper.java24
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InterruptibleActivityRegionHelper.java48
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/LiteralIntegerEditHelper.java20
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/MessageEditHelper.java93
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ObjectFlowEditHelper.java51
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ObjectNodeHelper.java47
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/PinEditHelper.java35
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/PortEditHelper.java21
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ProtocolConformanceEditHelper.java12
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ProtocolStateMachineEditHelper.java12
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/SubstitutionEditHelper.java12
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/UseCaseEditHelper.java12
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractStereotypedElementEditHelperAdvice.java26
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ActivityGroupEditHelperAdvice.java130
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ActivityNodeHelperAdvice.java135
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AssociationEditHelperAdvice.java123
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ClassifierHelperAdvice.java72
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/CollaborationHelperAdvice.java54
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/CollaborationUseHelperAdvice.java38
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ConnectorEndHelperAdvice.java12
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ConnectorHelperAdvice.java28
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ContainmentSubsetRemovalAdvice.java16
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DestructionEventHelperAdvice.java47
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DirectedRelationshipHelperAdvice.java18
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/EncapsulatedClassifierHelperAdvice.java22
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ExecutionSpecificationHelperAdvice.java44
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/LifelineHelperAdvice.java18
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageEndHelperAdvice.java6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageHelperAdvice.java24
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/NamedElementHelperAdvice.java22
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/NamedElementInitializerHelperAdvice.java13
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/OccurrenceSpecificationHelperAdvice.java16
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ParameterHelperAdvice.java15
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/PartDecompositionHelperAdvice.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/PropertyHelperAdvice.java105
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/RefineEditHelperAdvice.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StructuredClassifierHelperAdvice.java8
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TraceEditHelperAdvice.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/AssociationMatcher.java8
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/RefineMatcher.java6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/TraceMatcher.java6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/menu/AbstractCreateUmlChildMenu.java6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/messages/Messages.java2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ClassifierUtils.java16
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/CommandContext.java2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ConnectorUtils.java72
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/EMFUtil.java22
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ElementUtil.java44
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ICommandContext.java6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/InteractionConstraintUtil.java40
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/NamedElementHelper.java28
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterConstants.java5
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterUtils.java55
110 files changed, 2321 insertions, 2262 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/element/UMLElementTypes.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/element/UMLElementTypes.java
index e407218bfd3..5b7bfc89b1e 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/element/UMLElementTypes.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/element/UMLElementTypes.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -24,738 +24,738 @@ public class UMLElementTypes extends AbstractElementTypeEnumerator {
public static final String UML_NATURE = "UML_Nature";
/** IElementType for UML Abstraction */
- public static final IHintedType ABSTRACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Abstraction"); //$NON-NLS-1$
+ public static final IHintedType ABSTRACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Abstraction"); //$NON-NLS-1$
/** IElementType for UML AcceptCallAction */
- public static final IHintedType ACCEPT_CALL_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.AcceptCallAction"); //$NON-NLS-1$
+ public static final IHintedType ACCEPT_CALL_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.AcceptCallAction"); //$NON-NLS-1$
/** IElementType for UML AcceptEventAction */
- public static final IHintedType ACCEPT_EVENT_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.AcceptEventAction"); //$NON-NLS-1$
+ public static final IHintedType ACCEPT_EVENT_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.AcceptEventAction"); //$NON-NLS-1$
/** IElementType for UML Action */
- public static final IHintedType ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Action"); //$NON-NLS-1$
+ public static final IHintedType ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Action"); //$NON-NLS-1$
/** IElementType for UML ActionExecutionSpecification */
- public static final IHintedType ACTION_EXECUTION_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ActionExecutionSpecification"); //$NON-NLS-1$
+ public static final IHintedType ACTION_EXECUTION_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ActionExecutionSpecification"); //$NON-NLS-1$
/** IElementType for UML ActionInputPin */
- public static final IHintedType ACTION_INPUT_PIN = (IHintedType)getElementType("org.eclipse.papyrus.uml.ActionInputPin"); //$NON-NLS-1$
+ public static final IHintedType ACTION_INPUT_PIN = (IHintedType) getElementType("org.eclipse.papyrus.uml.ActionInputPin"); //$NON-NLS-1$
/** IElementType for UML Activity */
- public static final IHintedType ACTIVITY = (IHintedType)getElementType("org.eclipse.papyrus.uml.Activity"); //$NON-NLS-1$
+ public static final IHintedType ACTIVITY = (IHintedType) getElementType("org.eclipse.papyrus.uml.Activity"); //$NON-NLS-1$
/** IElementType for UML ActivityEdge */
- public static final IHintedType ACTIVITY_EDGE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ActivityEdge"); //$NON-NLS-1$
+ public static final IHintedType ACTIVITY_EDGE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ActivityEdge"); //$NON-NLS-1$
/** IElementType for UML ActivityFinalNode */
- public static final IHintedType ACTIVITY_FINAL_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ActivityFinalNode"); //$NON-NLS-1$
+ public static final IHintedType ACTIVITY_FINAL_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ActivityFinalNode"); //$NON-NLS-1$
/** IElementType for UML ActivityGroup */
- public static final IHintedType ACTIVITY_GROUP = (IHintedType)getElementType("org.eclipse.papyrus.uml.ActivityGroup"); //$NON-NLS-1$
+ public static final IHintedType ACTIVITY_GROUP = (IHintedType) getElementType("org.eclipse.papyrus.uml.ActivityGroup"); //$NON-NLS-1$
/** IElementType for UML ActivityNode */
- public static final IHintedType ACTIVITY_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ActivityNode"); //$NON-NLS-1$
+ public static final IHintedType ACTIVITY_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ActivityNode"); //$NON-NLS-1$
/** IElementType for UML ActivityParameterNode */
- public static final IHintedType ACTIVITY_PARAMETER_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ActivityParameterNode"); //$NON-NLS-1$
+ public static final IHintedType ACTIVITY_PARAMETER_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ActivityParameterNode"); //$NON-NLS-1$
/** IElementType for UML ActivityPartition */
- public static final IHintedType ACTIVITY_PARTITION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ActivityPartition"); //$NON-NLS-1$
+ public static final IHintedType ACTIVITY_PARTITION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ActivityPartition"); //$NON-NLS-1$
/** IElementType for UML Actor */
- public static final IHintedType ACTOR = (IHintedType)getElementType("org.eclipse.papyrus.uml.Actor"); //$NON-NLS-1$
+ public static final IHintedType ACTOR = (IHintedType) getElementType("org.eclipse.papyrus.uml.Actor"); //$NON-NLS-1$
/** IElementType for UML AddStructuralFeatureValueAction */
- public static final IHintedType ADD_STRUCTURAL_FEATURE_VALUE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.AddStructuralFeatureValueAction"); //$NON-NLS-1$
+ public static final IHintedType ADD_STRUCTURAL_FEATURE_VALUE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.AddStructuralFeatureValueAction"); //$NON-NLS-1$
/** IElementType for UML AddVariableValueAction */
- public static final IHintedType ADD_VARIABLE_VALUE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.AddVariableValueAction"); //$NON-NLS-1$
+ public static final IHintedType ADD_VARIABLE_VALUE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.AddVariableValueAction"); //$NON-NLS-1$
/** IElementType for UML AnyReceiveEvent */
- public static final IHintedType ANY_RECEIVE_EVENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.AnyReceiveEvent"); //$NON-NLS-1$
+ public static final IHintedType ANY_RECEIVE_EVENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.AnyReceiveEvent"); //$NON-NLS-1$
/** IElementType for UML Artifact */
- public static final IHintedType ARTIFACT = (IHintedType)getElementType("org.eclipse.papyrus.uml.Artifact"); //$NON-NLS-1$
+ public static final IHintedType ARTIFACT = (IHintedType) getElementType("org.eclipse.papyrus.uml.Artifact"); //$NON-NLS-1$
/** IElementType for UML AssociationBase */
- public static final IHintedType ASSOCIATION_BASE = (IHintedType)getElementType("org.eclipse.papyrus.uml.AssociationBase"); //$NON-NLS-1$
+ public static final IHintedType ASSOCIATION_BASE = (IHintedType) getElementType("org.eclipse.papyrus.uml.AssociationBase"); //$NON-NLS-1$
/** IElementType for UML AssociationClass */
- public static final IHintedType ASSOCIATION_CLASS = (IHintedType)getElementType("org.eclipse.papyrus.uml.AssociationClass"); //$NON-NLS-1$
+ public static final IHintedType ASSOCIATION_CLASS = (IHintedType) getElementType("org.eclipse.papyrus.uml.AssociationClass"); //$NON-NLS-1$
/** IElementType for UML Behavior */
- public static final IHintedType BEHAVIOR = (IHintedType)getElementType("org.eclipse.papyrus.uml.Behavior"); //$NON-NLS-1$
+ public static final IHintedType BEHAVIOR = (IHintedType) getElementType("org.eclipse.papyrus.uml.Behavior"); //$NON-NLS-1$
/** IElementType for UML BehaviorExecutionSpecification */
- public static final IHintedType BEHAVIOR_EXECUTION_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.BehaviorExecutionSpecification"); //$NON-NLS-1$
+ public static final IHintedType BEHAVIOR_EXECUTION_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.BehaviorExecutionSpecification"); //$NON-NLS-1$
/** IElementType for UML BehavioralFeature */
- public static final IHintedType BEHAVIORAL_FEATURE = (IHintedType)getElementType("org.eclipse.papyrus.uml.BehavioralFeature"); //$NON-NLS-1$
+ public static final IHintedType BEHAVIORAL_FEATURE = (IHintedType) getElementType("org.eclipse.papyrus.uml.BehavioralFeature"); //$NON-NLS-1$
/** IElementType for UML BehavioredClassifier */
- public static final IHintedType BEHAVIORED_CLASSIFIER = (IHintedType)getElementType("org.eclipse.papyrus.uml.BehavioredClassifier"); //$NON-NLS-1$
+ public static final IHintedType BEHAVIORED_CLASSIFIER = (IHintedType) getElementType("org.eclipse.papyrus.uml.BehavioredClassifier"); //$NON-NLS-1$
/** IElementType for UML BroadcastSignalAction */
- public static final IHintedType BROADCAST_SIGNAL_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.BroadcastSignalAction"); //$NON-NLS-1$
+ public static final IHintedType BROADCAST_SIGNAL_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.BroadcastSignalAction"); //$NON-NLS-1$
/** IElementType for UML CallAction */
- public static final IHintedType CALL_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.CallAction"); //$NON-NLS-1$
+ public static final IHintedType CALL_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.CallAction"); //$NON-NLS-1$
/** IElementType for UML CallBehaviorAction */
- public static final IHintedType CALL_BEHAVIOR_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.CallBehaviorAction"); //$NON-NLS-1$
+ public static final IHintedType CALL_BEHAVIOR_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.CallBehaviorAction"); //$NON-NLS-1$
/** IElementType for UML CallEvent */
- public static final IHintedType CALL_EVENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.CallEvent"); //$NON-NLS-1$
+ public static final IHintedType CALL_EVENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.CallEvent"); //$NON-NLS-1$
/** IElementType for UML CallOperationAction */
- public static final IHintedType CALL_OPERATION_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.CallOperationAction"); //$NON-NLS-1$
+ public static final IHintedType CALL_OPERATION_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.CallOperationAction"); //$NON-NLS-1$
/** IElementType for UML CentralBufferNode */
- public static final IHintedType CENTRAL_BUFFER_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.CentralBufferNode"); //$NON-NLS-1$
+ public static final IHintedType CENTRAL_BUFFER_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.CentralBufferNode"); //$NON-NLS-1$
/** IElementType for UML ChangeEvent */
- public static final IHintedType CHANGE_EVENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.ChangeEvent"); //$NON-NLS-1$
+ public static final IHintedType CHANGE_EVENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.ChangeEvent"); //$NON-NLS-1$
/** IElementType for UML Class */
- public static final IHintedType CLASS = (IHintedType)getElementType("org.eclipse.papyrus.uml.Class"); //$NON-NLS-1$
+ public static final IHintedType CLASS = (IHintedType) getElementType("org.eclipse.papyrus.uml.Class"); //$NON-NLS-1$
/** IElementType for UML Classifier */
- public static final IHintedType CLASSIFIER = (IHintedType)getElementType("org.eclipse.papyrus.uml.Classifier"); //$NON-NLS-1$
+ public static final IHintedType CLASSIFIER = (IHintedType) getElementType("org.eclipse.papyrus.uml.Classifier"); //$NON-NLS-1$
/** IElementType for UML ClassifierTemplateParameter */
- public static final IHintedType CLASSIFIER_TEMPLATE_PARAMETER = (IHintedType)getElementType("org.eclipse.papyrus.uml.ClassifierTemplateParameter"); //$NON-NLS-1$
+ public static final IHintedType CLASSIFIER_TEMPLATE_PARAMETER = (IHintedType) getElementType("org.eclipse.papyrus.uml.ClassifierTemplateParameter"); //$NON-NLS-1$
/** IElementType for UML Clause */
- public static final IHintedType CLAUSE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Clause"); //$NON-NLS-1$
+ public static final IHintedType CLAUSE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Clause"); //$NON-NLS-1$
/** IElementType for UML ClearAssociationAction */
- public static final IHintedType CLEAR_ASSOCIATION_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ClearAssociationAction"); //$NON-NLS-1$
+ public static final IHintedType CLEAR_ASSOCIATION_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ClearAssociationAction"); //$NON-NLS-1$
/** IElementType for UML ClearStructuralFeatureAction */
- public static final IHintedType CLEAR_STRUCTURAL_FEATURE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ClearStructuralFeatureAction"); //$NON-NLS-1$
+ public static final IHintedType CLEAR_STRUCTURAL_FEATURE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ClearStructuralFeatureAction"); //$NON-NLS-1$
/** IElementType for UML ClearVariableAction */
- public static final IHintedType CLEAR_VARIABLE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ClearVariableAction"); //$NON-NLS-1$
+ public static final IHintedType CLEAR_VARIABLE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ClearVariableAction"); //$NON-NLS-1$
/** IElementType for UML Collaboration */
- public static final IHintedType COLLABORATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Collaboration"); //$NON-NLS-1$
+ public static final IHintedType COLLABORATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Collaboration"); //$NON-NLS-1$
/** IElementType for UML CollaborationUse */
- public static final IHintedType COLLABORATION_USE = (IHintedType)getElementType("org.eclipse.papyrus.uml.CollaborationUse"); //$NON-NLS-1$
+ public static final IHintedType COLLABORATION_USE = (IHintedType) getElementType("org.eclipse.papyrus.uml.CollaborationUse"); //$NON-NLS-1$
/** IElementType for UML CombinedFragment */
- public static final IHintedType COMBINED_FRAGMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.CombinedFragment"); //$NON-NLS-1$
+ public static final IHintedType COMBINED_FRAGMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.CombinedFragment"); //$NON-NLS-1$
/** IElementType for UML Comment */
- public static final IHintedType COMMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.Comment"); //$NON-NLS-1$
+ public static final IHintedType COMMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.Comment"); //$NON-NLS-1$
/** IElementType for UML CommunicationPath */
- public static final IHintedType COMMUNICATION_PATH = (IHintedType)getElementType("org.eclipse.papyrus.uml.CommunicationPath"); //$NON-NLS-1$
+ public static final IHintedType COMMUNICATION_PATH = (IHintedType) getElementType("org.eclipse.papyrus.uml.CommunicationPath"); //$NON-NLS-1$
/** IElementType for UML Component */
- public static final IHintedType COMPONENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.Component"); //$NON-NLS-1$
+ public static final IHintedType COMPONENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.Component"); //$NON-NLS-1$
/** IElementType for UML ComponentRealization */
- public static final IHintedType COMPONENT_REALIZATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ComponentRealization"); //$NON-NLS-1$
+ public static final IHintedType COMPONENT_REALIZATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ComponentRealization"); //$NON-NLS-1$
/** IElementType for UML ConditionalNode */
- public static final IHintedType CONDITIONAL_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ConditionalNode"); //$NON-NLS-1$
+ public static final IHintedType CONDITIONAL_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ConditionalNode"); //$NON-NLS-1$
/** IElementType for UML ConnectableElement */
- public static final IHintedType CONNECTABLE_ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.ConnectableElement"); //$NON-NLS-1$
+ public static final IHintedType CONNECTABLE_ELEMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.ConnectableElement"); //$NON-NLS-1$
/** IElementType for UML ConnectableElementTemplateParameter */
- public static final IHintedType CONNECTABLE_ELEMENT_TEMPLATE_PARAMETER = (IHintedType)getElementType("org.eclipse.papyrus.uml.ConnectableElementTemplateParameter"); //$NON-NLS-1$
+ public static final IHintedType CONNECTABLE_ELEMENT_TEMPLATE_PARAMETER = (IHintedType) getElementType("org.eclipse.papyrus.uml.ConnectableElementTemplateParameter"); //$NON-NLS-1$
/** IElementType for UML ConnectionPointReference */
- public static final IHintedType CONNECTION_POINT_REFERENCE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ConnectionPointReference"); //$NON-NLS-1$
+ public static final IHintedType CONNECTION_POINT_REFERENCE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ConnectionPointReference"); //$NON-NLS-1$
/** IElementType for UML Connector */
- public static final IHintedType CONNECTOR = (IHintedType)getElementType("org.eclipse.papyrus.uml.Connector"); //$NON-NLS-1$
+ public static final IHintedType CONNECTOR = (IHintedType) getElementType("org.eclipse.papyrus.uml.Connector"); //$NON-NLS-1$
/** IElementType for UML ConnectorEnd */
- public static final IHintedType CONNECTOR_END = (IHintedType)getElementType("org.eclipse.papyrus.uml.ConnectorEnd"); //$NON-NLS-1$
+ public static final IHintedType CONNECTOR_END = (IHintedType) getElementType("org.eclipse.papyrus.uml.ConnectorEnd"); //$NON-NLS-1$
/** IElementType for UML ConsiderIgnoreFragment */
- public static final IHintedType CONSIDER_IGNORE_FRAGMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.ConsiderIgnoreFragment"); //$NON-NLS-1$
+ public static final IHintedType CONSIDER_IGNORE_FRAGMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.ConsiderIgnoreFragment"); //$NON-NLS-1$
/** IElementType for UML Constraint */
- public static final IHintedType CONSTRAINT = (IHintedType)getElementType("org.eclipse.papyrus.uml.Constraint"); //$NON-NLS-1$
+ public static final IHintedType CONSTRAINT = (IHintedType) getElementType("org.eclipse.papyrus.uml.Constraint"); //$NON-NLS-1$
/** IElementType for UML Continuation */
- public static final IHintedType CONTINUATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Continuation"); //$NON-NLS-1$
+ public static final IHintedType CONTINUATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Continuation"); //$NON-NLS-1$
/** IElementType for UML ControlFlow */
- public static final IHintedType CONTROL_FLOW = (IHintedType)getElementType("org.eclipse.papyrus.uml.ControlFlow"); //$NON-NLS-1$
+ public static final IHintedType CONTROL_FLOW = (IHintedType) getElementType("org.eclipse.papyrus.uml.ControlFlow"); //$NON-NLS-1$
/** IElementType for UML ControlNode */
- public static final IHintedType CONTROL_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ControlNode"); //$NON-NLS-1$
+ public static final IHintedType CONTROL_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ControlNode"); //$NON-NLS-1$
/** IElementType for UML CreateLinkAction */
- public static final IHintedType CREATE_LINK_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.CreateLinkAction"); //$NON-NLS-1$
+ public static final IHintedType CREATE_LINK_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.CreateLinkAction"); //$NON-NLS-1$
/** IElementType for UML CreateLinkObjectAction */
- public static final IHintedType CREATE_LINK_OBJECT_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.CreateLinkObjectAction"); //$NON-NLS-1$
+ public static final IHintedType CREATE_LINK_OBJECT_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.CreateLinkObjectAction"); //$NON-NLS-1$
/** IElementType for UML CreateObjectAction */
- public static final IHintedType CREATE_OBJECT_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.CreateObjectAction"); //$NON-NLS-1$
+ public static final IHintedType CREATE_OBJECT_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.CreateObjectAction"); //$NON-NLS-1$
/** IElementType for UML DataStoreNode */
- public static final IHintedType DATA_STORE_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.DataStoreNode"); //$NON-NLS-1$
+ public static final IHintedType DATA_STORE_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.DataStoreNode"); //$NON-NLS-1$
/** IElementType for UML DataType */
- public static final IHintedType DATA_TYPE = (IHintedType)getElementType("org.eclipse.papyrus.uml.DataType"); //$NON-NLS-1$
+ public static final IHintedType DATA_TYPE = (IHintedType) getElementType("org.eclipse.papyrus.uml.DataType"); //$NON-NLS-1$
/** IElementType for UML DecisionNode */
- public static final IHintedType DECISION_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.DecisionNode"); //$NON-NLS-1$
+ public static final IHintedType DECISION_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.DecisionNode"); //$NON-NLS-1$
/** IElementType for UML Dependency */
- public static final IHintedType DEPENDENCY = (IHintedType)getElementType("org.eclipse.papyrus.uml.Dependency"); //$NON-NLS-1$
+ public static final IHintedType DEPENDENCY = (IHintedType) getElementType("org.eclipse.papyrus.uml.Dependency"); //$NON-NLS-1$
/** IElementType for UML DeployedArtifact */
- public static final IHintedType DEPLOYED_ARTIFACT = (IHintedType)getElementType("org.eclipse.papyrus.uml.DeployedArtifact"); //$NON-NLS-1$
+ public static final IHintedType DEPLOYED_ARTIFACT = (IHintedType) getElementType("org.eclipse.papyrus.uml.DeployedArtifact"); //$NON-NLS-1$
/** IElementType for UML Deployment */
- public static final IHintedType DEPLOYMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.Deployment"); //$NON-NLS-1$
+ public static final IHintedType DEPLOYMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.Deployment"); //$NON-NLS-1$
/** IElementType for UML DeploymentSpecification */
- public static final IHintedType DEPLOYMENT_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.DeploymentSpecification"); //$NON-NLS-1$
+ public static final IHintedType DEPLOYMENT_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.DeploymentSpecification"); //$NON-NLS-1$
/** IElementType for UML DeploymentTarget */
- public static final IHintedType DEPLOYMENT_TARGET = (IHintedType)getElementType("org.eclipse.papyrus.uml.DeploymentTarget"); //$NON-NLS-1$
+ public static final IHintedType DEPLOYMENT_TARGET = (IHintedType) getElementType("org.eclipse.papyrus.uml.DeploymentTarget"); //$NON-NLS-1$
/** IElementType for UML DestroyLinkAction */
- public static final IHintedType DESTROY_LINK_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.DestroyLinkAction"); //$NON-NLS-1$
+ public static final IHintedType DESTROY_LINK_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.DestroyLinkAction"); //$NON-NLS-1$
/** IElementType for UML DestroyObjectAction */
- public static final IHintedType DESTROY_OBJECT_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.DestroyObjectAction"); //$NON-NLS-1$
+ public static final IHintedType DESTROY_OBJECT_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.DestroyObjectAction"); //$NON-NLS-1$
/** IElementType for UML DestructionOccurrenceSpecification */
- public static final IHintedType DESTRUCTION_OCCURRENCE_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.DestructionOccurrenceSpecification"); //$NON-NLS-1$
+ public static final IHintedType DESTRUCTION_OCCURRENCE_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.DestructionOccurrenceSpecification"); //$NON-NLS-1$
/** IElementType for UML Device */
- public static final IHintedType DEVICE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Device"); //$NON-NLS-1$
+ public static final IHintedType DEVICE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Device"); //$NON-NLS-1$
/** IElementType for UML DirectedRelationship */
- public static final IHintedType DIRECTED_RELATIONSHIP = (IHintedType)getElementType("org.eclipse.papyrus.uml.DirectedRelationship"); //$NON-NLS-1$
+ public static final IHintedType DIRECTED_RELATIONSHIP = (IHintedType) getElementType("org.eclipse.papyrus.uml.DirectedRelationship"); //$NON-NLS-1$
/** IElementType for UML Duration */
- public static final IHintedType DURATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Duration"); //$NON-NLS-1$
+ public static final IHintedType DURATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Duration"); //$NON-NLS-1$
/** IElementType for UML DurationConstraint */
- public static final IHintedType DURATION_CONSTRAINT = (IHintedType)getElementType("org.eclipse.papyrus.uml.DurationConstraint"); //$NON-NLS-1$
+ public static final IHintedType DURATION_CONSTRAINT = (IHintedType) getElementType("org.eclipse.papyrus.uml.DurationConstraint"); //$NON-NLS-1$
/** IElementType for UML DurationInterval */
- public static final IHintedType DURATION_INTERVAL = (IHintedType)getElementType("org.eclipse.papyrus.uml.DurationInterval"); //$NON-NLS-1$
+ public static final IHintedType DURATION_INTERVAL = (IHintedType) getElementType("org.eclipse.papyrus.uml.DurationInterval"); //$NON-NLS-1$
/** IElementType for UML DurationObservation */
- public static final IHintedType DURATION_OBSERVATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.DurationObservation"); //$NON-NLS-1$
+ public static final IHintedType DURATION_OBSERVATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.DurationObservation"); //$NON-NLS-1$
/** IElementType for UML Element */
- public static final IHintedType ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.Element"); //$NON-NLS-1$
+ public static final IHintedType ELEMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.Element"); //$NON-NLS-1$
/** IElementType for UML ElementImport */
- public static final IHintedType ELEMENT_IMPORT = (IHintedType)getElementType("org.eclipse.papyrus.uml.ElementImport"); //$NON-NLS-1$
+ public static final IHintedType ELEMENT_IMPORT = (IHintedType) getElementType("org.eclipse.papyrus.uml.ElementImport"); //$NON-NLS-1$
/** IElementType for UML EncapsulatedClassifier */
- public static final IHintedType ENCAPSULATED_CLASSIFIER = (IHintedType)getElementType("org.eclipse.papyrus.uml.EncapsulatedClassifier"); //$NON-NLS-1$
+ public static final IHintedType ENCAPSULATED_CLASSIFIER = (IHintedType) getElementType("org.eclipse.papyrus.uml.EncapsulatedClassifier"); //$NON-NLS-1$
/** IElementType for UML Enumeration */
- public static final IHintedType ENUMERATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Enumeration"); //$NON-NLS-1$
+ public static final IHintedType ENUMERATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Enumeration"); //$NON-NLS-1$
/** IElementType for UML EnumerationLiteral */
- public static final IHintedType ENUMERATION_LITERAL = (IHintedType)getElementType("org.eclipse.papyrus.uml.EnumerationLiteral"); //$NON-NLS-1$
+ public static final IHintedType ENUMERATION_LITERAL = (IHintedType) getElementType("org.eclipse.papyrus.uml.EnumerationLiteral"); //$NON-NLS-1$
/** IElementType for UML Event */
- public static final IHintedType EVENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.Event"); //$NON-NLS-1$
+ public static final IHintedType EVENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.Event"); //$NON-NLS-1$
/** IElementType for UML ExceptionHandler */
- public static final IHintedType EXCEPTION_HANDLER = (IHintedType)getElementType("org.eclipse.papyrus.uml.ExceptionHandler"); //$NON-NLS-1$
+ public static final IHintedType EXCEPTION_HANDLER = (IHintedType) getElementType("org.eclipse.papyrus.uml.ExceptionHandler"); //$NON-NLS-1$
/** IElementType for UML ExecutableNode */
- public static final IHintedType EXECUTABLE_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ExecutableNode"); //$NON-NLS-1$
+ public static final IHintedType EXECUTABLE_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ExecutableNode"); //$NON-NLS-1$
/** IElementType for UML ExecutionEnvironment */
- public static final IHintedType EXECUTION_ENVIRONMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.ExecutionEnvironment"); //$NON-NLS-1$
+ public static final IHintedType EXECUTION_ENVIRONMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.ExecutionEnvironment"); //$NON-NLS-1$
/** IElementType for UML ExecutionOccurrenceSpecification */
- public static final IHintedType EXECUTION_OCCURRENCE_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ExecutionOccurrenceSpecification"); //$NON-NLS-1$
+ public static final IHintedType EXECUTION_OCCURRENCE_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ExecutionOccurrenceSpecification"); //$NON-NLS-1$
/** IElementType for UML ExecutionSpecification */
- public static final IHintedType EXECUTION_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ExecutionSpecification"); //$NON-NLS-1$
+ public static final IHintedType EXECUTION_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ExecutionSpecification"); //$NON-NLS-1$
/** IElementType for UML ExpansionNode */
- public static final IHintedType EXPANSION_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ExpansionNode"); //$NON-NLS-1$
+ public static final IHintedType EXPANSION_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ExpansionNode"); //$NON-NLS-1$
/** IElementType for UML ExpansionRegion */
- public static final IHintedType EXPANSION_REGION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ExpansionRegion"); //$NON-NLS-1$
+ public static final IHintedType EXPANSION_REGION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ExpansionRegion"); //$NON-NLS-1$
/** IElementType for UML Expression */
- public static final IHintedType EXPRESSION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Expression"); //$NON-NLS-1$
+ public static final IHintedType EXPRESSION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Expression"); //$NON-NLS-1$
/** IElementType for UML Extend */
- public static final IHintedType EXTEND = (IHintedType)getElementType("org.eclipse.papyrus.uml.Extend"); //$NON-NLS-1$
+ public static final IHintedType EXTEND = (IHintedType) getElementType("org.eclipse.papyrus.uml.Extend"); //$NON-NLS-1$
/** IElementType for UML Extension */
- public static final IHintedType EXTENSION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Extension"); //$NON-NLS-1$
+ public static final IHintedType EXTENSION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Extension"); //$NON-NLS-1$
/** IElementType for UML ExtensionEnd */
- public static final IHintedType EXTENSION_END = (IHintedType)getElementType("org.eclipse.papyrus.uml.ExtensionEnd"); //$NON-NLS-1$
+ public static final IHintedType EXTENSION_END = (IHintedType) getElementType("org.eclipse.papyrus.uml.ExtensionEnd"); //$NON-NLS-1$
/** IElementType for UML ExtensionPoint */
- public static final IHintedType EXTENSION_POINT = (IHintedType)getElementType("org.eclipse.papyrus.uml.ExtensionPoint"); //$NON-NLS-1$
+ public static final IHintedType EXTENSION_POINT = (IHintedType) getElementType("org.eclipse.papyrus.uml.ExtensionPoint"); //$NON-NLS-1$
/** IElementType for UML Feature */
- public static final IHintedType FEATURE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Feature"); //$NON-NLS-1$
+ public static final IHintedType FEATURE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Feature"); //$NON-NLS-1$
/** IElementType for UML FinalNode */
- public static final IHintedType FINAL_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.FinalNode"); //$NON-NLS-1$
+ public static final IHintedType FINAL_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.FinalNode"); //$NON-NLS-1$
/** IElementType for UML FinalState */
- public static final IHintedType FINAL_STATE = (IHintedType)getElementType("org.eclipse.papyrus.uml.FinalState"); //$NON-NLS-1$
+ public static final IHintedType FINAL_STATE = (IHintedType) getElementType("org.eclipse.papyrus.uml.FinalState"); //$NON-NLS-1$
/** IElementType for UML FlowFinalNode */
- public static final IHintedType FLOW_FINAL_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.FlowFinalNode"); //$NON-NLS-1$
+ public static final IHintedType FLOW_FINAL_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.FlowFinalNode"); //$NON-NLS-1$
/** IElementType for UML ForkNode */
- public static final IHintedType FORK_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ForkNode"); //$NON-NLS-1$
+ public static final IHintedType FORK_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ForkNode"); //$NON-NLS-1$
/** IElementType for UML FunctionBehavior */
- public static final IHintedType FUNCTION_BEHAVIOR = (IHintedType)getElementType("org.eclipse.papyrus.uml.FunctionBehavior"); //$NON-NLS-1$
+ public static final IHintedType FUNCTION_BEHAVIOR = (IHintedType) getElementType("org.eclipse.papyrus.uml.FunctionBehavior"); //$NON-NLS-1$
/** IElementType for UML Gate */
- public static final IHintedType GATE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Gate"); //$NON-NLS-1$
+ public static final IHintedType GATE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Gate"); //$NON-NLS-1$
/** IElementType for UML GeneralOrdering */
- public static final IHintedType GENERAL_ORDERING = (IHintedType)getElementType("org.eclipse.papyrus.uml.GeneralOrdering"); //$NON-NLS-1$
+ public static final IHintedType GENERAL_ORDERING = (IHintedType) getElementType("org.eclipse.papyrus.uml.GeneralOrdering"); //$NON-NLS-1$
/** IElementType for UML Generalization */
- public static final IHintedType GENERALIZATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Generalization"); //$NON-NLS-1$
+ public static final IHintedType GENERALIZATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Generalization"); //$NON-NLS-1$
/** IElementType for UML GeneralizationSet */
- public static final IHintedType GENERALIZATION_SET = (IHintedType)getElementType("org.eclipse.papyrus.uml.GeneralizationSet"); //$NON-NLS-1$
+ public static final IHintedType GENERALIZATION_SET = (IHintedType) getElementType("org.eclipse.papyrus.uml.GeneralizationSet"); //$NON-NLS-1$
/** IElementType for UML Image */
- public static final IHintedType IMAGE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Image"); //$NON-NLS-1$
+ public static final IHintedType IMAGE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Image"); //$NON-NLS-1$
/** IElementType for UML Include */
- public static final IHintedType INCLUDE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Include"); //$NON-NLS-1$
+ public static final IHintedType INCLUDE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Include"); //$NON-NLS-1$
/** IElementType for UML InformationFlow */
- public static final IHintedType INFORMATION_FLOW = (IHintedType)getElementType("org.eclipse.papyrus.uml.InformationFlow"); //$NON-NLS-1$
+ public static final IHintedType INFORMATION_FLOW = (IHintedType) getElementType("org.eclipse.papyrus.uml.InformationFlow"); //$NON-NLS-1$
/** IElementType for UML InformationItem */
- public static final IHintedType INFORMATION_ITEM = (IHintedType)getElementType("org.eclipse.papyrus.uml.InformationItem"); //$NON-NLS-1$
+ public static final IHintedType INFORMATION_ITEM = (IHintedType) getElementType("org.eclipse.papyrus.uml.InformationItem"); //$NON-NLS-1$
/** IElementType for UML InitialNode */
- public static final IHintedType INITIAL_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.InitialNode"); //$NON-NLS-1$
+ public static final IHintedType INITIAL_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.InitialNode"); //$NON-NLS-1$
/** IElementType for UML InputPin */
- public static final IHintedType INPUT_PIN = (IHintedType)getElementType("org.eclipse.papyrus.uml.InputPin"); //$NON-NLS-1$
+ public static final IHintedType INPUT_PIN = (IHintedType) getElementType("org.eclipse.papyrus.uml.InputPin"); //$NON-NLS-1$
/** IElementType for UML InstanceSpecification */
- public static final IHintedType INSTANCE_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.InstanceSpecification"); //$NON-NLS-1$
+ public static final IHintedType INSTANCE_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.InstanceSpecification"); //$NON-NLS-1$
/** IElementType for UML InstanceValue */
- public static final IHintedType INSTANCE_VALUE = (IHintedType)getElementType("org.eclipse.papyrus.uml.InstanceValue"); //$NON-NLS-1$
+ public static final IHintedType INSTANCE_VALUE = (IHintedType) getElementType("org.eclipse.papyrus.uml.InstanceValue"); //$NON-NLS-1$
/** IElementType for UML Interaction */
- public static final IHintedType INTERACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Interaction"); //$NON-NLS-1$
+ public static final IHintedType INTERACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Interaction"); //$NON-NLS-1$
/** IElementType for UML InteractionConstraint */
- public static final IHintedType INTERACTION_CONSTRAINT = (IHintedType)getElementType("org.eclipse.papyrus.uml.InteractionConstraint"); //$NON-NLS-1$
+ public static final IHintedType INTERACTION_CONSTRAINT = (IHintedType) getElementType("org.eclipse.papyrus.uml.InteractionConstraint"); //$NON-NLS-1$
/** IElementType for UML InteractionFragment */
- public static final IHintedType INTERACTION_FRAGMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.InteractionFragment"); //$NON-NLS-1$
+ public static final IHintedType INTERACTION_FRAGMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.InteractionFragment"); //$NON-NLS-1$
/** IElementType for UML InteractionOperand */
- public static final IHintedType INTERACTION_OPERAND = (IHintedType)getElementType("org.eclipse.papyrus.uml.InteractionOperand"); //$NON-NLS-1$
+ public static final IHintedType INTERACTION_OPERAND = (IHintedType) getElementType("org.eclipse.papyrus.uml.InteractionOperand"); //$NON-NLS-1$
/** IElementType for UML InteractionUse */
- public static final IHintedType INTERACTION_USE = (IHintedType)getElementType("org.eclipse.papyrus.uml.InteractionUse"); //$NON-NLS-1$
+ public static final IHintedType INTERACTION_USE = (IHintedType) getElementType("org.eclipse.papyrus.uml.InteractionUse"); //$NON-NLS-1$
/** IElementType for UML Interface */
- public static final IHintedType INTERFACE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Interface"); //$NON-NLS-1$
+ public static final IHintedType INTERFACE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Interface"); //$NON-NLS-1$
/** IElementType for UML InterfaceRealization */
- public static final IHintedType INTERFACE_REALIZATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.InterfaceRealization"); //$NON-NLS-1$
+ public static final IHintedType INTERFACE_REALIZATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.InterfaceRealization"); //$NON-NLS-1$
/** IElementType for UML InterruptibleActivityRegion */
- public static final IHintedType INTERRUPTIBLE_ACTIVITY_REGION = (IHintedType)getElementType("org.eclipse.papyrus.uml.InterruptibleActivityRegion"); //$NON-NLS-1$
+ public static final IHintedType INTERRUPTIBLE_ACTIVITY_REGION = (IHintedType) getElementType("org.eclipse.papyrus.uml.InterruptibleActivityRegion"); //$NON-NLS-1$
/** IElementType for UML Interval */
- public static final IHintedType INTERVAL = (IHintedType)getElementType("org.eclipse.papyrus.uml.Interval"); //$NON-NLS-1$
+ public static final IHintedType INTERVAL = (IHintedType) getElementType("org.eclipse.papyrus.uml.Interval"); //$NON-NLS-1$
/** IElementType for UML IntervalConstraint */
- public static final IHintedType INTERVAL_CONSTRAINT = (IHintedType)getElementType("org.eclipse.papyrus.uml.IntervalConstraint"); //$NON-NLS-1$
+ public static final IHintedType INTERVAL_CONSTRAINT = (IHintedType) getElementType("org.eclipse.papyrus.uml.IntervalConstraint"); //$NON-NLS-1$
/** IElementType for UML InvocationAction */
- public static final IHintedType INVOCATION_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.InvocationAction"); //$NON-NLS-1$
+ public static final IHintedType INVOCATION_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.InvocationAction"); //$NON-NLS-1$
/** IElementType for UML JoinNode */
- public static final IHintedType JOIN_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.JoinNode"); //$NON-NLS-1$
+ public static final IHintedType JOIN_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.JoinNode"); //$NON-NLS-1$
/** IElementType for UML Lifeline */
- public static final IHintedType LIFELINE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Lifeline"); //$NON-NLS-1$
+ public static final IHintedType LIFELINE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Lifeline"); //$NON-NLS-1$
/** IElementType for UML LinkAction */
- public static final IHintedType LINK_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.LinkAction"); //$NON-NLS-1$
+ public static final IHintedType LINK_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.LinkAction"); //$NON-NLS-1$
/** IElementType for UML LinkEndCreationData */
- public static final IHintedType LINK_END_CREATION_DATA = (IHintedType)getElementType("org.eclipse.papyrus.uml.LinkEndCreationData"); //$NON-NLS-1$
+ public static final IHintedType LINK_END_CREATION_DATA = (IHintedType) getElementType("org.eclipse.papyrus.uml.LinkEndCreationData"); //$NON-NLS-1$
/** IElementType for UML LinkEndData */
- public static final IHintedType LINK_END_DATA = (IHintedType)getElementType("org.eclipse.papyrus.uml.LinkEndData"); //$NON-NLS-1$
+ public static final IHintedType LINK_END_DATA = (IHintedType) getElementType("org.eclipse.papyrus.uml.LinkEndData"); //$NON-NLS-1$
/** IElementType for UML LinkEndDestructionData */
- public static final IHintedType LINK_END_DESTRUCTION_DATA = (IHintedType)getElementType("org.eclipse.papyrus.uml.LinkEndDestructionData"); //$NON-NLS-1$
+ public static final IHintedType LINK_END_DESTRUCTION_DATA = (IHintedType) getElementType("org.eclipse.papyrus.uml.LinkEndDestructionData"); //$NON-NLS-1$
/** IElementType for UML LiteralBoolean */
- public static final IHintedType LITERAL_BOOLEAN = (IHintedType)getElementType("org.eclipse.papyrus.uml.LiteralBoolean"); //$NON-NLS-1$
+ public static final IHintedType LITERAL_BOOLEAN = (IHintedType) getElementType("org.eclipse.papyrus.uml.LiteralBoolean"); //$NON-NLS-1$
/** IElementType for UML LiteralInteger */
- public static final IHintedType LITERAL_INTEGER = (IHintedType)getElementType("org.eclipse.papyrus.uml.LiteralInteger"); //$NON-NLS-1$
+ public static final IHintedType LITERAL_INTEGER = (IHintedType) getElementType("org.eclipse.papyrus.uml.LiteralInteger"); //$NON-NLS-1$
/** IElementType for UML LiteralNull */
- public static final IHintedType LITERAL_NULL = (IHintedType)getElementType("org.eclipse.papyrus.uml.LiteralNull"); //$NON-NLS-1$
+ public static final IHintedType LITERAL_NULL = (IHintedType) getElementType("org.eclipse.papyrus.uml.LiteralNull"); //$NON-NLS-1$
/** IElementType for UML LiteralReal */
- public static final IHintedType LITERAL_REAL = (IHintedType)getElementType("org.eclipse.papyrus.uml.LiteralReal"); //$NON-NLS-1$
+ public static final IHintedType LITERAL_REAL = (IHintedType) getElementType("org.eclipse.papyrus.uml.LiteralReal"); //$NON-NLS-1$
/** IElementType for UML LiteralSpecification */
- public static final IHintedType LITERAL_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.LiteralSpecification"); //$NON-NLS-1$
+ public static final IHintedType LITERAL_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.LiteralSpecification"); //$NON-NLS-1$
/** IElementType for UML LiteralString */
- public static final IHintedType LITERAL_STRING = (IHintedType)getElementType("org.eclipse.papyrus.uml.LiteralString"); //$NON-NLS-1$
+ public static final IHintedType LITERAL_STRING = (IHintedType) getElementType("org.eclipse.papyrus.uml.LiteralString"); //$NON-NLS-1$
/** IElementType for UML LiteralUnlimitedNatural */
- public static final IHintedType LITERAL_UNLIMITED_NATURAL = (IHintedType)getElementType("org.eclipse.papyrus.uml.LiteralUnlimitedNatural"); //$NON-NLS-1$
+ public static final IHintedType LITERAL_UNLIMITED_NATURAL = (IHintedType) getElementType("org.eclipse.papyrus.uml.LiteralUnlimitedNatural"); //$NON-NLS-1$
/** IElementType for UML LoopNode */
- public static final IHintedType LOOP_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.LoopNode"); //$NON-NLS-1$
+ public static final IHintedType LOOP_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.LoopNode"); //$NON-NLS-1$
/** IElementType for UML Manifestation */
- public static final IHintedType MANIFESTATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Manifestation"); //$NON-NLS-1$
+ public static final IHintedType MANIFESTATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Manifestation"); //$NON-NLS-1$
/** IElementType for UML MergeNode */
- public static final IHintedType MERGE_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.MergeNode"); //$NON-NLS-1$
+ public static final IHintedType MERGE_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.MergeNode"); //$NON-NLS-1$
/** IElementType for UML Message */
- public static final IHintedType MESSAGE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Message"); //$NON-NLS-1$
+ public static final IHintedType MESSAGE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Message"); //$NON-NLS-1$
/** IElementType for UML MessageEnd */
- public static final IHintedType MESSAGE_END = (IHintedType)getElementType("org.eclipse.papyrus.uml.MessageEnd"); //$NON-NLS-1$
+ public static final IHintedType MESSAGE_END = (IHintedType) getElementType("org.eclipse.papyrus.uml.MessageEnd"); //$NON-NLS-1$
/** IElementType for UML MessageEvent */
- public static final IHintedType MESSAGE_EVENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.MessageEvent"); //$NON-NLS-1$
+ public static final IHintedType MESSAGE_EVENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.MessageEvent"); //$NON-NLS-1$
/** IElementType for UML MessageOccurrenceSpecification */
- public static final IHintedType MESSAGE_OCCURRENCE_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.MessageOccurrenceSpecification"); //$NON-NLS-1$
+ public static final IHintedType MESSAGE_OCCURRENCE_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.MessageOccurrenceSpecification"); //$NON-NLS-1$
/** IElementType for UML Model */
- public static final IHintedType MODEL = (IHintedType)getElementType("org.eclipse.papyrus.uml.Model"); //$NON-NLS-1$
+ public static final IHintedType MODEL = (IHintedType) getElementType("org.eclipse.papyrus.uml.Model"); //$NON-NLS-1$
/** IElementType for UML MultiplicityElement */
- public static final IHintedType MULTIPLICITY_ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.MultiplicityElement"); //$NON-NLS-1$
+ public static final IHintedType MULTIPLICITY_ELEMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.MultiplicityElement"); //$NON-NLS-1$
/** IElementType for UML NamedElement */
- public static final IHintedType NAMED_ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.NamedElement"); //$NON-NLS-1$
+ public static final IHintedType NAMED_ELEMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.NamedElement"); //$NON-NLS-1$
/** IElementType for UML Namespace */
- public static final IHintedType NAMESPACE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Namespace"); //$NON-NLS-1$
+ public static final IHintedType NAMESPACE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Namespace"); //$NON-NLS-1$
/** IElementType for UML Node */
- public static final IHintedType NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Node"); //$NON-NLS-1$
+ public static final IHintedType NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Node"); //$NON-NLS-1$
/** IElementType for UML ObjectFlow */
- public static final IHintedType OBJECT_FLOW = (IHintedType)getElementType("org.eclipse.papyrus.uml.ObjectFlow"); //$NON-NLS-1$
+ public static final IHintedType OBJECT_FLOW = (IHintedType) getElementType("org.eclipse.papyrus.uml.ObjectFlow"); //$NON-NLS-1$
/** IElementType for UML ObjectNode */
- public static final IHintedType OBJECT_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ObjectNode"); //$NON-NLS-1$
+ public static final IHintedType OBJECT_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ObjectNode"); //$NON-NLS-1$
/** IElementType for UML Observation */
- public static final IHintedType OBSERVATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Observation"); //$NON-NLS-1$
+ public static final IHintedType OBSERVATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Observation"); //$NON-NLS-1$
/** IElementType for UML OccurrenceSpecification */
- public static final IHintedType OCCURRENCE_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.OccurrenceSpecification"); //$NON-NLS-1$
+ public static final IHintedType OCCURRENCE_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.OccurrenceSpecification"); //$NON-NLS-1$
/** IElementType for UML OpaqueAction */
- public static final IHintedType OPAQUE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.OpaqueAction"); //$NON-NLS-1$
+ public static final IHintedType OPAQUE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.OpaqueAction"); //$NON-NLS-1$
/** IElementType for UML OpaqueBehavior */
- public static final IHintedType OPAQUE_BEHAVIOR = (IHintedType)getElementType("org.eclipse.papyrus.uml.OpaqueBehavior"); //$NON-NLS-1$
+ public static final IHintedType OPAQUE_BEHAVIOR = (IHintedType) getElementType("org.eclipse.papyrus.uml.OpaqueBehavior"); //$NON-NLS-1$
/** IElementType for UML OpaqueExpression */
- public static final IHintedType OPAQUE_EXPRESSION = (IHintedType)getElementType("org.eclipse.papyrus.uml.OpaqueExpression"); //$NON-NLS-1$
+ public static final IHintedType OPAQUE_EXPRESSION = (IHintedType) getElementType("org.eclipse.papyrus.uml.OpaqueExpression"); //$NON-NLS-1$
/** IElementType for UML Operation */
- public static final IHintedType OPERATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Operation"); //$NON-NLS-1$
+ public static final IHintedType OPERATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Operation"); //$NON-NLS-1$
/** IElementType for UML OperationTemplateParameter */
- public static final IHintedType OPERATION_TEMPLATE_PARAMETER = (IHintedType)getElementType("org.eclipse.papyrus.uml.OperationTemplateParameter"); //$NON-NLS-1$
+ public static final IHintedType OPERATION_TEMPLATE_PARAMETER = (IHintedType) getElementType("org.eclipse.papyrus.uml.OperationTemplateParameter"); //$NON-NLS-1$
/** IElementType for UML OutputPin */
- public static final IHintedType OUTPUT_PIN = (IHintedType)getElementType("org.eclipse.papyrus.uml.OutputPin"); //$NON-NLS-1$
+ public static final IHintedType OUTPUT_PIN = (IHintedType) getElementType("org.eclipse.papyrus.uml.OutputPin"); //$NON-NLS-1$
/** IElementType for UML Package */
- public static final IHintedType PACKAGE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Package"); //$NON-NLS-1$
+ public static final IHintedType PACKAGE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Package"); //$NON-NLS-1$
/** IElementType for UML PackageImport */
- public static final IHintedType PACKAGE_IMPORT = (IHintedType)getElementType("org.eclipse.papyrus.uml.PackageImport"); //$NON-NLS-1$
+ public static final IHintedType PACKAGE_IMPORT = (IHintedType) getElementType("org.eclipse.papyrus.uml.PackageImport"); //$NON-NLS-1$
/** IElementType for UML PackageMerge */
- public static final IHintedType PACKAGE_MERGE = (IHintedType)getElementType("org.eclipse.papyrus.uml.PackageMerge"); //$NON-NLS-1$
+ public static final IHintedType PACKAGE_MERGE = (IHintedType) getElementType("org.eclipse.papyrus.uml.PackageMerge"); //$NON-NLS-1$
/** IElementType for UML PackageableElement */
- public static final IHintedType PACKAGEABLE_ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.PackageableElement"); //$NON-NLS-1$
+ public static final IHintedType PACKAGEABLE_ELEMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.PackageableElement"); //$NON-NLS-1$
/** IElementType for UML Parameter */
- public static final IHintedType PARAMETER = (IHintedType)getElementType("org.eclipse.papyrus.uml.Parameter"); //$NON-NLS-1$
+ public static final IHintedType PARAMETER = (IHintedType) getElementType("org.eclipse.papyrus.uml.Parameter"); //$NON-NLS-1$
/** IElementType for UML ParameterSet */
- public static final IHintedType PARAMETER_SET = (IHintedType)getElementType("org.eclipse.papyrus.uml.ParameterSet"); //$NON-NLS-1$
+ public static final IHintedType PARAMETER_SET = (IHintedType) getElementType("org.eclipse.papyrus.uml.ParameterSet"); //$NON-NLS-1$
/** IElementType for UML ParameterableElement */
- public static final IHintedType PARAMETERABLE_ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.ParameterableElement"); //$NON-NLS-1$
+ public static final IHintedType PARAMETERABLE_ELEMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.ParameterableElement"); //$NON-NLS-1$
/** IElementType for UML PartDecomposition */
- public static final IHintedType PART_DECOMPOSITION = (IHintedType)getElementType("org.eclipse.papyrus.uml.PartDecomposition"); //$NON-NLS-1$
+ public static final IHintedType PART_DECOMPOSITION = (IHintedType) getElementType("org.eclipse.papyrus.uml.PartDecomposition"); //$NON-NLS-1$
/** IElementType for UML Pin */
- public static final IHintedType PIN = (IHintedType)getElementType("org.eclipse.papyrus.uml.Pin"); //$NON-NLS-1$
+ public static final IHintedType PIN = (IHintedType) getElementType("org.eclipse.papyrus.uml.Pin"); //$NON-NLS-1$
/** IElementType for UML Port */
- public static final IHintedType PORT = (IHintedType)getElementType("org.eclipse.papyrus.uml.Port"); //$NON-NLS-1$
+ public static final IHintedType PORT = (IHintedType) getElementType("org.eclipse.papyrus.uml.Port"); //$NON-NLS-1$
/** IElementType for UML PrimitiveType */
- public static final IHintedType PRIMITIVE_TYPE = (IHintedType)getElementType("org.eclipse.papyrus.uml.PrimitiveType"); //$NON-NLS-1$
+ public static final IHintedType PRIMITIVE_TYPE = (IHintedType) getElementType("org.eclipse.papyrus.uml.PrimitiveType"); //$NON-NLS-1$
/** IElementType for UML Profile */
- public static final IHintedType PROFILE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Profile"); //$NON-NLS-1$
+ public static final IHintedType PROFILE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Profile"); //$NON-NLS-1$
/** IElementType for UML ProfileApplication */
- public static final IHintedType PROFILE_APPLICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ProfileApplication"); //$NON-NLS-1$
+ public static final IHintedType PROFILE_APPLICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ProfileApplication"); //$NON-NLS-1$
/** IElementType for UML Property */
- public static final IHintedType PROPERTY = (IHintedType)getElementType("org.eclipse.papyrus.uml.Property"); //$NON-NLS-1$
+ public static final IHintedType PROPERTY = (IHintedType) getElementType("org.eclipse.papyrus.uml.Property"); //$NON-NLS-1$
/** IElementType for UML ProtocolConformance */
- public static final IHintedType PROTOCOL_CONFORMANCE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ProtocolConformance"); //$NON-NLS-1$
+ public static final IHintedType PROTOCOL_CONFORMANCE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ProtocolConformance"); //$NON-NLS-1$
/** IElementType for UML ProtocolStateMachine */
- public static final IHintedType PROTOCOL_STATE_MACHINE = (IHintedType)getElementType("org.eclipse.papyrus.uml.ProtocolStateMachine"); //$NON-NLS-1$
+ public static final IHintedType PROTOCOL_STATE_MACHINE = (IHintedType) getElementType("org.eclipse.papyrus.uml.ProtocolStateMachine"); //$NON-NLS-1$
/** IElementType for UML ProtocolTransition */
- public static final IHintedType PROTOCOL_TRANSITION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ProtocolTransition"); //$NON-NLS-1$
+ public static final IHintedType PROTOCOL_TRANSITION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ProtocolTransition"); //$NON-NLS-1$
/** IElementType for UML Pseudostate */
- public static final IHintedType PSEUDOSTATE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Pseudostate"); //$NON-NLS-1$
+ public static final IHintedType PSEUDOSTATE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Pseudostate"); //$NON-NLS-1$
/** IElementType for UML QualifierValue */
- public static final IHintedType QUALIFIER_VALUE = (IHintedType)getElementType("org.eclipse.papyrus.uml.QualifierValue"); //$NON-NLS-1$
+ public static final IHintedType QUALIFIER_VALUE = (IHintedType) getElementType("org.eclipse.papyrus.uml.QualifierValue"); //$NON-NLS-1$
/** IElementType for UML RaiseExceptionAction */
- public static final IHintedType RAISE_EXCEPTION_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.RaiseExceptionAction"); //$NON-NLS-1$
+ public static final IHintedType RAISE_EXCEPTION_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.RaiseExceptionAction"); //$NON-NLS-1$
/** IElementType for UML ReadExtentAction */
- public static final IHintedType READ_EXTENT_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReadExtentAction"); //$NON-NLS-1$
+ public static final IHintedType READ_EXTENT_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReadExtentAction"); //$NON-NLS-1$
/** IElementType for UML ReadIsClassifiedObjectAction */
- public static final IHintedType READ_IS_CLASSIFIED_OBJECT_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReadIsClassifiedObjectAction"); //$NON-NLS-1$
+ public static final IHintedType READ_IS_CLASSIFIED_OBJECT_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReadIsClassifiedObjectAction"); //$NON-NLS-1$
/** IElementType for UML ReadLinkAction */
- public static final IHintedType READ_LINK_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReadLinkAction"); //$NON-NLS-1$
+ public static final IHintedType READ_LINK_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReadLinkAction"); //$NON-NLS-1$
/** IElementType for UML ReadLinkObjectEndAction */
- public static final IHintedType READ_LINK_OBJECT_END_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReadLinkObjectEndAction"); //$NON-NLS-1$
+ public static final IHintedType READ_LINK_OBJECT_END_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReadLinkObjectEndAction"); //$NON-NLS-1$
/** IElementType for UML ReadLinkObjectEndQualifierAction */
- public static final IHintedType READ_LINK_OBJECT_END_QUALIFIER_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReadLinkObjectEndQualifierAction"); //$NON-NLS-1$
+ public static final IHintedType READ_LINK_OBJECT_END_QUALIFIER_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReadLinkObjectEndQualifierAction"); //$NON-NLS-1$
/** IElementType for UML ReadSelfAction */
- public static final IHintedType READ_SELF_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReadSelfAction"); //$NON-NLS-1$
+ public static final IHintedType READ_SELF_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReadSelfAction"); //$NON-NLS-1$
/** IElementType for UML ReadStructuralFeatureAction */
- public static final IHintedType READ_STRUCTURAL_FEATURE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReadStructuralFeatureAction"); //$NON-NLS-1$
+ public static final IHintedType READ_STRUCTURAL_FEATURE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReadStructuralFeatureAction"); //$NON-NLS-1$
/** IElementType for UML ReadVariableAction */
- public static final IHintedType READ_VARIABLE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReadVariableAction"); //$NON-NLS-1$
+ public static final IHintedType READ_VARIABLE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReadVariableAction"); //$NON-NLS-1$
/** IElementType for UML Realization */
- public static final IHintedType REALIZATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Realization"); //$NON-NLS-1$
+ public static final IHintedType REALIZATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Realization"); //$NON-NLS-1$
/** IElementType for UML Reception */
- public static final IHintedType RECEPTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Reception"); //$NON-NLS-1$
+ public static final IHintedType RECEPTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Reception"); //$NON-NLS-1$
/** IElementType for UML ReclassifyObjectAction */
- public static final IHintedType RECLASSIFY_OBJECT_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReclassifyObjectAction"); //$NON-NLS-1$
+ public static final IHintedType RECLASSIFY_OBJECT_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReclassifyObjectAction"); //$NON-NLS-1$
/** IElementType for UML RedefinableElement */
- public static final IHintedType REDEFINABLE_ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.RedefinableElement"); //$NON-NLS-1$
+ public static final IHintedType REDEFINABLE_ELEMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.RedefinableElement"); //$NON-NLS-1$
/** IElementType for UML RedefinableTemplateSignature */
- public static final IHintedType REDEFINABLE_TEMPLATE_SIGNATURE = (IHintedType)getElementType("org.eclipse.papyrus.uml.RedefinableTemplateSignature"); //$NON-NLS-1$
+ public static final IHintedType REDEFINABLE_TEMPLATE_SIGNATURE = (IHintedType) getElementType("org.eclipse.papyrus.uml.RedefinableTemplateSignature"); //$NON-NLS-1$
/** IElementType for UML ReduceAction */
- public static final IHintedType REDUCE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReduceAction"); //$NON-NLS-1$
+ public static final IHintedType REDUCE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReduceAction"); //$NON-NLS-1$
/** IElementType for UML Region */
- public static final IHintedType REGION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Region"); //$NON-NLS-1$
+ public static final IHintedType REGION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Region"); //$NON-NLS-1$
/** IElementType for UML Relationship */
- public static final IHintedType RELATIONSHIP = (IHintedType)getElementType("org.eclipse.papyrus.uml.Relationship"); //$NON-NLS-1$
+ public static final IHintedType RELATIONSHIP = (IHintedType) getElementType("org.eclipse.papyrus.uml.Relationship"); //$NON-NLS-1$
/** IElementType for UML RemoveStructuralFeatureValueAction */
- public static final IHintedType REMOVE_STRUCTURAL_FEATURE_VALUE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.RemoveStructuralFeatureValueAction"); //$NON-NLS-1$
+ public static final IHintedType REMOVE_STRUCTURAL_FEATURE_VALUE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.RemoveStructuralFeatureValueAction"); //$NON-NLS-1$
/** IElementType for UML RemoveVariableValueAction */
- public static final IHintedType REMOVE_VARIABLE_VALUE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.RemoveVariableValueAction"); //$NON-NLS-1$
+ public static final IHintedType REMOVE_VARIABLE_VALUE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.RemoveVariableValueAction"); //$NON-NLS-1$
/** IElementType for UML ReplyAction */
- public static final IHintedType REPLY_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ReplyAction"); //$NON-NLS-1$
+ public static final IHintedType REPLY_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ReplyAction"); //$NON-NLS-1$
/** IElementType for UML SendObjectAction */
- public static final IHintedType SEND_OBJECT_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.SendObjectAction"); //$NON-NLS-1$
+ public static final IHintedType SEND_OBJECT_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.SendObjectAction"); //$NON-NLS-1$
/** IElementType for UML SendSignalAction */
- public static final IHintedType SEND_SIGNAL_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.SendSignalAction"); //$NON-NLS-1$
+ public static final IHintedType SEND_SIGNAL_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.SendSignalAction"); //$NON-NLS-1$
/** IElementType for UML SequenceNode */
- public static final IHintedType SEQUENCE_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.SequenceNode"); //$NON-NLS-1$
+ public static final IHintedType SEQUENCE_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.SequenceNode"); //$NON-NLS-1$
/** IElementType for UML Signal */
- public static final IHintedType SIGNAL = (IHintedType)getElementType("org.eclipse.papyrus.uml.Signal"); //$NON-NLS-1$
+ public static final IHintedType SIGNAL = (IHintedType) getElementType("org.eclipse.papyrus.uml.Signal"); //$NON-NLS-1$
/** IElementType for UML SignalEvent */
- public static final IHintedType SIGNAL_EVENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.SignalEvent"); //$NON-NLS-1$
+ public static final IHintedType SIGNAL_EVENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.SignalEvent"); //$NON-NLS-1$
/** IElementType for UML Slot */
- public static final IHintedType SLOT = (IHintedType)getElementType("org.eclipse.papyrus.uml.Slot"); //$NON-NLS-1$
+ public static final IHintedType SLOT = (IHintedType) getElementType("org.eclipse.papyrus.uml.Slot"); //$NON-NLS-1$
/** IElementType for UML StartClassifierBehaviorAction */
- public static final IHintedType START_CLASSIFIER_BEHAVIOR_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.StartClassifierBehaviorAction"); //$NON-NLS-1$
+ public static final IHintedType START_CLASSIFIER_BEHAVIOR_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.StartClassifierBehaviorAction"); //$NON-NLS-1$
/** IElementType for UML StartObjectBehaviorAction */
- public static final IHintedType START_OBJECT_BEHAVIOR_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.StartObjectBehaviorAction"); //$NON-NLS-1$
+ public static final IHintedType START_OBJECT_BEHAVIOR_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.StartObjectBehaviorAction"); //$NON-NLS-1$
/** IElementType for UML State */
- public static final IHintedType STATE = (IHintedType)getElementType("org.eclipse.papyrus.uml.State"); //$NON-NLS-1$
+ public static final IHintedType STATE = (IHintedType) getElementType("org.eclipse.papyrus.uml.State"); //$NON-NLS-1$
/** IElementType for UML StateInvariant */
- public static final IHintedType STATE_INVARIANT = (IHintedType)getElementType("org.eclipse.papyrus.uml.StateInvariant"); //$NON-NLS-1$
+ public static final IHintedType STATE_INVARIANT = (IHintedType) getElementType("org.eclipse.papyrus.uml.StateInvariant"); //$NON-NLS-1$
/** IElementType for UML StateMachine */
- public static final IHintedType STATE_MACHINE = (IHintedType)getElementType("org.eclipse.papyrus.uml.StateMachine"); //$NON-NLS-1$
+ public static final IHintedType STATE_MACHINE = (IHintedType) getElementType("org.eclipse.papyrus.uml.StateMachine"); //$NON-NLS-1$
/** IElementType for UML Stereotype */
- public static final IHintedType STEREOTYPE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Stereotype"); //$NON-NLS-1$
+ public static final IHintedType STEREOTYPE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Stereotype"); //$NON-NLS-1$
/** IElementType for UML StringExpression */
- public static final IHintedType STRING_EXPRESSION = (IHintedType)getElementType("org.eclipse.papyrus.uml.StringExpression"); //$NON-NLS-1$
+ public static final IHintedType STRING_EXPRESSION = (IHintedType) getElementType("org.eclipse.papyrus.uml.StringExpression"); //$NON-NLS-1$
/** IElementType for UML StructuralFeature */
- public static final IHintedType STRUCTURAL_FEATURE = (IHintedType)getElementType("org.eclipse.papyrus.uml.StructuralFeature"); //$NON-NLS-1$
+ public static final IHintedType STRUCTURAL_FEATURE = (IHintedType) getElementType("org.eclipse.papyrus.uml.StructuralFeature"); //$NON-NLS-1$
/** IElementType for UML StructuralFeatureAction */
- public static final IHintedType STRUCTURAL_FEATURE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.StructuralFeatureAction"); //$NON-NLS-1$
+ public static final IHintedType STRUCTURAL_FEATURE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.StructuralFeatureAction"); //$NON-NLS-1$
/** IElementType for UML StructuredActivityNode */
- public static final IHintedType STRUCTURED_ACTIVITY_NODE = (IHintedType)getElementType("org.eclipse.papyrus.uml.StructuredActivityNode"); //$NON-NLS-1$
+ public static final IHintedType STRUCTURED_ACTIVITY_NODE = (IHintedType) getElementType("org.eclipse.papyrus.uml.StructuredActivityNode"); //$NON-NLS-1$
/** IElementType for UML StructuredClassifier */
- public static final IHintedType STRUCTURED_CLASSIFIER = (IHintedType)getElementType("org.eclipse.papyrus.uml.StructuredClassifier"); //$NON-NLS-1$
+ public static final IHintedType STRUCTURED_CLASSIFIER = (IHintedType) getElementType("org.eclipse.papyrus.uml.StructuredClassifier"); //$NON-NLS-1$
/** IElementType for UML Substitution */
- public static final IHintedType SUBSTITUTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Substitution"); //$NON-NLS-1$
+ public static final IHintedType SUBSTITUTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Substitution"); //$NON-NLS-1$
/** IElementType for UML TemplateBinding */
- public static final IHintedType TEMPLATE_BINDING = (IHintedType)getElementType("org.eclipse.papyrus.uml.TemplateBinding"); //$NON-NLS-1$
+ public static final IHintedType TEMPLATE_BINDING = (IHintedType) getElementType("org.eclipse.papyrus.uml.TemplateBinding"); //$NON-NLS-1$
/** IElementType for UML TemplateParameter */
- public static final IHintedType TEMPLATE_PARAMETER = (IHintedType)getElementType("org.eclipse.papyrus.uml.TemplateParameter"); //$NON-NLS-1$
+ public static final IHintedType TEMPLATE_PARAMETER = (IHintedType) getElementType("org.eclipse.papyrus.uml.TemplateParameter"); //$NON-NLS-1$
/** IElementType for UML TemplateParameterSubstitution */
- public static final IHintedType TEMPLATE_PARAMETER_SUBSTITUTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.TemplateParameterSubstitution"); //$NON-NLS-1$
+ public static final IHintedType TEMPLATE_PARAMETER_SUBSTITUTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.TemplateParameterSubstitution"); //$NON-NLS-1$
/** IElementType for UML TemplateSignature */
- public static final IHintedType TEMPLATE_SIGNATURE = (IHintedType)getElementType("org.eclipse.papyrus.uml.TemplateSignature"); //$NON-NLS-1$
+ public static final IHintedType TEMPLATE_SIGNATURE = (IHintedType) getElementType("org.eclipse.papyrus.uml.TemplateSignature"); //$NON-NLS-1$
/** IElementType for UML TemplateableElement */
- public static final IHintedType TEMPLATEABLE_ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.TemplateableElement"); //$NON-NLS-1$
+ public static final IHintedType TEMPLATEABLE_ELEMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.TemplateableElement"); //$NON-NLS-1$
/** IElementType for UML TestIdentityAction */
- public static final IHintedType TEST_IDENTITY_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.TestIdentityAction"); //$NON-NLS-1$
+ public static final IHintedType TEST_IDENTITY_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.TestIdentityAction"); //$NON-NLS-1$
/** IElementType for UML TimeConstraint */
- public static final IHintedType TIME_CONSTRAINT = (IHintedType)getElementType("org.eclipse.papyrus.uml.TimeConstraint"); //$NON-NLS-1$
+ public static final IHintedType TIME_CONSTRAINT = (IHintedType) getElementType("org.eclipse.papyrus.uml.TimeConstraint"); //$NON-NLS-1$
/** IElementType for UML TimeEvent */
- public static final IHintedType TIME_EVENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.TimeEvent"); //$NON-NLS-1$
+ public static final IHintedType TIME_EVENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.TimeEvent"); //$NON-NLS-1$
/** IElementType for UML TimeExpression */
- public static final IHintedType TIME_EXPRESSION = (IHintedType)getElementType("org.eclipse.papyrus.uml.TimeExpression"); //$NON-NLS-1$
+ public static final IHintedType TIME_EXPRESSION = (IHintedType) getElementType("org.eclipse.papyrus.uml.TimeExpression"); //$NON-NLS-1$
/** IElementType for UML TimeInterval */
- public static final IHintedType TIME_INTERVAL = (IHintedType)getElementType("org.eclipse.papyrus.uml.TimeInterval"); //$NON-NLS-1$
+ public static final IHintedType TIME_INTERVAL = (IHintedType) getElementType("org.eclipse.papyrus.uml.TimeInterval"); //$NON-NLS-1$
/** IElementType for UML TimeObservation */
- public static final IHintedType TIME_OBSERVATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.TimeObservation"); //$NON-NLS-1$
+ public static final IHintedType TIME_OBSERVATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.TimeObservation"); //$NON-NLS-1$
/** IElementType for UML Transition */
- public static final IHintedType TRANSITION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Transition"); //$NON-NLS-1$
+ public static final IHintedType TRANSITION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Transition"); //$NON-NLS-1$
/** IElementType for UML Trigger */
- public static final IHintedType TRIGGER = (IHintedType)getElementType("org.eclipse.papyrus.uml.Trigger"); //$NON-NLS-1$
+ public static final IHintedType TRIGGER = (IHintedType) getElementType("org.eclipse.papyrus.uml.Trigger"); //$NON-NLS-1$
/** IElementType for UML Type */
- public static final IHintedType TYPE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Type"); //$NON-NLS-1$
+ public static final IHintedType TYPE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Type"); //$NON-NLS-1$
/** IElementType for UML TypedElement */
- public static final IHintedType TYPED_ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.TypedElement"); //$NON-NLS-1$
+ public static final IHintedType TYPED_ELEMENT = (IHintedType) getElementType("org.eclipse.papyrus.uml.TypedElement"); //$NON-NLS-1$
/** IElementType for UML UnmarshallAction */
- public static final IHintedType UNMARSHALL_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.UnmarshallAction"); //$NON-NLS-1$
+ public static final IHintedType UNMARSHALL_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.UnmarshallAction"); //$NON-NLS-1$
/** IElementType for UML Usage */
- public static final IHintedType USAGE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Usage"); //$NON-NLS-1$
+ public static final IHintedType USAGE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Usage"); //$NON-NLS-1$
/** IElementType for UML UseCase */
- public static final IHintedType USE_CASE = (IHintedType)getElementType("org.eclipse.papyrus.uml.UseCase"); //$NON-NLS-1$
+ public static final IHintedType USE_CASE = (IHintedType) getElementType("org.eclipse.papyrus.uml.UseCase"); //$NON-NLS-1$
/** IElementType for UML ValuePin */
- public static final IHintedType VALUE_PIN = (IHintedType)getElementType("org.eclipse.papyrus.uml.ValuePin"); //$NON-NLS-1$
+ public static final IHintedType VALUE_PIN = (IHintedType) getElementType("org.eclipse.papyrus.uml.ValuePin"); //$NON-NLS-1$
/** IElementType for UML ValueSpecification */
- public static final IHintedType VALUE_SPECIFICATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ValueSpecification"); //$NON-NLS-1$
+ public static final IHintedType VALUE_SPECIFICATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ValueSpecification"); //$NON-NLS-1$
/** IElementType for UML ValueSpecificationAction */
- public static final IHintedType VALUE_SPECIFICATION_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.ValueSpecificationAction"); //$NON-NLS-1$
+ public static final IHintedType VALUE_SPECIFICATION_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.ValueSpecificationAction"); //$NON-NLS-1$
/** IElementType for UML Variable */
- public static final IHintedType VARIABLE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Variable"); //$NON-NLS-1$
+ public static final IHintedType VARIABLE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Variable"); //$NON-NLS-1$
/** IElementType for UML VariableAction */
- public static final IHintedType VARIABLE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.VariableAction"); //$NON-NLS-1$
+ public static final IHintedType VARIABLE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.VariableAction"); //$NON-NLS-1$
/** IElementType for UML Vertex */
- public static final IHintedType VERTEX = (IHintedType)getElementType("org.eclipse.papyrus.uml.Vertex"); //$NON-NLS-1$
+ public static final IHintedType VERTEX = (IHintedType) getElementType("org.eclipse.papyrus.uml.Vertex"); //$NON-NLS-1$
/** IElementType for UML WriteLinkAction */
- public static final IHintedType WRITE_LINK_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.WriteLinkAction"); //$NON-NLS-1$
+ public static final IHintedType WRITE_LINK_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.WriteLinkAction"); //$NON-NLS-1$
/** IElementType for UML WriteStructuralFeatureAction */
- public static final IHintedType WRITE_STRUCTURAL_FEATURE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.WriteStructuralFeatureAction"); //$NON-NLS-1$
+ public static final IHintedType WRITE_STRUCTURAL_FEATURE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.WriteStructuralFeatureAction"); //$NON-NLS-1$
/** IElementType for UML WriteVariableAction */
- public static final IHintedType WRITE_VARIABLE_ACTION = (IHintedType)getElementType("org.eclipse.papyrus.uml.WriteVariableAction"); //$NON-NLS-1$
+ public static final IHintedType WRITE_VARIABLE_ACTION = (IHintedType) getElementType("org.eclipse.papyrus.uml.WriteVariableAction"); //$NON-NLS-1$
/** IElementType for UML Association */
- public static final IHintedType ASSOCIATION = (IHintedType)getElementType("org.eclipse.papyrus.uml.Association"); //$NON-NLS-1$
+ public static final IHintedType ASSOCIATION = (IHintedType) getElementType("org.eclipse.papyrus.uml.Association"); //$NON-NLS-1$
/** IElementType for UML Trace */
- public static final IHintedType TRACE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Trace"); //$NON-NLS-1$
+ public static final IHintedType TRACE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Trace"); //$NON-NLS-1$
/** IElementType for UML Refine */
- public static final IHintedType REFINE = (IHintedType)getElementType("org.eclipse.papyrus.uml.Refine"); //$NON-NLS-1$
+ public static final IHintedType REFINE = (IHintedType) getElementType("org.eclipse.papyrus.uml.Refine"); //$NON-NLS-1$
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/filter/ICommandFilter.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/filter/ICommandFilter.java
index eee5c2cdb89..6e529970a51 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/filter/ICommandFilter.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/filter/ICommandFilter.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,7 +22,7 @@ public interface ICommandFilter {
/**
* Get the list of element type for which the creation command is visible.
- *
+ *
* @return the list of allowed element types.
*/
public List<IElementType> getVisibleCommands();
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/filter/UmlElementCommandFilter.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/filter/UmlElementCommandFilter.java
index dbf1a65451c..b64adccf654 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/filter/UmlElementCommandFilter.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src-gen/org/eclipse/papyrus/uml/service/types/filter/UmlElementCommandFilter.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,11 +28,11 @@ public class UmlElementCommandFilter implements ICommandFilter {
private List<IElementType> visibleCommands;
private UmlElementCommandFilter() {
- //to prevent instantiation
+ // to prevent instantiation
}
public List<IElementType> getVisibleCommands() {
- if(visibleCommands == null) {
+ if (visibleCommands == null) {
List<IElementType> localVisibleCommands = new ArrayList<IElementType>();
// localVisibleCommands.add(UMLElementTypes.ABSTRACTION);
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/Activator.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/Activator.java
index 6f38ae66c51..a8641a88a44 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/Activator.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -61,7 +61,7 @@ public class Activator extends Plugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/AssociationReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/AssociationReorientCommand.java
index f56f5003743..6dcf4d1a34e 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/AssociationReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/AssociationReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.service.types.utils.ClassifierUtils;
import org.eclipse.uml2.uml.Artifact;
import org.eclipse.uml2.uml.Association;
@@ -38,7 +39,7 @@ import org.eclipse.uml2.uml.StructuredClassifier;
*
* Expected behavior:
* When the association is re-oriented, the type of the property on the opposite side
- * of the re-oriented association end has to be modified accordingly to the new end
+ * of the re-oriented association end has to be modified accordingly to the new end
* (from a graphical point of view - its a Classifier).
* </pre>
*/
@@ -63,20 +64,21 @@ public class AssociationReorientCommand extends EditElementCommand {
/**
* Test if the command can be executed.
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Association) {
+ if (false == getElementToEdit() instanceof Association) {
return false;
}
- if(getLink().getMemberEnds().size() != 2) {
+ if (getLink().getMemberEnds().size() != 2) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
@@ -87,7 +89,7 @@ public class AssociationReorientCommand extends EditElementCommand {
* <pre>
* This method test if the {@link Association} can be re-oriented to a new source.
* </pre>
- *
+ *
* @return true if the link end can be re-oriented to a new source
*/
protected boolean canReorientSource() {
@@ -96,12 +98,12 @@ public class AssociationReorientCommand extends EditElementCommand {
// The re-orient of the graphical source of the link also results in the
// modification of the semantic source of the association (if not owned by the association)
// the new parent of the semantic source has to be the new graphical source.
- if(!getLink().getOwnedEnds().contains(getSemanticSource())) {
+ if (!getLink().getOwnedEnds().contains(getSemanticSource())) {
// The semantic source should be moved to a new parent (a Classifier that can hold
// attributes), ensure the new parent (new graphical source) match following kind of
// Classifier: Artifact, DataType, Interface, Signal, StructuredClassifier, Class.
- if(!((getNewSource() instanceof Artifact) || (getNewSource() instanceof DataType) || (getNewSource() instanceof Interface) || (getNewSource() instanceof Signal) || (getNewSource() instanceof StructuredClassifier) || (getNewSource() instanceof Class))) {
+ if (!((getNewSource() instanceof Artifact) || (getNewSource() instanceof DataType) || (getNewSource() instanceof Interface) || (getNewSource() instanceof Signal) || (getNewSource() instanceof StructuredClassifier) || (getNewSource() instanceof Class))) {
return false;
}
@@ -109,7 +111,7 @@ public class AssociationReorientCommand extends EditElementCommand {
}
// Semantic source is owned by the Association, only ensure the graphical source is a Classifier.
- if(!(getNewSource() instanceof Classifier)) {
+ if (!(getNewSource() instanceof Classifier)) {
return false;
}
@@ -120,7 +122,7 @@ public class AssociationReorientCommand extends EditElementCommand {
* <pre>
* This method test if the {@link Association} can be re-oriented to a new target.
* </pre>
- *
+ *
* @return true if the link end can be re-oriented to a new source
*/
protected boolean canReorientTarget() {
@@ -129,12 +131,12 @@ public class AssociationReorientCommand extends EditElementCommand {
// The re-orient of the graphical target of the link also results in the
// modification of the semantic target of the association (if not owned by the association)
// the new parent of the semantic target has to be the new graphical target.
- if(!getLink().getOwnedEnds().contains(getSemanticTarget())) {
+ if (!getLink().getOwnedEnds().contains(getSemanticTarget())) {
// The semantic target should be moved to a new parent (a Classifier that can hold
// attributes), ensure the new parent (new graphical target) match following kind of
// Classifier: Artifact, DataType, Interface, Signal, StructuredClassifier, Class.
- if(!((getNewTarget() instanceof Artifact) || (getNewTarget() instanceof DataType) || (getNewTarget() instanceof Interface) || (getNewTarget() instanceof Signal) || (getNewTarget() instanceof StructuredClassifier) || (getNewTarget() instanceof Class))) {
+ if (!((getNewTarget() instanceof Artifact) || (getNewTarget() instanceof DataType) || (getNewTarget() instanceof Interface) || (getNewTarget() instanceof Signal) || (getNewTarget() instanceof StructuredClassifier) || (getNewTarget() instanceof Class))) {
return false;
}
@@ -142,21 +144,22 @@ public class AssociationReorientCommand extends EditElementCommand {
}
// Semantic target is owned by the Association, only ensure the graphical target is a Classifier.
- if(!(getNewTarget() instanceof Classifier)) {
+ if (!(getNewTarget() instanceof Classifier)) {
return false;
}
return true;
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -166,14 +169,14 @@ public class AssociationReorientCommand extends EditElementCommand {
// The re-orient of the graphical source of the link results in the
// modification of the semantic target of the association.
// Let the advice do the property move via edit service
- //reorientEnd(getSemanticTarget(), (Classifier)getNewSource());
+ // reorientEnd(getSemanticTarget(), (Classifier)getNewSource());
// The re-orient of the graphical source of the link also results in the
// modification of the semantic source of the association (if not owned by the association)
// the new parent of the semantic source has to be the new graphical source.
- if(!getLink().getOwnedEnds().contains(getSemanticSource())) {
+ if (!getLink().getOwnedEnds().contains(getSemanticSource())) {
// Let the advice do the property move via edit service
- //moveEnd(getSemanticSource(), (Classifier)getNewSource());
+ // moveEnd(getSemanticSource(), (Classifier)getNewSource());
}
return CommandResult.newOKCommandResult(getLink());
@@ -181,16 +184,16 @@ public class AssociationReorientCommand extends EditElementCommand {
protected CommandResult reorientTarget() throws ExecutionException {
// The re-orient of the graphical target of the link results in the
- // modification of the semantic source of the association.
+ // modification of the semantic source of the association.
// Let the advice do the property move via edit service
- //reorientEnd(getSemanticSource(), (Classifier)getNewTarget());
+ // reorientEnd(getSemanticSource(), (Classifier)getNewTarget());
// The re-orient of the graphical target of the link also results in the
// modification of the semantic target of the association (if not owned by the association)
// the new parent of the semantic target has to be the new graphical target.
- if(!getLink().getOwnedEnds().contains(getSemanticTarget())) {
+ if (!getLink().getOwnedEnds().contains(getSemanticTarget())) {
// Let the advice do the property move via edit service
- //moveEnd(getSemanticTarget(), (Classifier)getNewTarget());
+ // moveEnd(getSemanticTarget(), (Classifier)getNewTarget());
}
return CommandResult.newOKCommandResult(getLink());
@@ -205,60 +208,60 @@ public class AssociationReorientCommand extends EditElementCommand {
private void moveEnd(Property end, Classifier newOwner) throws ExecutionException {
boolean added = ClassifierUtils.addOwnedAttribute(newOwner, end);
- if(!added) {
+ if (!added) {
throw new UnsupportedOperationException("Cannot add a Property on Classifier " + newOwner.getQualifiedName());
}
}
/**
* Get the link to re-orient.
- *
+ *
* @return the edited {@link Association}
*/
protected Association getLink() {
- return (Association)getElementToEdit();
+ return (Association) getElementToEdit();
}
/**
* Get the old {@link Association} source.
- *
+ *
* @return the previous {@link Association} source.
*/
protected Element getOldSource() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* Get the new {@link Association} source.
- *
+ *
* @return the new {@link Association} source.
*/
protected Element getNewSource() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
/**
* Get the old {@link Association} target.
- *
+ *
* @return the previous {@link Association} target.
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* Get the new {@link Association} target.
- *
+ *
* @return the new {@link Association} target.
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
/**
* Get the {@link Association} semantic source.
- *
+ *
* @return the {@link Association} semantic source.
*/
protected Property getSemanticSource() {
@@ -267,7 +270,7 @@ public class AssociationReorientCommand extends EditElementCommand {
/**
* Get the {@link Association} semantic target.
- *
+ *
* @return the {@link Association} semantic target.
*/
protected Property getSemanticTarget() {
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ComponentRealizationReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ComponentRealizationReorientCommand.java
index 6b893473097..53b2b8c14e1 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ComponentRealizationReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ComponentRealizationReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -44,40 +44,44 @@ public class ComponentRealizationReorientCommand extends DependencyReorientComma
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(! (getElementToEdit() instanceof ComponentRealization)) {
+ if (!(getElementToEdit() instanceof ComponentRealization)) {
return false;
}
-
+
return super.canExecute();
}
+ @Override
protected boolean canReorientSource() {
- if(!(newEnd instanceof Classifier)) {
+ if (!(newEnd instanceof Classifier)) {
return false;
}
if (newEnd == getLink().getAbstraction()) {
return false;
}
-
+
return true;
}
+ @Override
protected boolean canReorientTarget() {
- if(!(newEnd instanceof Component)) {
+ if (!(newEnd instanceof Component)) {
return false;
}
if (getLink().getRealizingClassifiers().contains(newEnd)) {
return false;
}
-
+
return true;
}
+ @Override
protected ComponentRealization getLink() {
- return (ComponentRealization)getElementToEdit();
+ return (ComponentRealization) getElementToEdit();
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientCommand.java
index 429345018f0..543718d79da 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientCommand.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.service.types.utils.RequestParameterUtils;
@@ -48,7 +49,7 @@ public class ConnectorReorientCommand extends ConnectorReorientSemanticCommand {
*/
private Edge reorientedEdgeView;
- // private ConnectorUtils utils = new ConnectorUtils();
+ // private ConnectorUtils utils = new ConnectorUtils();
/**
* Constructor.
@@ -58,9 +59,9 @@ public class ConnectorReorientCommand extends ConnectorReorientSemanticCommand {
}
/**
- *
+ *
* Constructor.
- *
+ *
* @param request
*/
public ConnectorReorientCommand(ReorientReferenceRelationshipRequest request) {
@@ -68,178 +69,178 @@ public class ConnectorReorientCommand extends ConnectorReorientSemanticCommand {
}
/**
- *
+ *
* @see org.eclipse.papyrus.uml.service.types.command.ConnectorReorientSemanticCommand#initFields()
- *
+ *
*/
@Override
protected void initFields() {
super.initFields();
reorientedEdgeView = RequestParameterUtils.getReconnectedEdge(getRequest());
newEndView = RequestParameterUtils.getReconnectedEndView(getRequest());
- if(this.reorientedEdgeView != null) {
- oppositeEndView = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? reorientedEdgeView.getTarget() : reorientedEdgeView.getSource();
+ if (this.reorientedEdgeView != null) {
+ oppositeEndView = (reorientDirection == ReorientRequest.REORIENT_SOURCE) ? reorientedEdgeView.getTarget() : reorientedEdgeView.getSource();
} else {
oppositeEndView = null;
}
- if(getNewPartWithPort() == null) {
+ if (getNewPartWithPort() == null) {
setNewPartWithPort(findNewPartWithPort());
}
- if(getOppositePartWithPort() == null) {
+ if (getOppositePartWithPort() == null) {
setOppositePartWithPort(findNewOppositePartWithPort());
}
}
- // /**
- // * Test if the command can be executed.
- // */
- // public boolean canExecute() {
- // if(!(getElementToEdit() instanceof Connector)) {
- // return false;
- // }
+ // /**
+ // * Test if the command can be executed.
+ // */
+ // public boolean canExecute() {
+ // if(!(getElementToEdit() instanceof Connector)) {
+ // return false;
+ // }
//
- // if(getLink().getEnds().size() != 2) {
- // return false;
- // }
+ // if(getLink().getEnds().size() != 2) {
+ // return false;
+ // }
//
- // return canReorient(newEndView, oppositeEndView);
- // }
+ // return canReorient(newEndView, oppositeEndView);
+ // }
//
- // private boolean canReorient(View newEndView, View oppositeEndView) {
+ // private boolean canReorient(View newEndView, View oppositeEndView) {
//
- // // Verify possible type of new source
- // if((newEndView.getElement() == null) || !(newEndView.getElement() instanceof ConnectableElement)) {
- // return false;
- // }
+ // // Verify possible type of new source
+ // if((newEndView.getElement() == null) || !(newEndView.getElement() instanceof ConnectableElement)) {
+ // return false;
+ // }
//
- // if((newEndView != null) && (oppositeEndView != null)) {
- // // Cannot create a self connector on a view
- // if(newEndView == oppositeEndView) {
- // return false;
- // }
+ // if((newEndView != null) && (oppositeEndView != null)) {
+ // // Cannot create a self connector on a view
+ // if(newEndView == oppositeEndView) {
+ // return false;
+ // }
//
- // // Cannot create a connector from a view representing a Part to its own Port (or the opposite)
- // if((newEndView.getChildren().contains(oppositeEndView)) || (oppositeEndView.getChildren().contains(newEndView))) {
- // return false;
- // }
+ // // Cannot create a connector from a view representing a Part to its own Port (or the opposite)
+ // if((newEndView.getChildren().contains(oppositeEndView)) || (oppositeEndView.getChildren().contains(newEndView))) {
+ // return false;
+ // }
//
- // // Cannot connect two Port owned by the same view
- // if((newEndView.getElement() instanceof Port) && (oppositeEndView.getElement() instanceof Port)) {
- // if(ViewUtil.getContainerView(newEndView) == ViewUtil.getContainerView(oppositeEndView)) {
- // return false;
- // }
- // }
+ // // Cannot connect two Port owned by the same view
+ // if((newEndView.getElement() instanceof Port) && (oppositeEndView.getElement() instanceof Port)) {
+ // if(ViewUtil.getContainerView(newEndView) == ViewUtil.getContainerView(oppositeEndView)) {
+ // return false;
+ // }
+ // }
//
- // // Cannot connect a Part to one of its (possibly indirect) containment, must connect to one of its Port.
- // if(utils.getStructureContainers(newEndView).contains(oppositeEndView) || utils.getStructureContainers(oppositeEndView).contains(newEndView)) {
- // return false;
- // }
+ // // Cannot connect a Part to one of its (possibly indirect) containment, must connect to one of its Port.
+ // if(utils.getStructureContainers(newEndView).contains(oppositeEndView) || utils.getStructureContainers(oppositeEndView).contains(newEndView)) {
+ // return false;
+ // }
//
- // // Ensure container can be deduced
- // if(deduceContainer(newEndView, oppositeEndView) == null) {
- // return false;
- // }
- // }
+ // // Ensure container can be deduced
+ // if(deduceContainer(newEndView, oppositeEndView) == null) {
+ // return false;
+ // }
+ // }
//
- // return true;
- // }
+ // return true;
+ // }
//
- // protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // if(!canExecute()) {
+ // protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ // if(!canExecute()) {
// throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- // }
+ // }
//
- // EObject oldOwner = getLink().eContainer();
+ // EObject oldOwner = getLink().eContainer();
//
- // if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- // StructuredClassifier newOwner = deduceContainer(reorientedEdgeView.getTarget(), newEndView);
- // if(oldOwner != newOwner) {
- // replaceOwner(getLink(), newOwner);
- // }
- // return reorientSource();
- // }
+ // if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ // StructuredClassifier newOwner = deduceContainer(reorientedEdgeView.getTarget(), newEndView);
+ // if(oldOwner != newOwner) {
+ // replaceOwner(getLink(), newOwner);
+ // }
+ // return reorientSource();
+ // }
//
- // if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- // StructuredClassifier newOwner = deduceContainer(reorientedEdgeView.getSource(), newEndView);
- // if(oldOwner != newOwner) {
- // replaceOwner(getLink(), newOwner);
- // }
- // return reorientTarget();
- // }
+ // if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ // StructuredClassifier newOwner = deduceContainer(reorientedEdgeView.getSource(), newEndView);
+ // if(oldOwner != newOwner) {
+ // replaceOwner(getLink(), newOwner);
+ // }
+ // return reorientTarget();
+ // }
//
- // throw new IllegalStateException();
- // }
+ // throw new IllegalStateException();
+ // }
//
- // protected CommandResult reorientSource() throws ExecutionException {
- // // Nothing to do here on the connector itself, the connector end remains
- // // the same but related to new Port or PartWithPort.
- // ConnectorEnd reorientedEnd = getLink().getEnds().get(0);
- // ConnectorEnd oppositeEnd = getLink().getEnds().get(1);
- // return reorientEnd(reorientedEnd, oppositeEnd, (ConnectableElement)getNewSource(), getNewPartWithPort(), getNewOppositePartWithPort());
- // }
+ // protected CommandResult reorientSource() throws ExecutionException {
+ // // Nothing to do here on the connector itself, the connector end remains
+ // // the same but related to new Port or PartWithPort.
+ // ConnectorEnd reorientedEnd = getLink().getEnds().get(0);
+ // ConnectorEnd oppositeEnd = getLink().getEnds().get(1);
+ // return reorientEnd(reorientedEnd, oppositeEnd, (ConnectableElement)getNewSource(), getNewPartWithPort(), getNewOppositePartWithPort());
+ // }
//
- // protected CommandResult reorientTarget() throws ExecutionException {
- // // Nothing to do here on the connector itself, the connector end remains
- // // the same but related to new Port or PartWithPort.
- // ConnectorEnd reorientedEnd = getLink().getEnds().get(1);
- // ConnectorEnd oppositeEnd = getLink().getEnds().get(0);
- // return reorientEnd(reorientedEnd, oppositeEnd, (ConnectableElement)getNewTarget(), getNewPartWithPort(), getNewOppositePartWithPort());
- // }
+ // protected CommandResult reorientTarget() throws ExecutionException {
+ // // Nothing to do here on the connector itself, the connector end remains
+ // // the same but related to new Port or PartWithPort.
+ // ConnectorEnd reorientedEnd = getLink().getEnds().get(1);
+ // ConnectorEnd oppositeEnd = getLink().getEnds().get(0);
+ // return reorientEnd(reorientedEnd, oppositeEnd, (ConnectableElement)getNewTarget(), getNewPartWithPort(), getNewOppositePartWithPort());
+ // }
//
- // private CommandResult reorientEnd(ConnectorEnd end, ConnectorEnd oppositeEnd, ConnectableElement role, Property partWithPort, Property oppositePartWithPort) throws ExecutionException {
- // end.setRole(role);
- // end.setPartWithPort(partWithPort);
- // oppositeEnd.setPartWithPort(oppositePartWithPort);
- // return CommandResult.newOKCommandResult();
- // }
+ // private CommandResult reorientEnd(ConnectorEnd end, ConnectorEnd oppositeEnd, ConnectableElement role, Property partWithPort, Property oppositePartWithPort) throws ExecutionException {
+ // end.setRole(role);
+ // end.setPartWithPort(partWithPort);
+ // oppositeEnd.setPartWithPort(oppositePartWithPort);
+ // return CommandResult.newOKCommandResult();
+ // }
//
//
//
- // /**
- // * Get the old {@link Connector} source.
- // *
- // * @return the previous {@link Connector} source.
- // */
- // protected Element getOldSource() {
- // return (Element)oldEnd;
- // }
+ // /**
+ // * Get the old {@link Connector} source.
+ // *
+ // * @return the previous {@link Connector} source.
+ // */
+ // protected Element getOldSource() {
+ // return (Element)oldEnd;
+ // }
//
- // /**
- // * Get the new {@link Connector} source.
- // *
- // * @return the new {@link Connector} source.
- // */
- // protected Element getNewSource() {
- // return (Element)newEnd;
- // }
+ // /**
+ // * Get the new {@link Connector} source.
+ // *
+ // * @return the new {@link Connector} source.
+ // */
+ // protected Element getNewSource() {
+ // return (Element)newEnd;
+ // }
//
- // /**
- // * Get the old {@link Connector} target.
- // *
- // * @return the previous {@link Connector} target.
- // */
- // protected Element getOldTarget() {
- // return (Element)oldEnd;
- // }
+ // /**
+ // * Get the old {@link Connector} target.
+ // *
+ // * @return the previous {@link Connector} target.
+ // */
+ // protected Element getOldTarget() {
+ // return (Element)oldEnd;
+ // }
//
- // /**
- // * Get the new {@link Connector} target.
- // *
- // * @return the new {@link Connector} target.
- // */
- // protected Element getNewTarget() {
- // return (Element)newEnd;
- // }
+ // /**
+ // * Get the new {@link Connector} target.
+ // *
+ // * @return the new {@link Connector} target.
+ // */
+ // protected Element getNewTarget() {
+ // return (Element)newEnd;
+ // }
//
/**
* Get the new {@link Connector} end graphical parent.
- *
+ *
* @return the new {@link Connector} end graphical parent.
*/
protected Element getEndParent(View endView) {
- if(endView != null) {
+ if (endView != null) {
EObject parent = ViewUtil.getContainerView(endView).getElement();
- return (parent instanceof Element) ? (Element)parent : null;
+ return (parent instanceof Element) ? (Element) parent : null;
}
return null;
}
@@ -247,19 +248,19 @@ public class ConnectorReorientCommand extends ConnectorReorientSemanticCommand {
/**
* Get the new {@link Connector} end part with port.
- *
+ *
* @return the new {@link Connector} end part with port.
*/
protected Property findNewPartWithPort() {
Property partWithPort = null;
Element newEndParent = getEndParent(this.newEndView);
- if(getNewEnd() instanceof Port) {
+ if (getNewEnd() instanceof Port) {
// Only look for PartWithPort if the role is a Port.
- if((newEndParent != null) && (newEndParent instanceof Property) && !(newEndParent instanceof Port)) {
+ if ((newEndParent != null) && (newEndParent instanceof Property) && !(newEndParent instanceof Port)) {
// Only add PartWithPort for assembly (not for delegation)
- if(!EcoreUtil.isAncestor(ViewUtil.getContainerView(this.newEndView), this.oppositeEndView)) {
- partWithPort = (Property)newEndParent;
+ if (!EcoreUtil.isAncestor(ViewUtil.getContainerView(this.newEndView), this.oppositeEndView)) {
+ partWithPort = (Property) newEndParent;
}
}
}
@@ -268,26 +269,26 @@ public class ConnectorReorientCommand extends ConnectorReorientSemanticCommand {
/**
* Get the new {@link Connector} opposite end part with port.
- *
+ *
* @return the new {@link Connector} opposite end part with port.
*/
protected Property findNewOppositePartWithPort() {
Property partWithPort = null;
Element oppositeEndParent = getEndParent(this.oppositeEndView);
- if(this.oppositeEndView != null && this.oppositeEndView.getElement() instanceof Port) {
+ if (this.oppositeEndView != null && this.oppositeEndView.getElement() instanceof Port) {
// Only look for PartWithPort if the role is a Port.
- if((oppositeEndParent != null) && (oppositeEndParent instanceof Property) && !(oppositeEndParent instanceof Port)) {
+ if ((oppositeEndParent != null) && (oppositeEndParent instanceof Property) && !(oppositeEndParent instanceof Port)) {
// Only add PartWithPort for assembly (not for delegation)
- if(!EcoreUtil.isAncestor(ViewUtil.getContainerView(this.oppositeEndView), this.newEndView)) {
- partWithPort = (Property)oppositeEndParent;
+ if (!EcoreUtil.isAncestor(ViewUtil.getContainerView(this.oppositeEndView), this.newEndView)) {
+ partWithPort = (Property) oppositeEndParent;
}
}
}
return partWithPort;
}
//
- // private StructuredClassifier deduceContainer(View source, View target) {
- // return new ConnectorUtils().deduceContainer(source, target);
- // }
+ // private StructuredClassifier deduceContainer(View source, View target) {
+ // return new ConnectorUtils().deduceContainer(source, target);
+ // }
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientSemanticCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientSemanticCommand.java
index 73f5a73ca0b..ec1896a4f30 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientSemanticCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientSemanticCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.service.types.utils.ConnectorUtils;
import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
import org.eclipse.uml2.uml.ConnectableElement;
@@ -32,9 +33,9 @@ import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.StructuredClassifier;
/**
- *
+ *
* This command manage the connector reorient at the semantic level
- *
+ *
*/
public class ConnectorReorientSemanticCommand extends EditElementCommand {
@@ -71,9 +72,9 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
super(request.getLabel(), request.getRelationship(), request);
this.reorientDirection = request.getDirection();
this.newEnd = request.getNewRelationshipEnd();
- if(getElementToEdit() instanceof Connector) {
- this.oppositeEnd = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? ((Connector)getElementToEdit()).getEnds().get(1).getRole() : ((Connector)getElementToEdit()).getEnds().get(0).getRole();
- this.oppositePartWithPort = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? ((Connector)getElementToEdit()).getEnds().get(1).getPartWithPort() : ((Connector)getElementToEdit()).getEnds().get(0).getPartWithPort();
+ if (getElementToEdit() instanceof Connector) {
+ this.oppositeEnd = (reorientDirection == ReorientRequest.REORIENT_SOURCE) ? ((Connector) getElementToEdit()).getEnds().get(1).getRole() : ((Connector) getElementToEdit()).getEnds().get(0).getRole();
+ this.oppositePartWithPort = (reorientDirection == ReorientRequest.REORIENT_SOURCE) ? ((Connector) getElementToEdit()).getEnds().get(1).getPartWithPort() : ((Connector) getElementToEdit()).getEnds().get(0).getPartWithPort();
} else {
this.oppositeEnd = null;
this.oppositePartWithPort = null;
@@ -86,9 +87,9 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
this.reorientDirection = request.getDirection();
this.newEnd = request.getNewRelationshipEnd();
- if(getElementToEdit() instanceof Connector) {
- this.oppositeEnd = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? ((Connector)getElementToEdit()).getEnds().get(1).getRole() : ((Connector)getElementToEdit()).getEnds().get(0).getRole();
- this.oppositePartWithPort = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? ((Connector)getElementToEdit()).getEnds().get(1).getPartWithPort() : ((Connector)getElementToEdit()).getEnds().get(0).getPartWithPort();
+ if (getElementToEdit() instanceof Connector) {
+ this.oppositeEnd = (reorientDirection == ReorientRequest.REORIENT_SOURCE) ? ((Connector) getElementToEdit()).getEnds().get(1).getRole() : ((Connector) getElementToEdit()).getEnds().get(0).getRole();
+ this.oppositePartWithPort = (reorientDirection == ReorientRequest.REORIENT_SOURCE) ? ((Connector) getElementToEdit()).getEnds().get(1).getPartWithPort() : ((Connector) getElementToEdit()).getEnds().get(0).getPartWithPort();
} else {
this.oppositeEnd = null;
this.oppositePartWithPort = null;
@@ -100,29 +101,30 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
* This method allows to init the fields which can't be initialized in the constructor
*/
protected void initFields() {
- this.newPartWithPort = (Property)getRequest().getParameter(ConnectorUtils.PART_WITH_PORT);
- this.oppositePartWithPort = (Property)getRequest().getParameter(ConnectorUtils.OPPOSITE_PART_WITH_PORT);
+ this.newPartWithPort = (Property) getRequest().getParameter(ConnectorUtils.PART_WITH_PORT);
+ this.oppositePartWithPort = (Property) getRequest().getParameter(ConnectorUtils.OPPOSITE_PART_WITH_PORT);
}
/**
* Get the link to re-orient.
- *
+ *
* @return the edited {@link Connector}
*/
protected Connector getLink() {
- return (Connector)getElementToEdit();
+ return (Connector) getElementToEdit();
}
/**
* Test if the command can be executed.
*/
+ @Override
public boolean canExecute() {
- if(!(getElementToEdit() instanceof Connector)) {
+ if (!(getElementToEdit() instanceof Connector)) {
return false;
}
- //TODO
- //in fact, in UML ends>2 is allowed, but it is forbidden in SysML
- if(getLink().getEnds().size() != 2) {
+ // TODO
+ // in fact, in UML ends>2 is allowed, but it is forbidden in SysML
+ if (getLink().getEnds().size() != 2) {
return false;
}
@@ -130,37 +132,37 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
}
/**
- *
+ *
* @param newRole
* @param oppositeRole
* @return
* <code>true</code> if the newRole can be used as role for connector
*/
private boolean canReorient(final EObject newRole, final EObject oppositeRole) {
- if(newRole == null) {
- return true;//we allow to reinitialize the role
+ if (newRole == null) {
+ return true;// we allow to reinitialize the role
}
- //the new role must be a connectable element
- if(!(newRole instanceof ConnectableElement)) {
+ // the new role must be a connectable element
+ if (!(newRole instanceof ConnectableElement)) {
return false;
}
- if(newRole != null && oppositeRole != null) {
- //the 2 roles must be not be equals
+ if (newRole != null && oppositeRole != null) {
+ // the 2 roles must be not be equals
/*
- if(newRole == oppositeRole) { // ALG: This is wrong for a connector connecting the same port of two different parts!
- return false;
- }
- */
+ * if(newRole == oppositeRole) { // ALG: This is wrong for a connector connecting the same port of two different parts!
+ * return false;
+ * }
+ */
- //UML Standart, p.181 : [3] The ConnectableElements attached as roles to each ConnectorEnd owned by a Connector must be roles
- //of the Classifier, that owned the Connector, or they must be ports of such roles. (p.181)
- //in SysML this rules is not applied, that's why we are testing the context of this action
- if(ConnectorUtils.applyUMLRulesForConnector(getLink())) {
- final StructuredClassifier newContainer = deduceParentConnector(getLink(), (ConnectableElement)oppositeRole, (ConnectableElement)newRole, this.oppositePartWithPort, this.newPartWithPort);
- if(ConnectorUtils.applyUMLRulesForConnector(getLink()) && !ConnectorUtils.getUMLPossibleRoles(newContainer).contains(newRole)) {
+ // UML Standart, p.181 : [3] The ConnectableElements attached as roles to each ConnectorEnd owned by a Connector must be roles
+ // of the Classifier, that owned the Connector, or they must be ports of such roles. (p.181)
+ // in SysML this rules is not applied, that's why we are testing the context of this action
+ if (ConnectorUtils.applyUMLRulesForConnector(getLink())) {
+ final StructuredClassifier newContainer = deduceParentConnector(getLink(), (ConnectableElement) oppositeRole, (ConnectableElement) newRole, this.oppositePartWithPort, this.newPartWithPort);
+ if (ConnectorUtils.applyUMLRulesForConnector(getLink()) && !ConnectorUtils.getUMLPossibleRoles(newContainer).contains(newRole)) {
return false;
}
}
@@ -170,36 +172,36 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
}
/**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
* @throws ExecutionException
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
final ConnectorEnd editedConnectorEnd;
final ConnectorEnd oppositeEnd;
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
editedConnectorEnd = getLink().getEnds().get(0);
oppositeEnd = getLink().getEnds().get(1);
- } else if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ } else if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
editedConnectorEnd = getLink().getEnds().get(1);
oppositeEnd = getLink().getEnds().get(0);
} else {
editedConnectorEnd = null;
oppositeEnd = null;
}
- if(editedConnectorEnd != null) {
- reorientEnd(editedConnectorEnd, oppositeEnd, (ConnectableElement)newEnd, newPartWithPort, oppositePartWithPort);
- if(ConnectorUtils.applyUMLRulesForConnector(getLink())) {
- final StructuredClassifier newContainer = deduceParentConnector(getLink(), (ConnectableElement)this.oppositeEnd, (ConnectableElement)this.newEnd, this.oppositePartWithPort, this.newPartWithPort);
+ if (editedConnectorEnd != null) {
+ reorientEnd(editedConnectorEnd, oppositeEnd, (ConnectableElement) newEnd, newPartWithPort, oppositePartWithPort);
+ if (ConnectorUtils.applyUMLRulesForConnector(getLink())) {
+ final StructuredClassifier newContainer = deduceParentConnector(getLink(), (ConnectableElement) this.oppositeEnd, (ConnectableElement) this.newEnd, this.oppositePartWithPort, this.newPartWithPort);
replaceOwner(getLink(), newContainer);
}
return CommandResult.newOKCommandResult();
@@ -208,10 +210,10 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
}
/**
- *
+ *
* @param end
* @param oppositeEnd
- * TODO
+ * TODO
* @param role
* @param partWithPort
* @param oppositePartWithPort
@@ -228,7 +230,7 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
/**
- *
+ *
* @param newPartWithPort
*/
public void setNewPartWithPort(final Property newPartWithPort) {
@@ -236,17 +238,17 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
}
/**
- *
+ *
* @param connector
- * the connector
+ * the connector
* @param newOwner
- * the new owner for the connector
+ * the new owner for the connector
*/
protected void replaceOwner(final Connector connector, final StructuredClassifier newOwner) {
// Change owner and Connector name (possibly already exists in new container)
- if(newOwner != connector.getOwner()) {
- if(newOwner.getOwnedConnector(connector.getName()) != null) {
- String replacementName = NamedElementHelper.getDefaultNameWithIncrementFromBase("connector", newOwner.eContents()); // //$NON-NLS-0$
+ if (newOwner != connector.getOwner()) {
+ if (newOwner.getOwnedConnector(connector.getName()) != null) {
+ String replacementName = NamedElementHelper.getDefaultNameWithIncrementFromBase("connector", newOwner.eContents()); //
connector.setName(replacementName);
}
// Replace connector owner
@@ -255,42 +257,42 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
}
/**
- *
+ *
* @param connector
- * the edited connector
+ * the edited connector
* @param role1
- * a role of this connector
+ * a role of this connector
* @param role2
- * the 2nd role for this connector
+ * the 2nd role for this connector
* @param partWithPort1
- * the part with port for the first role (could be <code>null</code>
+ * the part with port for the first role (could be <code>null</code>
* @param partWithPort2
- * the part with port for the second role (could be <code>null</code>
+ * the part with port for the second role (could be <code>null</code>
* @return
* the new parent for the connector
*/
protected StructuredClassifier deduceParentConnector(final Connector connector, final ConnectableElement role1, final ConnectableElement role2, final Property partWithPort1, final Property partWithPort2) {
final Element owner1 = role1.getOwner();
final Element owner2 = role2.getOwner();
- if(owner1 == owner2 && owner1 instanceof StructuredClassifier) {
- return (StructuredClassifier)owner1;
+ if (owner1 == owner2 && owner1 instanceof StructuredClassifier) {
+ return (StructuredClassifier) owner1;
}
- if(role1 instanceof Port && role2 instanceof Port) {
- final StructuredClassifier partOwner1 = (StructuredClassifier)partWithPort1.getOwner();
- final StructuredClassifier partOwner2 = (StructuredClassifier)partWithPort2.getOwner();
- if(partOwner2.getOwnedElements().contains(partWithPort1)) {
+ if (role1 instanceof Port && role2 instanceof Port) {
+ final StructuredClassifier partOwner1 = (StructuredClassifier) partWithPort1.getOwner();
+ final StructuredClassifier partOwner2 = (StructuredClassifier) partWithPort2.getOwner();
+ if (partOwner2.getOwnedElements().contains(partWithPort1)) {
return partOwner2;
}
return partOwner1;
}
- return (StructuredClassifier)connector.getOwner();
+ return (StructuredClassifier) connector.getOwner();
}
/**
* Setter for {@link #oppositeEnd}
- *
+ *
* @param oppositeEnd
- * the opposite end
+ * the opposite end
*/
public final void setOppositeEnd(final EObject oppositeEnd) {
this.oppositeEnd = oppositeEnd;
@@ -298,9 +300,9 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
/**
* Setter for {@link #newEnd}
- *
+ *
* @param newEnd
- * the new end
+ * the new end
*/
public final void setNewEnd(final EObject newEnd) {
this.newEnd = newEnd;
@@ -308,9 +310,9 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
/**
* Setter for {@link #oppositePartWithPort}
- *
+ *
* @param oppositePartWithPort
- * the opposite part with port
+ * the opposite part with port
*/
public final void setOppositePartWithPort(Property oppositePartWithPort) {
this.oppositePartWithPort = oppositePartWithPort;
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ControlFlowReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ControlFlowReorientCommand.java
index 49a7d777c31..8444d3f9469 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ControlFlowReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ControlFlowReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.ActivityNode;
import org.eclipse.uml2.uml.ControlFlow;
@@ -59,47 +60,49 @@ public class ControlFlowReorientCommand extends EditElementCommand {
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof ControlFlow) {
+ if (false == getElementToEdit() instanceof ControlFlow) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
}
protected boolean canReorientSource() {
- if(!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
+ if (!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
return false;
}
- if(!(getLink().eContainer() instanceof Activity)) {
+ if (!(getLink().eContainer() instanceof Activity)) {
return false;
}
return true;
}
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
+ if (!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
return false;
}
- if(!(getLink().eContainer() instanceof Activity)) {
+ if (!(getLink().eContainer() instanceof Activity)) {
return false;
}
return true;
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -116,22 +119,22 @@ public class ControlFlowReorientCommand extends EditElementCommand {
}
protected ControlFlow getLink() {
- return (ControlFlow)getElementToEdit();
+ return (ControlFlow) getElementToEdit();
}
protected ActivityNode getOldSource() {
- return (ActivityNode)oldEnd;
+ return (ActivityNode) oldEnd;
}
protected ActivityNode getNewSource() {
- return (ActivityNode)newEnd;
+ return (ActivityNode) newEnd;
}
protected ActivityNode getOldTarget() {
- return (ActivityNode)oldEnd;
+ return (ActivityNode) oldEnd;
}
protected ActivityNode getNewTarget() {
- return (ActivityNode)newEnd;
+ return (ActivityNode) newEnd;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/CreateEditBasedElementCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/CreateEditBasedElementCommand.java
index 7c3c5316b79..b7148989b8e 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/CreateEditBasedElementCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/CreateEditBasedElementCommand.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013, 2014 CEA LIST 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
@@ -42,61 +42,61 @@ import org.eclipse.papyrus.uml.service.types.Activator;
* Creation command based on the metamodel.edit framework instead of relying on the defaut GMF creation mechanism.
* <P>
* So the creation of elements is similar to the creation customized in the metamodel itself, which can be interesting for metamodels like UML. This can avoid specific code for example for Activity.createNode() list of commands.
- * </P>
+ * </P>
* <P>
* The implementation relies on a composite command that delegates first the basic creation of the element to the metamodel.edit service.<BR/>
- * A second operation computes during execution the list of additional commands to configure the newly created element. For example, the name of the new element can be set in configure commands.
- * Note: the configure command needs the newly created command, so the list of operations to perform is unknown until the composite operation is executed. The executability of the 2nd set of commands can be hard to test.
+ * A second operation computes during execution the list of additional commands to configure the newly created element. For example, the name of the new element can be set in configure commands. Note: the configure command needs the newly created command, so
+ * the list of operations to perform is unknown until the composite operation is executed. The executability of the 2nd set of commands can be hard to test.
* </P>
*/
public class CreateEditBasedElementCommand extends CreateElementCommand {
/** Shadow the base class's element-to-edit because we need direct access. */
private EObject elementToEdit;
-
+
/** newly created element */
protected EObject newElement;
-
+
/** composite operation in charge of listing and executing all performed operations */
protected CompositeEMFOperation compositeEMFOperation;
/**
* Constructor.
- *
+ *
* @param request
- * create element request creating this command
+ * create element request creating this command
*/
public CreateEditBasedElementCommand(CreateElementRequest request) {
super(request);
-
+
EObject container = request.getContainer();
- if((container != null) && container.eClass().getEAllContainments().contains(request.getContainmentFeature())) {
+ if ((container != null) && container.eClass().getEAllContainments().contains(request.getContainmentFeature())) {
setElementToEdit(container);
}
}
-
+
/**
* {@inheritDoc}
*/
@Override
protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(compositeEMFOperation !=null && compositeEMFOperation.canUndo()) {
+ if (compositeEMFOperation != null && compositeEMFOperation.canUndo()) {
return compositeEMFOperation.undo(monitor, info);
}
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "imposible to undo the command");
}
-
+
/**
* {@inheritDoc}
*/
@Override
protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(compositeEMFOperation !=null && compositeEMFOperation.canRedo()) {
+ if (compositeEMFOperation != null && compositeEMFOperation.canRedo()) {
return compositeEMFOperation.redo(monitor, info);
}
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "imposible to redo the command");
}
-
+
/**
* {@inheritDoc}
*/
@@ -105,87 +105,86 @@ public class CreateEditBasedElementCommand extends CreateElementCommand {
// The superclass implementation can short-circuit the effort of preparing the operation
return super.canExecute() && prepareOperation().canExecute();
}
-
+
/**
* {@inheritDoc}
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
IUndoableOperation operation = prepareOperation();
-
+
IStatus compositeStatus = operation.execute(monitor, info);
- return (compositeStatus == null) ?
- CommandResult.newOKCommandResult(newElement) :
- new CommandResult(compositeStatus, newElement);
+ return (compositeStatus == null) ?
+ CommandResult.newOKCommandResult(newElement) :
+ new CommandResult(compositeStatus, newElement);
}
-
+
protected IUndoableOperation prepareOperation() {
if (compositeEMFOperation == null) {
compositeEMFOperation = new CompositeEMFOperation(getEditingDomain(), "Create Element");
// creates the basic element
AbstractTransactionalCommand createTransactionalCommand = new AbstractTransactionalCommand(getEditingDomain(), "Create basic element", getAffectedFiles()) {
-
+
/** emf command */
private Command command;
-
+
@Override
public boolean canExecute() {
// Optimistically enable if the request would have to create the container, because
// we can't do that in a read-only context (when not actually executing)
return canCreateChild() && (!hasElementToEdit() || prepareCommand().canExecute());
}
-
+
/**
* {@inheritDoc}
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
Command command = prepareCommand();
-
- if(command.canExecute()) {
-
+
+ if (command.canExecute()) {
+
// create an IUndoableOperation => undo is relying on the execution of this command
command.execute();
return CommandResult.newOKCommandResult(newElement);
}
-
+
return CommandResult.newErrorCommandResult("Impossible to create Element");
}
-
+
/**
* Prepares the EMF command to which we delegate execution, if it has not already been
- * created. This is not safe to do in a read-only context if our request does not
- * {@link CreateEditBasedElementCommand#hasElementToEdit() have a container}, because
+ * created. This is not safe to do in a read-only context if our request does not {@link CreateEditBasedElementCommand#hasElementToEdit() have a container}, because
* this would attempt to create that container.
- *
+ *
* @see CreateEditBasedElementCommand#hasElementToEdit()
*/
protected Command prepareCommand() {
if (command == null) {
- // Do the default element creation
+ // Do the default element creation
EReference containment = getContainmentFeature();
EClass eClass = getElementType().getEClass();
-
- if(containment != null) {
+
+ if (containment != null) {
EObject element = getElementToEdit();
-
- if(element != null) {
-
+
+ if (element != null) {
+
newElement = eClass.getEPackage().getEFactoryInstance().create(eClass);
IEditingDomainItemProvider editingDomainItemProvider = AdapterFactoryEditingDomain.getEditingDomainItemProviderFor(element);
command = editingDomainItemProvider.createCommand(element, getEditingDomain(), CreateChildCommand.class, new CommandParameter(element, containment, new CommandParameter(null, containment, newElement)));
}
}
-
+
if (command == null) {
// Couldn't create a useful command
command = UnexecutableCommand.INSTANCE;
}
}
-
+
return command;
}
-
+
/**
* {@inheritDoc}
*/
@@ -193,7 +192,7 @@ public class CreateEditBasedElementCommand extends CreateElementCommand {
public boolean canUndo() {
return command.canUndo();
}
-
+
/**
* {@inheritDoc}
*/
@@ -202,7 +201,7 @@ public class CreateEditBasedElementCommand extends CreateElementCommand {
command.undo();
return Status.OK_STATUS;
}
-
+
/**
* {@inheritDoc}
*/
@@ -213,82 +212,83 @@ public class CreateEditBasedElementCommand extends CreateElementCommand {
}
};
compositeEMFOperation.add(createTransactionalCommand);
-
+
AbstractTransactionalCommand configureTransactionalCommand = new AbstractTransactionalCommand(getEditingDomain(), "Configure element", getAffectedFiles()) {
-
+
/**
- * {@inheritDoc}ondre
+ * {@inheritDoc}ondre
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // Configure the new element
- ConfigureRequest configureRequest = createConfigureRequest();
-
- ICommand configureCommand = getElementType().getEditCommand(configureRequest);
-
- IStatus configureStatus = null;
-
- if (configureCommand != null && configureCommand.canExecute()) {
- configureStatus = configureCommand.execute(monitor, info);
- }
-
- // Put the newly created element in the request so that the
- // 'after' commands have access to it.
- getCreateRequest().setNewElement(newElement);
-
- return (configureStatus == null) ?
- CommandResult.newOKCommandResult(newElement) :
- new CommandResult(configureStatus, newElement);
+ // Configure the new element
+ ConfigureRequest configureRequest = createConfigureRequest();
+
+ ICommand configureCommand = getElementType().getEditCommand(configureRequest);
+
+ IStatus configureStatus = null;
+
+ if (configureCommand != null && configureCommand.canExecute()) {
+ configureStatus = configureCommand.execute(monitor, info);
+ }
+
+ // Put the newly created element in the request so that the
+ // 'after' commands have access to it.
+ getCreateRequest().setNewElement(newElement);
+
+ return (configureStatus == null) ?
+ CommandResult.newOKCommandResult(newElement) :
+ new CommandResult(configureStatus, newElement);
}
};
-
- // executes the command and then adds it to the list
+
+ // executes the command and then adds it to the list
compositeEMFOperation.add(configureTransactionalCommand); // add before execution
}
-
+
return compositeEMFOperation;
}
-
+
protected boolean isPrepared() {
return compositeEMFOperation != null;
}
/**
* Creates the request to configure the new element.
- *
+ *
* @return the request
*/
+ @Override
protected ConfigureRequest createConfigureRequest() {
ConfigureRequest configureRequest = new ConfigureRequest(
- getEditingDomain(), newElement, getElementType());
-
+ getEditingDomain(), newElement, getElementType());
+
// pass along the client context
configureRequest.setClientContext(getCreateRequest().getClientContext());
-
- configureRequest.addParameters(getRequest().getParameters());
+
+ configureRequest.addParameters(getRequest().getParameters());
return configureRequest;
}
-
+
/**
* Queries whether I know my element to edit, yet.
- *
+ *
* @return whether I have an element to edit
*/
protected boolean hasElementToEdit() {
return elementToEdit != null;
}
-
+
@Override
protected void setElementToEdit(EObject element) {
this.elementToEdit = element;
super.setElementToEdit(element);
}
-
+
/**
* An enablement filter heuristically determining whether we think we will be able to create the child element.
- *
+ *
* @return whether we can create the new child element
*/
protected boolean canCreateChild() {
@@ -297,28 +297,28 @@ public class CreateEditBasedElementCommand extends CreateElementCommand {
// This is an additional constraint in the EMF CreateChildCommand that we use, that the GMF CreateElementCommand doesn't apply
Object context = getRequest().getEditHelperContext();
- if(context instanceof EObject) {
- EObject owner = (EObject)context;
+ if (context instanceof EObject) {
+ EObject owner = (EObject) context;
EReference reference = getContainmentFeature();
-
+
// The context may not have this reference if some intermediate container is to be created by the edit-helper.
// But, then, we can only optimistically report that we can create the child
- if((reference != null) && !reference.isMany() && (owner.eClass().getEAllReferences().contains(reference))) {
+ if ((reference != null) && !reference.isMany() && (owner.eClass().getEAllReferences().contains(reference))) {
// Don't replace an existing value
- result = ((EObject)context).eGet(reference) == null;
+ result = ((EObject) context).eGet(reference) == null;
}
}
return result;
}
-
+
@Override
public void dispose() {
- if(isPrepared()) {
+ if (isPrepared()) {
compositeEMFOperation.dispose();
compositeEMFOperation = null;
}
-
+
super.dispose();
}
} \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/DependencyReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/DependencyReorientCommand.java
index 05a137eac6f..5c1d872004d 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/DependencyReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/DependencyReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.uml2.uml.Dependency;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Package;
@@ -59,47 +60,49 @@ public class DependencyReorientCommand extends EditElementCommand {
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Dependency) {
+ if (false == getElementToEdit() instanceof Dependency) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
}
protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
+ if (!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
return false;
}
- if(!(getLink().eContainer() instanceof Package)) {
+ if (!(getLink().eContainer() instanceof Package)) {
return false;
}
return true;
}
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
+ if (!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
return false;
}
- if(!(getLink().eContainer() instanceof Package)) {
+ if (!(getLink().eContainer() instanceof Package)) {
return false;
}
return true;
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -118,22 +121,22 @@ public class DependencyReorientCommand extends EditElementCommand {
}
protected Dependency getLink() {
- return (Dependency)getElementToEdit();
+ return (Dependency) getElementToEdit();
}
protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
+ return (NamedElement) oldEnd;
}
protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
+ return (NamedElement) newEnd;
}
protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
+ return (NamedElement) oldEnd;
}
protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
+ return (NamedElement) newEnd;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ExceptionHandlerReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ExceptionHandlerReorientCommand.java
index 9dd138508b2..4732707bdab 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ExceptionHandlerReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ExceptionHandlerReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.uml2.uml.ExceptionHandler;
import org.eclipse.uml2.uml.ExecutableNode;
import org.eclipse.uml2.uml.ObjectNode;
@@ -59,47 +60,49 @@ public class ExceptionHandlerReorientCommand extends EditElementCommand {
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof ExceptionHandler) {
+ if (false == getElementToEdit() instanceof ExceptionHandler) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
}
protected boolean canReorientSource() {
- if(!(oldEnd instanceof ExecutableNode && newEnd instanceof ExecutableNode)) {
+ if (!(oldEnd instanceof ExecutableNode && newEnd instanceof ExecutableNode)) {
return false;
}
- if(!(getLink().eContainer() instanceof ExecutableNode)) {
+ if (!(getLink().eContainer() instanceof ExecutableNode)) {
return false;
}
return true;
}
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof ObjectNode && newEnd instanceof ObjectNode)) {
+ if (!(oldEnd instanceof ObjectNode && newEnd instanceof ObjectNode)) {
return false;
}
- if(!(getLink().eContainer() instanceof ExecutableNode)) {
+ if (!(getLink().eContainer() instanceof ExecutableNode)) {
return false;
}
return true;
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -116,22 +119,22 @@ public class ExceptionHandlerReorientCommand extends EditElementCommand {
}
protected ExceptionHandler getLink() {
- return (ExceptionHandler)getElementToEdit();
+ return (ExceptionHandler) getElementToEdit();
}
protected ExecutableNode getOldSource() {
- return (ExecutableNode)oldEnd;
+ return (ExecutableNode) oldEnd;
}
protected ExecutableNode getNewSource() {
- return (ExecutableNode)newEnd;
+ return (ExecutableNode) newEnd;
}
protected ObjectNode getOldTarget() {
- return (ObjectNode)oldEnd;
+ return (ObjectNode) oldEnd;
}
protected ObjectNode getNewTarget() {
- return (ObjectNode)newEnd;
+ return (ObjectNode) newEnd;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ExtendReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ExtendReorientCommand.java
index f264ec81b3e..5ee7b98a36e 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ExtendReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ExtendReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.uml2.uml.Extend;
import org.eclipse.uml2.uml.UseCase;
@@ -58,47 +59,49 @@ public class ExtendReorientCommand extends EditElementCommand {
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Extend) {
+ if (false == getElementToEdit() instanceof Extend) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
}
protected boolean canReorientSource() {
- if(!(oldEnd instanceof UseCase && newEnd instanceof UseCase)) {
+ if (!(oldEnd instanceof UseCase && newEnd instanceof UseCase)) {
return false;
}
- if(!(getLink().eContainer() instanceof UseCase)) {
+ if (!(getLink().eContainer() instanceof UseCase)) {
return false;
}
return true;
}
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof UseCase && newEnd instanceof UseCase)) {
+ if (!(oldEnd instanceof UseCase && newEnd instanceof UseCase)) {
return false;
}
- if(!(getLink().eContainer() instanceof UseCase)) {
+ if (!(getLink().eContainer() instanceof UseCase)) {
return false;
}
return true;
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -115,22 +118,22 @@ public class ExtendReorientCommand extends EditElementCommand {
}
protected Extend getLink() {
- return (Extend)getElementToEdit();
+ return (Extend) getElementToEdit();
}
protected UseCase getOldSource() {
- return (UseCase)oldEnd;
+ return (UseCase) oldEnd;
}
protected UseCase getNewSource() {
- return (UseCase)newEnd;
+ return (UseCase) newEnd;
}
protected UseCase getOldTarget() {
- return (UseCase)oldEnd;
+ return (UseCase) oldEnd;
}
protected UseCase getNewTarget() {
- return (UseCase)newEnd;
+ return (UseCase) newEnd;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/GeneralizationReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/GeneralizationReorientCommand.java
index 12a79d51be9..6a0e532f398 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/GeneralizationReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/GeneralizationReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.uml2.uml.Classifier;
import org.eclipse.uml2.uml.Generalization;
@@ -28,7 +29,7 @@ import org.eclipse.uml2.uml.Generalization;
* This re-orient command is adapted from re-orient command generated
* for {@link Generalization} in the Composite Structure Diagram.
* </pre>
- *
+ *
* @generated
*/
public class GeneralizationReorientCommand extends EditElementCommand {
@@ -61,17 +62,18 @@ public class GeneralizationReorientCommand extends EditElementCommand {
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(!(getElementToEdit() instanceof Generalization)) {
+ if (!(getElementToEdit() instanceof Generalization)) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
-
+
return false;
}
@@ -79,16 +81,16 @@ public class GeneralizationReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientSource() {
-
- if(!(newEnd instanceof Classifier)) {
+
+ if (!(newEnd instanceof Classifier)) {
return false;
}
-
+
if (newEnd == getLink().getGeneral()) {
return false;
}
-
- if(!(getLink().eContainer() instanceof Classifier)) {
+
+ if (!(getLink().eContainer() instanceof Classifier)) {
return false;
}
return true;
@@ -98,33 +100,34 @@ public class GeneralizationReorientCommand extends EditElementCommand {
* @generated
*/
protected boolean canReorientTarget() {
-
- if(!(newEnd instanceof Classifier)) {
+
+ if (!(newEnd instanceof Classifier)) {
return false;
}
-
+
if (newEnd == getLink().getSpecific()) {
return false;
}
-
- if(!(getLink().eContainer() instanceof Classifier)) {
+
+ if (!(getLink().eContainer() instanceof Classifier)) {
return false;
}
-
+
return true;
}
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -150,34 +153,34 @@ public class GeneralizationReorientCommand extends EditElementCommand {
* @generated
*/
protected Generalization getLink() {
- return (Generalization)getElementToEdit();
+ return (Generalization) getElementToEdit();
}
/**
* @generated
*/
protected Classifier getOldSource() {
- return (Classifier)oldEnd;
+ return (Classifier) oldEnd;
}
/**
* @generated
*/
protected Classifier getNewSource() {
- return (Classifier)newEnd;
+ return (Classifier) newEnd;
}
/**
* @generated
*/
protected Classifier getOldTarget() {
- return (Classifier)oldEnd;
+ return (Classifier) oldEnd;
}
/**
* @generated
*/
protected Classifier getNewTarget() {
- return (Classifier)newEnd;
+ return (Classifier) newEnd;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/IncludeReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/IncludeReorientCommand.java
index 89a22851de9..9d901645587 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/IncludeReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/IncludeReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.uml2.uml.Include;
import org.eclipse.uml2.uml.UseCase;
@@ -58,47 +59,49 @@ public class IncludeReorientCommand extends EditElementCommand {
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Include) {
+ if (false == getElementToEdit() instanceof Include) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
}
protected boolean canReorientSource() {
- if(!(oldEnd instanceof UseCase && newEnd instanceof UseCase)) {
+ if (!(oldEnd instanceof UseCase && newEnd instanceof UseCase)) {
return false;
}
- if(!(getLink().eContainer() instanceof UseCase)) {
+ if (!(getLink().eContainer() instanceof UseCase)) {
return false;
}
return true;
}
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof UseCase && newEnd instanceof UseCase)) {
+ if (!(oldEnd instanceof UseCase && newEnd instanceof UseCase)) {
return false;
}
- if(!(getLink().eContainer() instanceof UseCase)) {
+ if (!(getLink().eContainer() instanceof UseCase)) {
return false;
}
return true;
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -115,22 +118,22 @@ public class IncludeReorientCommand extends EditElementCommand {
}
protected Include getLink() {
- return (Include)getElementToEdit();
+ return (Include) getElementToEdit();
}
protected UseCase getOldSource() {
- return (UseCase)oldEnd;
+ return (UseCase) oldEnd;
}
protected UseCase getNewSource() {
- return (UseCase)newEnd;
+ return (UseCase) newEnd;
}
protected UseCase getOldTarget() {
- return (UseCase)oldEnd;
+ return (UseCase) oldEnd;
}
protected UseCase getNewTarget() {
- return (UseCase)newEnd;
+ return (UseCase) newEnd;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InformationFlowReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InformationFlowReorientCommand.java
index e6cd746f9de..98521b4dabe 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InformationFlowReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InformationFlowReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.uml2.uml.InformationFlow;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Package;
@@ -59,47 +60,49 @@ public class InformationFlowReorientCommand extends EditElementCommand {
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof InformationFlow) {
+ if (false == getElementToEdit() instanceof InformationFlow) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
}
protected boolean canReorientSource() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
+ if (!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
return false;
}
- if(!(getLink().eContainer() instanceof Package)) {
+ if (!(getLink().eContainer() instanceof Package)) {
return false;
}
return true;
}
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
+ if (!(oldEnd instanceof NamedElement && newEnd instanceof NamedElement)) {
return false;
}
- if(!(getLink().eContainer() instanceof Package)) {
+ if (!(getLink().eContainer() instanceof Package)) {
return false;
}
return true;
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -116,22 +119,22 @@ public class InformationFlowReorientCommand extends EditElementCommand {
}
protected InformationFlow getLink() {
- return (InformationFlow)getElementToEdit();
+ return (InformationFlow) getElementToEdit();
}
protected NamedElement getOldSource() {
- return (NamedElement)oldEnd;
+ return (NamedElement) oldEnd;
}
protected NamedElement getNewSource() {
- return (NamedElement)newEnd;
+ return (NamedElement) newEnd;
}
protected NamedElement getOldTarget() {
- return (NamedElement)oldEnd;
+ return (NamedElement) oldEnd;
}
protected NamedElement getNewTarget() {
- return (NamedElement)newEnd;
+ return (NamedElement) newEnd;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InterfaceRealizationReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InterfaceRealizationReorientCommand.java
index 7c95278eb08..2bd0a332ebd 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InterfaceRealizationReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/InterfaceRealizationReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -44,32 +44,36 @@ public class InterfaceRealizationReorientCommand extends DependencyReorientComma
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(! (getElementToEdit() instanceof InterfaceRealization)) {
+ if (!(getElementToEdit() instanceof InterfaceRealization)) {
return false;
}
-
+
return super.canExecute();
}
+ @Override
protected boolean canReorientSource() {
- if(!(newEnd instanceof BehavioredClassifier)) {
+ if (!(newEnd instanceof BehavioredClassifier)) {
return false;
}
return true;
}
+ @Override
protected boolean canReorientTarget() {
- if(!(newEnd instanceof Interface)) {
+ if (!(newEnd instanceof Interface)) {
return false;
}
return true;
}
+ @Override
protected InterfaceRealization getLink() {
- return (InterfaceRealization)getElementToEdit();
+ return (InterfaceRealization) getElementToEdit();
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageAbstractReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageAbstractReorientCommand.java
index ea00cabc888..df9c2329f73 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageAbstractReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageAbstractReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.ExecutionSpecification;
import org.eclipse.uml2.uml.Gate;
@@ -35,7 +36,7 @@ import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
* This re-orient command is adapted from re-orient command generated
* for {@link Message} in the Communication Diagram.
* </pre>
- *
+ *
* @generated
*/
public abstract class MessageAbstractReorientCommand extends EditElementCommand {
@@ -68,14 +69,15 @@ public abstract class MessageAbstractReorientCommand extends EditElementCommand
/**
* @generated
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof Message) {
+ if (false == getElementToEdit() instanceof Message) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
@@ -86,34 +88,34 @@ public abstract class MessageAbstractReorientCommand extends EditElementCommand
* This method test if the Message can be re-oriented to a new source.
* It is assumed here that the possible (graphical) element used as Message source
* is either a {@link Lifeline} or an {@link InteractionFragment}.
- * It is also assumed that a re-orient that would require the {@link MessageEnd} to be
+ * It is also assumed that a re-orient that would require the {@link MessageEnd} to be
* converted from {@link Gate} to {@link MessageOccurrenceSpecification} (or the contrary)
* is not allowed.
* </pre>
- *
+ *
* @return true if the link end can be re-oriented to a new source
*/
protected boolean canReorientSource() {
// Verify possible type of new source
- if(!((getNewSource() instanceof InteractionFragment) || (getNewSource() instanceof Lifeline))) {
+ if (!((getNewSource() instanceof InteractionFragment) || (getNewSource() instanceof Lifeline))) {
return false;
}
// Avoid re-orient from Gate to MOS source (not currently supported)
- if(getLink().getSendEvent() instanceof Gate) {
- if((getNewSource() instanceof Lifeline) || (getNewSource() instanceof ExecutionSpecification)) {
+ if (getLink().getSendEvent() instanceof Gate) {
+ if ((getNewSource() instanceof Lifeline) || (getNewSource() instanceof ExecutionSpecification)) {
return false;
}
}
// Avoid re-orient from MOS to Gate source (not currently supported)
- if(getLink().getSendEvent() instanceof MessageOccurrenceSpecification) {
- if(!(getNewSource() instanceof Lifeline) && !(getNewSource() instanceof ExecutionSpecification)) {
+ if (getLink().getSendEvent() instanceof MessageOccurrenceSpecification) {
+ if (!(getNewSource() instanceof Lifeline) && !(getNewSource() instanceof ExecutionSpecification)) {
return false;
}
}
// Ensure the message owner is an interaction
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
@@ -125,35 +127,35 @@ public abstract class MessageAbstractReorientCommand extends EditElementCommand
* This method test if the Message can be re-oriented to a new target.
* It is assumed here that the possible (graphical) element used as Message target
* is either a {@link Lifeline} or an {@link InteractionFragment}.
- * It is also assumed that a re-orient that would require the {@link MessageEnd} to be
+ * It is also assumed that a re-orient that would require the {@link MessageEnd} to be
* converted from {@link Gate} to {@link MessageOccurrenceSpecification} (or the contrary)
* is not allowed.
* </pre>
- *
+ *
* @return true if the link end can be re-oriented to a new target
*/
protected boolean canReorientTarget() {
// Verify possible type of new target
- if(!((getNewTarget() instanceof InteractionFragment) || (getNewTarget() instanceof Lifeline))) {
+ if (!((getNewTarget() instanceof InteractionFragment) || (getNewTarget() instanceof Lifeline))) {
return false;
}
// Avoid re-orient from Gate to MOS target (not currently supported)
- if(getLink().getReceiveEvent() instanceof Gate) {
- if((getNewTarget() instanceof Lifeline) || (getNewTarget() instanceof ExecutionSpecification)) {
+ if (getLink().getReceiveEvent() instanceof Gate) {
+ if ((getNewTarget() instanceof Lifeline) || (getNewTarget() instanceof ExecutionSpecification)) {
return false;
}
}
// Avoid re-orient from MOS to Gate target (not currently supported)
- if(getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification) {
- if(!(getNewTarget() instanceof Lifeline) && !(getNewTarget() instanceof ExecutionSpecification)) {
+ if (getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification) {
+ if (!(getNewTarget() instanceof Lifeline) && !(getNewTarget() instanceof ExecutionSpecification)) {
return false;
}
}
// Ensure the message owner is an interaction
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
@@ -163,14 +165,15 @@ public abstract class MessageAbstractReorientCommand extends EditElementCommand
/**
* @generated
*/
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -198,34 +201,34 @@ public abstract class MessageAbstractReorientCommand extends EditElementCommand
* @generated
*/
protected Message getLink() {
- return (Message)getElementToEdit();
+ return (Message) getElementToEdit();
}
/**
* @generated
*/
protected Element getOldSource() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewSource() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
/**
* @generated
*/
protected Element getOldTarget() {
- return (Element)oldEnd;
+ return (Element) oldEnd;
}
/**
* @generated
*/
protected Element getNewTarget() {
- return (Element)newEnd;
+ return (Element) newEnd;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageAsyncReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageAsyncReorientCommand.java
index 0bf8ac69468..107f4f53efe 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageAsyncReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageAsyncReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -18,15 +18,15 @@ import org.eclipse.uml2.uml.Message;
/**
* Basic re-orient command for Asynchronous {@link Message}.
- *
+ *
*/
public class MessageAsyncReorientCommand extends MessageAbstractReorientCommand {
/**
* Constructor.
- *
+ *
* @param request
- * the re-orient request
+ * the re-orient request
*/
public MessageAsyncReorientCommand(ReorientRelationshipRequest request) {
super(request);
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageCreateReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageCreateReorientCommand.java
index 33d93e8597b..6765c8749d9 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageCreateReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageCreateReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -20,9 +20,9 @@ public class MessageCreateReorientCommand extends MessageAbstractReorientCommand
/**
* Constructor.
- *
+ *
* @param request
- * the re-orient request
+ * the re-orient request
*/
public MessageCreateReorientCommand(ReorientRelationshipRequest request) {
super(request);
@@ -32,15 +32,15 @@ public class MessageCreateReorientCommand extends MessageAbstractReorientCommand
* <pre>
* Ensure the target is a {@link Lifeline}.
* </pre>
- *
+ *
* @see org.eclipse.papyrus.uml.service.types.command.MessageAbstractReorientCommand#canReorientTarget()
- *
+ *
* @return true if the link end can be re-oriented to a new target
*/
@Override
protected boolean canReorientTarget() {
// Verify possible type of new target
- if(!(getNewTarget() instanceof Lifeline)) {
+ if (!(getNewTarget() instanceof Lifeline)) {
return false;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageDeleteReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageDeleteReorientCommand.java
index 5b9292f0815..05709415400 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageDeleteReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageDeleteReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -21,9 +21,9 @@ public class MessageDeleteReorientCommand extends MessageAbstractReorientCommand
/**
* Constructor.
- *
+ *
* @param request
- * the re-orient request
+ * the re-orient request
*/
public MessageDeleteReorientCommand(ReorientRelationshipRequest request) {
super(request);
@@ -33,21 +33,21 @@ public class MessageDeleteReorientCommand extends MessageAbstractReorientCommand
* <pre>
* Ensure the target is either a {@link Lifeline} or a {@link DestructionEvent}.
* </pre>
- *
+ *
* @see org.eclipse.papyrus.uml.service.types.command.MessageAbstractReorientCommand#canReorientTarget()
- *
+ *
* @return true if the link end can be re-oriented to a new target
*/
@Override
protected boolean canReorientTarget() {
-//FIXME : change for UML 2.4
-// // Verify possible type of new target
-// if(!((getNewTarget() instanceof DestructionEvent) || (getNewTarget() instanceof Lifeline))) {
-// return false;
-// }
+ // FIXME : change for UML 2.4
+ // // Verify possible type of new target
+ // if(!((getNewTarget() instanceof DestructionEvent) || (getNewTarget() instanceof Lifeline))) {
+ // return false;
+ // }
// Ensure the message owner is an interaction
- if(!(getLink().eContainer() instanceof Interaction)) {
+ if (!(getLink().eContainer() instanceof Interaction)) {
return false;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageFoundReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageFoundReorientCommand.java
index a84e93e5613..1ea29a5f553 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageFoundReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageFoundReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -19,18 +19,18 @@ public class MessageFoundReorientCommand extends MessageAbstractReorientCommand
/**
* Constructor.
- *
+ *
* @param request
- * the re-orient request
+ * the re-orient request
*/
public MessageFoundReorientCommand(ReorientRelationshipRequest request) {
super(request);
}
/**
- *
+ *
* @see org.eclipse.papyrus.uml.service.types.command.MessageAbstractReorientCommand#canReorientSource()
- *
+ *
* @return false (re-orient source not allowed)
*/
@Override
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageLostReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageLostReorientCommand.java
index f18079ff4db..de79c4282e7 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageLostReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageLostReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -19,18 +19,18 @@ public class MessageLostReorientCommand extends MessageAbstractReorientCommand {
/**
* Constructor.
- *
+ *
* @param request
- * the re-orient request
+ * the re-orient request
*/
public MessageLostReorientCommand(ReorientRelationshipRequest request) {
super(request);
}
/**
- *
+ *
* @see org.eclipse.papyrus.uml.service.types.command.MessageAbstractReorientCommand#canReorientTarget()
- *
+ *
* @return false (re-orient target not allowed)
*/
@Override
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageReplyReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageReplyReorientCommand.java
index 8b1f3fef722..53f4577d6d0 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageReplyReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageReplyReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -19,9 +19,9 @@ public class MessageReplyReorientCommand extends MessageAbstractReorientCommand
/**
* Constructor.
- *
+ *
* @param request
- * the re-orient request
+ * the re-orient request
*/
public MessageReplyReorientCommand(ReorientRelationshipRequest request) {
super(request);
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageSyncReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageSyncReorientCommand.java
index af8474f18cf..2fecbb14f04 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageSyncReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/MessageSyncReorientCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -19,9 +19,9 @@ public class MessageSyncReorientCommand extends MessageAbstractReorientCommand {
/**
* Constructor.
- *
+ *
* @param request
- * the re-orient request
+ * the re-orient request
*/
public MessageSyncReorientCommand(ReorientRelationshipRequest request) {
super(request);
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/NotContainmentMoveCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/NotContainmentMoveCommand.java
index 951f5ee50f9..66850dd89d0 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/NotContainmentMoveCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/NotContainmentMoveCommand.java
@@ -10,64 +10,61 @@ import org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
/**
- * This command handles the move of the elements from the graphical containers different from
- * semantic containers. Examples are {@link ActivityPartition} or
- * {@link InterruptibleActivityRegion} which both graphically contains nodes semantically
+ * This command handles the move of the elements from the graphical containers different from
+ * semantic containers. Examples are {@link ActivityPartition} or {@link InterruptibleActivityRegion} which both graphically contains nodes semantically
* contained in {@link Activity}.
* <p/>
- * Standard {@link MoveElementsCommand} does not work for these cases because it moves children
- * only from one semantic container to another.
+ * Standard {@link MoveElementsCommand} does not work for these cases because it moves children only from one semantic container to another.
* <p/>
- * So the main purpose of this command is to override useless check of different source and target
- * semantic containers in {@link #canExecute()} method.
+ * So the main purpose of this command is to override useless check of different source and target semantic containers in {@link #canExecute()} method.
*/
public class NotContainmentMoveCommand extends MoveElementsCommand {
/**
* Default constructor
+ *
* @param request
*/
public NotContainmentMoveCommand(MoveRequest request) {
super(request);
}
-
+
/**
* For ability to move children from one container to this same container
- * we need to remove this check from base canExecute command
- * <code>
- * if (container.equals(element.eContainer())
- * && feature == element.eContainmentFeature()) {
- * // Don't allow the reparenting
- * return false;
- * }
- * </code>
+ * we need to remove this check from base canExecute command <code>
+ * if (container.equals(element.eContainer())
+ * && feature == element.eContainmentFeature()) {
+ * // Don't allow the reparenting
+ * return false;
+ * }
+ * </code>
*/
@Override
public boolean canExecute() {
EObject container = getTargetContainer();
- if(container == null || getElementsToMove() == null || getElementsToMove().isEmpty()) {
+ if (container == null || getElementsToMove() == null || getElementsToMove().isEmpty()) {
return false;
}
- for(Iterator i = getElementsToMove().keySet().iterator(); i.hasNext();) {
- EObject element = (EObject)i.next();
+ for (Iterator i = getElementsToMove().keySet().iterator(); i.hasNext();) {
+ EObject element = (EObject) i.next();
EReference feature = getTargetFeature(element);
- if(feature == null || !container.eClass().getEAllReferences().contains(feature)) {
+ if (feature == null || !container.eClass().getEAllReferences().contains(feature)) {
// If the target feature doesn't exist in the target container,
// don't allow the move.
return false;
}
// IF the element is the parent of the target container...
- if(EcoreUtil.isAncestor(element, getTargetContainer())) {
+ if (EcoreUtil.isAncestor(element, getTargetContainer())) {
// Don't allow the reparenting
return false;
}
// IF the container can not contain the element...
- if(!PackageUtil.canContain(getTargetContainer().eClass(), feature, element.eClass(), false)) {
+ if (!PackageUtil.canContain(getTargetContainer().eClass(), feature, element.eClass(), false)) {
// Don't allow the reparenting
return false;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ObjectFlowReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ObjectFlowReorientCommand.java
index 638ee4d20d0..f67817c6b96 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ObjectFlowReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ObjectFlowReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.uml.tools.utils.ObjectFlowUtil;
import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.ActivityNode;
@@ -61,47 +62,49 @@ public class ObjectFlowReorientCommand extends EditElementCommand {
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof ControlFlow) {
+ if (false == getElementToEdit() instanceof ControlFlow) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
}
protected boolean canReorientSource() {
- if(!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
+ if (!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
return false;
}
- if(!(getLink().eContainer() instanceof Activity)) {
+ if (!(getLink().eContainer() instanceof Activity)) {
return false;
}
- return ObjectFlowUtil.canExistObjectFlow((Activity)getLink().eContainer(), getLink(), getNewSource(), getLink().getTarget());
+ return ObjectFlowUtil.canExistObjectFlow((Activity) getLink().eContainer(), getLink(), getNewSource(), getLink().getTarget());
}
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
+ if (!(oldEnd instanceof ActivityNode && newEnd instanceof ActivityNode)) {
return false;
}
- if(!(getLink().eContainer() instanceof Activity)) {
+ if (!(getLink().eContainer() instanceof Activity)) {
return false;
}
- return ObjectFlowUtil.canExistObjectFlow((Activity)getLink().eContainer(), getLink(), getLink().getSource(), getNewTarget());
+ return ObjectFlowUtil.canExistObjectFlow((Activity) getLink().eContainer(), getLink(), getLink().getSource(), getNewTarget());
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -118,23 +121,23 @@ public class ObjectFlowReorientCommand extends EditElementCommand {
}
protected ObjectFlow getLink() {
- return (ObjectFlow)getElementToEdit();
+ return (ObjectFlow) getElementToEdit();
}
protected ActivityNode getOldSource() {
- return (ActivityNode)oldEnd;
+ return (ActivityNode) oldEnd;
}
protected ActivityNode getNewSource() {
- return (ActivityNode)newEnd;
+ return (ActivityNode) newEnd;
}
protected ActivityNode getOldTarget() {
- return (ActivityNode)oldEnd;
+ return (ActivityNode) oldEnd;
}
protected ActivityNode getNewTarget() {
- return (ActivityNode)newEnd;
+ return (ActivityNode) newEnd;
}
-
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ProtocolConformanceReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ProtocolConformanceReorientCommand.java
index 08f708c8680..4c5f36f8d49 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ProtocolConformanceReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ProtocolConformanceReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.uml2.uml.ProtocolConformance;
import org.eclipse.uml2.uml.ProtocolStateMachine;
@@ -58,47 +59,49 @@ public class ProtocolConformanceReorientCommand extends EditElementCommand {
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(false == getElementToEdit() instanceof ProtocolConformance) {
+ if (false == getElementToEdit() instanceof ProtocolConformance) {
return false;
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return canReorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return canReorientTarget();
}
return false;
}
protected boolean canReorientSource() {
- if(!(oldEnd instanceof ProtocolStateMachine && newEnd instanceof ProtocolStateMachine)) {
+ if (!(oldEnd instanceof ProtocolStateMachine && newEnd instanceof ProtocolStateMachine)) {
return false;
}
- if(!(getLink().eContainer() instanceof ProtocolStateMachine)) {
+ if (!(getLink().eContainer() instanceof ProtocolStateMachine)) {
return false;
}
return true;
}
protected boolean canReorientTarget() {
- if(!(oldEnd instanceof ProtocolStateMachine && newEnd instanceof ProtocolStateMachine)) {
+ if (!(oldEnd instanceof ProtocolStateMachine && newEnd instanceof ProtocolStateMachine)) {
return false;
}
- if(!(getLink().eContainer() instanceof ProtocolStateMachine)) {
+ if (!(getLink().eContainer() instanceof ProtocolStateMachine)) {
return false;
}
return true;
}
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
+ if (!canExecute()) {
throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
return reorientSource();
}
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
return reorientTarget();
}
throw new IllegalStateException();
@@ -115,22 +118,22 @@ public class ProtocolConformanceReorientCommand extends EditElementCommand {
}
protected ProtocolConformance getLink() {
- return (ProtocolConformance)getElementToEdit();
+ return (ProtocolConformance) getElementToEdit();
}
protected ProtocolStateMachine getOldSource() {
- return (ProtocolStateMachine)oldEnd;
+ return (ProtocolStateMachine) oldEnd;
}
protected ProtocolStateMachine getNewSource() {
- return (ProtocolStateMachine)newEnd;
+ return (ProtocolStateMachine) newEnd;
}
protected ProtocolStateMachine getOldTarget() {
- return (ProtocolStateMachine)oldEnd;
+ return (ProtocolStateMachine) oldEnd;
}
protected ProtocolStateMachine getNewTarget() {
- return (ProtocolStateMachine)newEnd;
+ return (ProtocolStateMachine) newEnd;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/SubstitutionReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/SubstitutionReorientCommand.java
index 604edf2e2d2..593a3ae0f23 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/SubstitutionReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/SubstitutionReorientCommand.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -43,40 +43,44 @@ public class SubstitutionReorientCommand extends DependencyReorientCommand {
* @return true if the command is executable.
* </pre>
*/
+ @Override
public boolean canExecute() {
- if(! (getElementToEdit() instanceof Substitution)) {
+ if (!(getElementToEdit() instanceof Substitution)) {
return false;
}
-
+
return super.canExecute();
}
+ @Override
protected boolean canReorientSource() {
- if(!(newEnd instanceof Classifier)) {
+ if (!(newEnd instanceof Classifier)) {
return false;
}
if (newEnd == getLink().getContract()) {
return false;
}
-
+
return true;
}
+ @Override
protected boolean canReorientTarget() {
- if(!(newEnd instanceof Classifier)) {
+ if (!(newEnd instanceof Classifier)) {
return false;
}
if (newEnd == getLink().getSubstitutingClassifier()) {
return false;
}
-
+
return true;
}
+ @Override
protected Substitution getLink() {
- return (Substitution)getElementToEdit();
+ return (Substitution) getElementToEdit();
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/UnapplyAllStereotypesCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/UnapplyAllStereotypesCommand.java
index 577ce39896e..909f580d753 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/UnapplyAllStereotypesCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/UnapplyAllStereotypesCommand.java
@@ -30,7 +30,7 @@ public class UnapplyAllStereotypesCommand extends CompositeCommand {
public UnapplyAllStereotypesCommand(TransactionalEditingDomain domain, String label, Element element) {
super(label);
List<EObject> stereotypeApplications = element.getStereotypeApplications();
- for (ListIterator<EObject> it = stereotypeApplications.listIterator(stereotypeApplications.size()); it.hasPrevious(); ) {
+ for (ListIterator<EObject> it = stereotypeApplications.listIterator(stereotypeApplications.size()); it.hasPrevious();) {
EObject stereotypeApplication = it.previous();
DestroyElementRequest stereoReq = new DestroyElementRequest(domain, stereotypeApplication, false);
add(new DestroyElementPapyrusCommand(stereoReq));
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractCommandHandler.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractCommandHandler.java
index 1363b6e765e..2155a950bef 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractCommandHandler.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractCommandHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,25 +24,25 @@ import org.eclipse.papyrus.uml.service.types.utils.ICommandContext;
/**
* <pre>
- *
+ *
* This abstract command handler manages:
* - current selection in order to build a list of the selected {@link EObject}
* - execute the command (returned by children) in Papyrus {@link TransactionalEditingDomain}
* - calculate the command enablement and visibility regarding the command executability
* (the command is now shown in menu if not executable).
- *
+ *
* </pre>
*/
public abstract class AbstractCommandHandler extends AbstractHandler {
/**
* <pre>
- *
- * Returns the command to execute (to be implemented
+ *
+ * Returns the command to execute (to be implemented
* in children implementing this class)
*
* @return the command to execute
- *
+ *
* </pre>
*/
protected abstract Command getCommand();
@@ -57,9 +57,9 @@ public abstract class AbstractCommandHandler extends AbstractHandler {
protected abstract ICommandContext getCommandContext();
/**
- *
+ *
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- *
+ *
* @param event
* @return null
* @throws ExecutionException
@@ -71,9 +71,9 @@ public abstract class AbstractCommandHandler extends AbstractHandler {
}
/**
- *
+ *
* @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
- *
+ *
* @param evaluationContext
*/
@Override
@@ -84,7 +84,7 @@ public abstract class AbstractCommandHandler extends AbstractHandler {
}
/**
- *
+ *
* @return true (visible) when the command can be executed.
*/
public boolean isVisible() {
@@ -92,13 +92,13 @@ public abstract class AbstractCommandHandler extends AbstractHandler {
}
/**
- *
+ *
* @return
* the editing domain to use
*/
protected TransactionalEditingDomain getEditingDomain() {
ICommandContext cmdContext = getCommandContext();
- if(cmdContext != null) {
+ if (cmdContext != null) {
try {
return ServiceUtilsForEObject.getInstance().getTransactionalEditingDomain(cmdContext.getContainer());
} catch (ServiceException e) {
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractCreateCommandHandler.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractCreateCommandHandler.java
index 5d2ec1a8a89..09e29720d0c 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractCreateCommandHandler.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractCreateCommandHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013, 2014 CEA LIST 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
@@ -9,7 +9,7 @@
* Contributors:
* Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 431109
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.service.types.handlers;
@@ -32,7 +32,7 @@ import org.eclipse.ui.IWorkbenchPart;
/**
* Abstract handler for commands regarding creation of elements
- *
+ *
*/
public abstract class AbstractCreateCommandHandler extends AbstractCommandHandler {
@@ -45,30 +45,30 @@ public abstract class AbstractCreateCommandHandler extends AbstractCommandHandle
/**
* <pre>
- *
+ *
* Build the create command for an element creation in the selected container.
- * The create command is given by the {@link IElementEditService} of selected
+ * The create command is given by the {@link IElementEditService} of selected
* element.
*
* @return the composite creation command for current selection
- *
+ *
* </pre>
*/
protected Command buildCommand() {
ICommandContext commandContext = getCommandContext();
- if(commandContext == null) {
+ if (commandContext == null) {
return UnexecutableCommand.INSTANCE;
}
EObject container = commandContext.getContainer();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(container);
- if(provider == null) {
+ if (provider == null) {
return UnexecutableCommand.INSTANCE;
}
ICommand createGMFCommand = provider.getEditCommand(createRequest);
- if(createGMFCommand != null) {
+ if (createGMFCommand != null) {
Command emfCommand = org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper.wrap(createGMFCommand);
return emfCommand;
}
@@ -76,13 +76,13 @@ public abstract class AbstractCreateCommandHandler extends AbstractCommandHandle
}
/**
- *
+ *
* @return
* the creation request to use in this handler
*/
protected CreateElementRequest buildRequest() {
ICommandContext commandContext = getCommandContext();
- if(commandContext != null) {
+ if (commandContext != null) {
EObject container = commandContext.getContainer();
EReference reference = commandContext.getReference();
boolean nullReference = reference == null;
@@ -92,15 +92,16 @@ public abstract class AbstractCreateCommandHandler extends AbstractCommandHandle
}
/**
- *
+ *
* @see org.eclipse.papyrus.uml.service.types.handlers.modelexplorer.handler.AbstractCommandHandler#getCommand()
- *
+ *
* @return current command
*/
+ @Override
protected Command getCommand() {
// In case we had one before, dispose it before replacing it
disposeCommand();
-
+
createRequest = buildRequest();
createCommand = buildCommand();
return createCommand;
@@ -113,19 +114,19 @@ public abstract class AbstractCreateCommandHandler extends AbstractCommandHandle
/**
* This method is called by the commands service to validate if this particular handler is active.
- * By default, the creation of UML handlers only verify that the element to be created is allowed by the applied filter (
- * {@link UmlElementCommandFilter}, ...)
- *
+ * By default, the creation of UML handlers only verify that the element to be created is allowed by the applied filter ( {@link UmlElementCommandFilter}, ...)
+ *
* @see org.eclipse.papyrus.uml.service.types.handlers.AbstractCommandHandler#setEnabled(java.lang.Object)
- *
- *
+ *
+ *
* @param evaluationContext
*/
+ @Override
public void setEnabled(Object evaluationContext) {
IElementType newElementType = getElementTypeToCreate();
boolean isEnabled = getCommandFilter().getVisibleCommands().contains(newElementType);
- if(isEnabled) {
+ if (isEnabled) {
Command command = getCommand();
isEnabled = command.canExecute();
}
@@ -134,11 +135,11 @@ public abstract class AbstractCreateCommandHandler extends AbstractCommandHandle
/** returns the command filter to use for this handler */
public abstract ICommandFilter getCommandFilter();
-
+
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Object result;
-
+
try {
result = super.execute(event);
} finally {
@@ -148,18 +149,18 @@ public abstract class AbstractCreateCommandHandler extends AbstractCommandHandle
createCommand = null;
createRequest = null;
}
-
+
return result;
}
-
+
private void disposeCommand() {
- if(createCommand != null) {
+ if (createCommand != null) {
createCommand.dispose();
}
createRequest = null;
createCommand = null;
}
-
+
@Override
public void dispose() {
disposeCommand();
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractUmlCreateCommandHandler.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractUmlCreateCommandHandler.java
index f403ec4765f..432ef14d7c1 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractUmlCreateCommandHandler.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/handlers/AbstractUmlCreateCommandHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,16 +18,16 @@ import org.eclipse.papyrus.uml.service.types.filter.UmlElementCommandFilter;
/**
* Abstract handler for every creation command for UML elements
* used in the ModelExplorer contextual ("Create new child") menu
- *
+ *
*/
public abstract class AbstractUmlCreateCommandHandler extends AbstractCreateCommandHandler {
private static final ICommandFilter filter = UmlElementCommandFilter.INSTANCE;
/**
- *
+ *
* @see org.eclipse.papyrus.uml.service.types.handlers.AbstractCreateCommandHandler#getCommandFilter()
- *
+ *
* @return
*/
@Override
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityGroupHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityGroupHelper.java
index 63d3c321323..dfd8f211ade 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityGroupHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityGroupHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,7 +35,7 @@ public class ActivityGroupHelper extends ElementEditHelper {
@Override
protected ICommand getBasicDestroyElementCommand(DestroyElementRequest req) {
- ICommand result = new DestroyActivityNode(req);
+ ICommand result = new DestroyActivityNode(req);
return result;
}
@@ -44,42 +44,45 @@ public class ActivityGroupHelper extends ElementEditHelper {
* inner class for the destruction of element
*
*/
- private class DestroyActivityNode extends DestroyElementCommand{
+ private class DestroyActivityNode extends DestroyElementCommand {
+
+ private Command emfcmd = null;
- private Command emfcmd=null;
public DestroyActivityNode(DestroyElementRequest request) {
super(request);
}
+
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- //this code comes from super class and we replace explicitly by a call of the command of UML
+ throws ExecutionException {
+ // this code comes from super class and we replace explicitly by a call of the command of UML
// for node specific commands have been done
EObject destructee = getElementToDestroy();
// only destroy attached elements
if ((destructee != null) && (destructee.eResource() != null)) {
-
+
// here has been commented because uml commands take all in charge
// tear down incoming references
- //tearDownIncomingReferences(destructee);
+ // tearDownIncomingReferences(destructee);
// also tear down outgoing references, because we don't want
- // reverse-reference lookups to find destroyed objects
- //tearDownOutgoingReferences(destructee);
+ // reverse-reference lookups to find destroyed objects
+ // tearDownOutgoingReferences(destructee);
// remove the object from its container
- emfcmd=DeleteCommand.create(getRequest().getEditingDomain(),getElementToDestroy());
+ emfcmd = DeleteCommand.create(getRequest().getEditingDomain(), getElementToDestroy());
if (emfcmd != null && emfcmd.canExecute()) {
emfcmd.execute();
}
- // here has been commented because uml commands take all in charge
- // in case it was cross-resource-contained
- // Resource res = destructee.eResource();
- // if (res != null) {
- //res.getContents().remove(destructee);
- // }
+ // here has been commented because uml commands take all in charge
+ // in case it was cross-resource-contained
+ // Resource res = destructee.eResource();
+ // if (res != null) {
+ // res.getContents().remove(destructee);
+ // }
}
return CommandResult.newOKCommandResult();
@@ -88,8 +91,8 @@ public class ActivityGroupHelper extends ElementEditHelper {
@Override
protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // The undo has to be explicitly called
- emfcmd.canUndo();
+ // The undo has to be explicitly called
+ emfcmd.canUndo();
emfcmd.undo();
return Status.OK_STATUS;
@@ -97,12 +100,12 @@ public class ActivityGroupHelper extends ElementEditHelper {
@Override
protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // The redo has to be explicitly called
- //IStatus status =super.doRedo(monitor, info);
+ // The redo has to be explicitly called
+ // IStatus status =super.doRedo(monitor, info);
// IStatus status =super.doRedo(monitor, info);
// emfcmd.canExecute();
emfcmd.redo();
-
+
return Status.OK_STATUS;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityHelper.java
index db808c8a724..9012ae4a278 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,75 +24,75 @@ public class ActivityHelper extends ElementEditHelper {
protected ICommand getMoveCommand(MoveRequest req) {
return new NotContainmentMoveCommand(req);
}
-
-// {
-// getDefaultContainmentFeatures().put(UMLPackage.eINSTANCE.getCentralBufferNode(), UMLPackage.eINSTANCE.getActivity_OwnedNode());
-// }
-//
-// @Override
-// protected ICommand getCreateCommand(CreateElementRequest req) {
-// return super.getCreateCommand(req);
-// // return new CreateActivityNode(req);
-// }
-//
-//
-// /**
-// * this inner class is used to call specific command of UML
-// *
-// */
-// private class CreateActivityNode extends CreateElementCommand{
-//
-// protected Command emfcmd=null;
-// public CreateActivityNode(CreateElementRequest request) {
-// super(request);
-// }
-// @Override
-// protected EObject doDefaultElementCreation() {
-// EObject result = null;
-// EReference containment = getContainmentFeature();
-// EClass eClass = getElementType().getEClass();
-//
-// if (containment != null) {
-// EObject element = getElementToEdit();
-// if (element != null) {
-// result = eClass.getEPackage().getEFactoryInstance().create(eClass);
-// //Command cmd=new CreateChildCommand(getRequest().getEditingDomain(), element, UMLPackage.eINSTANCE.getActivity_OwnedNode(), UMLFactory.eINSTANCE.createOpaqueAction(), Collections.EMPTY_LIST);
-// emfcmd= new CreateChildCommand(getRequest().getEditingDomain(),element, containment, result, Collections.EMPTY_LIST);
-// emfcmd.canExecute();
-// emfcmd.execute();
-// if(!emfcmd.getResult().isEmpty()){
-// result=(EObject)emfcmd.getResult().toArray()[0];
-// }
-// }
-// }
-//
-// IStatus status = (result != null) ? Status.OK_STATUS
-// : new Status(
-// Status.ERROR,
-// EMFTypePlugin.getPluginId(),
-// EMFTypeCoreMessages
-// .bind(
-// EMFTypeCoreMessages.createElementCommand_noElementCreated,
-// getElementType().getDisplayName()));
-//
-// setDefaultElementCreationStatus(status);
-//
-// return result;
-// }
-// @Override
-// protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-// emfcmd.undo();
-// return super.doUndo(monitor, info);
-// }
-//
-// @Override
-// protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-//
-// IStatus status= super.doRedo(monitor, info);
-// emfcmd.redo();
-// return status;
-// }
-// }
-//
-//
+
+ // {
+ // getDefaultContainmentFeatures().put(UMLPackage.eINSTANCE.getCentralBufferNode(), UMLPackage.eINSTANCE.getActivity_OwnedNode());
+ // }
+ //
+ // @Override
+ // protected ICommand getCreateCommand(CreateElementRequest req) {
+ // return super.getCreateCommand(req);
+ // // return new CreateActivityNode(req);
+ // }
+ //
+ //
+ // /**
+ // * this inner class is used to call specific command of UML
+ // *
+ // */
+ // private class CreateActivityNode extends CreateElementCommand{
+ //
+ // protected Command emfcmd=null;
+ // public CreateActivityNode(CreateElementRequest request) {
+ // super(request);
+ // }
+ // @Override
+ // protected EObject doDefaultElementCreation() {
+ // EObject result = null;
+ // EReference containment = getContainmentFeature();
+ // EClass eClass = getElementType().getEClass();
+ //
+ // if (containment != null) {
+ // EObject element = getElementToEdit();
+ // if (element != null) {
+ // result = eClass.getEPackage().getEFactoryInstance().create(eClass);
+ // //Command cmd=new CreateChildCommand(getRequest().getEditingDomain(), element, UMLPackage.eINSTANCE.getActivity_OwnedNode(), UMLFactory.eINSTANCE.createOpaqueAction(), Collections.EMPTY_LIST);
+ // emfcmd= new CreateChildCommand(getRequest().getEditingDomain(),element, containment, result, Collections.EMPTY_LIST);
+ // emfcmd.canExecute();
+ // emfcmd.execute();
+ // if(!emfcmd.getResult().isEmpty()){
+ // result=(EObject)emfcmd.getResult().toArray()[0];
+ // }
+ // }
+ // }
+ //
+ // IStatus status = (result != null) ? Status.OK_STATUS
+ // : new Status(
+ // Status.ERROR,
+ // EMFTypePlugin.getPluginId(),
+ // EMFTypeCoreMessages
+ // .bind(
+ // EMFTypeCoreMessages.createElementCommand_noElementCreated,
+ // getElementType().getDisplayName()));
+ //
+ // setDefaultElementCreationStatus(status);
+ //
+ // return result;
+ // }
+ // @Override
+ // protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ // emfcmd.undo();
+ // return super.doUndo(monitor, info);
+ // }
+ //
+ // @Override
+ // protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ //
+ // IStatus status= super.doRedo(monitor, info);
+ // emfcmd.redo();
+ // return status;
+ // }
+ // }
+ //
+ //
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityNodeHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityNodeHelper.java
index a4ca22a391f..60049f23380 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityNodeHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityNodeHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,24 +19,16 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.edit.command.DeleteCommand;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand;
import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.papyrus.uml.service.types.command.NotContainmentMoveCommand;
-import org.eclipse.uml2.uml.Activity;
import org.eclipse.uml2.uml.ActivityNode;
-import org.eclipse.uml2.uml.ActivityPartition;
import org.eclipse.uml2.uml.UMLPackage;
/**
@@ -46,17 +38,16 @@ import org.eclipse.uml2.uml.UMLPackage;
public class ActivityNodeHelper extends ElementEditHelper {
- /**
- * Parameter name for {@link ConfigureRequest}
- * Used to pass the actual partition instance to set {@link ActivityNode#getInPartition()}
+ /**
+ * Parameter name for {@link ConfigureRequest} Used to pass the actual partition instance to set {@link ActivityNode#getInPartition()}
*/
public static final String IN_PARTITION = "IN_PARTITION";
-
+
public static final String IN_INTERRUPTIBLE_ACTIVITY_REGION = "IN_INTERRUPTIBLE_ACTIVITY_REGION";
-
+
@Override
protected ICommand getBasicDestroyElementCommand(DestroyElementRequest req) {
- ICommand result = new DestroyActivityNode(req);
+ ICommand result = new DestroyActivityNode(req);
return result;
}
@@ -64,54 +55,57 @@ public class ActivityNodeHelper extends ElementEditHelper {
@Override
protected ICommand getConfigureCommand(ConfigureRequest req) {
if (req.getParameter(IN_PARTITION) != null) {
- return new SetValueCommand(new SetRequest((EObject)req.getParameter(IN_PARTITION),UMLPackage.eINSTANCE.getActivityPartition_Node(), req.getElementToConfigure()));
+ return new SetValueCommand(new SetRequest((EObject) req.getParameter(IN_PARTITION), UMLPackage.eINSTANCE.getActivityPartition_Node(), req.getElementToConfigure()));
}
if (req.getParameter(IN_INTERRUPTIBLE_ACTIVITY_REGION) != null) {
- return new SetValueCommand(new SetRequest((EObject)req.getParameter(IN_INTERRUPTIBLE_ACTIVITY_REGION),UMLPackage.eINSTANCE.getInterruptibleActivityRegion_Node(), req.getElementToConfigure()));
+ return new SetValueCommand(new SetRequest((EObject) req.getParameter(IN_INTERRUPTIBLE_ACTIVITY_REGION), UMLPackage.eINSTANCE.getInterruptibleActivityRegion_Node(), req.getElementToConfigure()));
}
return super.getConfigureCommand(req);
}
-
+
/**
* inner class for the destruction of element
*
*/
- private class DestroyActivityNode extends DestroyElementCommand{
+ private class DestroyActivityNode extends DestroyElementCommand {
+
+ private Command emfcmd = null;
- private Command emfcmd=null;
public DestroyActivityNode(DestroyElementRequest request) {
super(request);
}
+
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- //this code comes from super class and we replace explicitly by a call of the command of UML
+ throws ExecutionException {
+ // this code comes from super class and we replace explicitly by a call of the command of UML
// for node specific commands have been done
EObject destructee = getElementToDestroy();
// only destroy attached elements
if ((destructee != null) && (destructee.eResource() != null)) {
-
+
// here has been commented because uml commands take all in charge
// tear down incoming references
- //tearDownIncomingReferences(destructee);
+ // tearDownIncomingReferences(destructee);
// also tear down outgoing references, because we don't want
- // reverse-reference lookups to find destroyed objects
- //tearDownOutgoingReferences(destructee);
+ // reverse-reference lookups to find destroyed objects
+ // tearDownOutgoingReferences(destructee);
// remove the object from its container
- emfcmd=DeleteCommand.create(getRequest().getEditingDomain(),getElementToDestroy());
+ emfcmd = DeleteCommand.create(getRequest().getEditingDomain(), getElementToDestroy());
if (emfcmd != null && emfcmd.canExecute()) {
emfcmd.execute();
}
- // here has been commented because uml commands take all in charge
- // in case it was cross-resource-contained
- // Resource res = destructee.eResource();
- // if (res != null) {
- //res.getContents().remove(destructee);
- // }
+ // here has been commented because uml commands take all in charge
+ // in case it was cross-resource-contained
+ // Resource res = destructee.eResource();
+ // if (res != null) {
+ // res.getContents().remove(destructee);
+ // }
}
return CommandResult.newOKCommandResult();
@@ -120,8 +114,8 @@ public class ActivityNodeHelper extends ElementEditHelper {
@Override
protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // The undo has to be explicitly called
- emfcmd.canUndo();
+ // The undo has to be explicitly called
+ emfcmd.canUndo();
emfcmd.undo();
return Status.OK_STATUS;
@@ -129,12 +123,12 @@ public class ActivityNodeHelper extends ElementEditHelper {
@Override
protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // The redo has to be explicitly called
- //IStatus status =super.doRedo(monitor, info);
+ // The redo has to be explicitly called
+ // IStatus status =super.doRedo(monitor, info);
// IStatus status =super.doRedo(monitor, info);
// emfcmd.canExecute();
emfcmd.redo();
-
+
return Status.OK_STATUS;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityPartitionEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityPartitionEditHelper.java
index 2b725ce76fb..b9b6e5c5c4d 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityPartitionEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ActivityPartitionEditHelper.java
@@ -17,17 +17,17 @@ import org.eclipse.uml2.uml.ActivityPartition;
import org.eclipse.uml2.uml.UMLPackage;
public class ActivityPartitionEditHelper extends ActivityGroupHelper {
-
+
@Override
protected ICommand getCreateCommand(CreateElementRequest req) {
return super.getCreateCommand(getCreatePartitionChildRequest(req));
}
-
+
/**
- * All elements which created in ActivityPartition is contained in Activity.
- * ActivityPartition hasn't containment features.
+ * All elements which created in ActivityPartition is contained in Activity.
+ * ActivityPartition hasn't containment features.
* That's why we need replace ActivityPartion on Activity.
- *
+ *
* @return new CreateElementRequest with Activity as a container for new Element.
*/
protected CreateElementRequest getCreatePartitionChildRequest(CreateElementRequest req) {
@@ -35,20 +35,20 @@ public class ActivityPartitionEditHelper extends ActivityGroupHelper {
return null;
}
CreateElementRequest result = new CreateElementRequest(req.getEditingDomain(), findActivity(req.getContainer()), req.getElementType());
- result.setParameter(ActivityNodeHelper.IN_PARTITION, (ActivityPartition)req.getContainer());
+ result.setParameter(ActivityNodeHelper.IN_PARTITION, req.getContainer());
result.setContainmentFeature(findActivityFeature(req.getElementType().getEClass()));
return result;
}
-
+
@Override
protected ICommand getMoveCommand(MoveRequest req) {
if (req != null) {
if (req.getTargetContainer() instanceof ActivityPartition) {
- ActivityPartition partition = (ActivityPartition)req.getTargetContainer();
+ ActivityPartition partition = (ActivityPartition) req.getTargetContainer();
CompositeCommand result = new CompositeCommand("Move elements in Partition");
MoveElementsCommand moveCommand = new NotContainmentMoveCommand(createMoveToPartitionRequest(req));
result.add(moveCommand);
- for (Object o: req.getElementsToMove().keySet()) {
+ for (Object o : req.getElementsToMove().keySet()) {
result.add(new SetValueCommand(new SetRequest(partition, UMLPackage.eINSTANCE.getActivityPartition_Node(), o)));
}
return result;
@@ -56,9 +56,10 @@ public class ActivityPartitionEditHelper extends ActivityGroupHelper {
}
return super.getMoveCommand(req);
}
-
+
/**
- * @param base move request in which target container is ActivityPartition
+ * @param base
+ * move request in which target container is ActivityPartition
* @return MoveRequest in which replaced Partition container on Activity and replaced containment features for it.
*/
private MoveRequest createMoveToPartitionRequest(MoveRequest baseReq) {
@@ -68,8 +69,8 @@ public class ActivityPartitionEditHelper extends ActivityGroupHelper {
MoveRequest result = new MoveRequest(baseReq.getEditingDomain(), findActivity(baseReq.getTargetContainer()), baseReq.getElementsToMove());
for (Object o : baseReq.getElementsToMove().keySet()) {
if (o instanceof ActivityNode) {
- ActivityNode node = (ActivityNode)o;
- result.setTargetFeature(node ,findActivityFeature(node.eClass()));
+ ActivityNode node = (ActivityNode) o;
+ result.setTargetFeature(node, findActivityFeature(node.eClass()));
}
}
return result;
@@ -77,31 +78,32 @@ public class ActivityPartitionEditHelper extends ActivityGroupHelper {
/**
* Find parent Activity.
- *
- * @param editElement ActivitiyPartition element
+ *
+ * @param editElement
+ * ActivitiyPartition element
* @return null if Activity not found.
*/
protected Activity findActivity(EObject editElement) {
if (editElement instanceof ActivityPartition) {
ActivityPartition partition = (ActivityPartition) editElement;
if (partition.eContainer() instanceof Activity) {
- return (Activity)partition.eContainer();
+ return (Activity) partition.eContainer();
} else {
return findActivity(partition.eContainer());
}
}
return null;
}
-
+
/**
* Find Activity feature appropriate to ActivityPartition feature.
- *
+ *
* @return Appropriate feature. If feature not found return partitionFeature param
*/
protected EReference findActivityFeature(EClass eClass) {
if (UMLPackage.eINSTANCE.getActivityPartition().isSuperTypeOf(eClass)) {
return UMLPackage.eINSTANCE.getActivity_StructuredNode();
- }
+ }
if (UMLPackage.eINSTANCE.getStructuredActivityNode().isSuperTypeOf(eClass)) {
return UMLPackage.eINSTANCE.getActivity_StructuredNode();
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/AssociationBaseEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/AssociationBaseEditHelper.java
index 6377027ed62..5d134819dbc 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/AssociationBaseEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/AssociationBaseEditHelper.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -44,14 +44,14 @@ public class AssociationBaseEditHelper extends ElementEditHelper {
/**
* This method provides the source type provided as {@link ConfigureRequest} parameter.
- *
+ *
* @return the target role
*/
private Classifier getSourceOwnerType(ConfigureRequest req) {
Classifier result = null;
Object paramObject = req.getParameter(CreateRelationshipRequest.SOURCE);
- if(paramObject instanceof Classifier) {
- result = (Classifier)paramObject;
+ if (paramObject instanceof Classifier) {
+ result = (Classifier) paramObject;
}
return result;
@@ -59,14 +59,14 @@ public class AssociationBaseEditHelper extends ElementEditHelper {
/**
* This method provides the target type provided as {@link ConfigureRequest} parameter.
- *
+ *
* @return the target role
*/
private Classifier getTargetOwnerType(ConfigureRequest req) {
Classifier result = null;
Object paramObject = req.getParameter(CreateRelationshipRequest.TARGET);
- if(paramObject instanceof Classifier) {
- result = (Classifier)paramObject;
+ if (paramObject instanceof Classifier) {
+ result = (Classifier) paramObject;
}
return result;
@@ -74,20 +74,20 @@ public class AssociationBaseEditHelper extends ElementEditHelper {
/**
* Test if the relationship creation is allowed.
- *
+ *
* @param source
- * the relationship source can be null
+ * the relationship source can be null
* @param target
- * the relationship target can be null
+ * the relationship target can be null
* @return true if the creation is allowed
*/
protected boolean canCreate(EObject source, EObject target) {
- if((source != null) && !(source instanceof Classifier)) {
+ if ((source != null) && !(source instanceof Classifier)) {
return false;
}
- if((target != null) && !(target instanceof Classifier)) {
+ if ((target != null) && !(target instanceof Classifier)) {
return false;
}
@@ -106,20 +106,20 @@ public class AssociationBaseEditHelper extends ElementEditHelper {
boolean noSourceOrTarget = (source == null || target == null);
boolean noSourceAndTarget = (source == null && target == null);
- if(!noSourceAndTarget && !canCreate(source, target)) {
+ if (!noSourceAndTarget && !canCreate(source, target)) {
// Abort creation.
return UnexecutableCommand.INSTANCE;
}
- if(noSourceOrTarget && !noSourceAndTarget) {
+ if (noSourceOrTarget && !noSourceAndTarget) {
// The request isn't complete yet. Return the identity command so
// that the create relationship gesture is enabled.
return IdentityCommand.INSTANCE;
}
// Propose a container if none is set in request.
- //EObject proposedContainer = EMFCoreUtil.getLeastCommonContainer(Arrays.asList(new EObject[]{ source, target }), UMLPackage.eINSTANCE.getPackage());
- View sourceView = (View)req.getParameter(RequestParameterConstants.EDGE_CREATE_REQUEST_SOURCE_VIEW);
+ // EObject proposedContainer = EMFCoreUtil.getLeastCommonContainer(Arrays.asList(new EObject[]{ source, target }), UMLPackage.eINSTANCE.getPackage());
+ View sourceView = (View) req.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.EDGE_CREATE_REQUEST_SOURCE_VIEW);
if (sourceView != null) {
Diagram diagram = sourceView.getDiagram();
EObject proposedContainer = EMFCoreUtil.getContainer(diagram.getElement(), UMLPackage.Literals.PACKAGE);
@@ -135,7 +135,7 @@ public class AssociationBaseEditHelper extends ElementEditHelper {
protected ICommand getConfigureCommand(final ConfigureRequest req) {
// All Association configure are managed by HelperAdvice(s).
- if((getSourceOwnerType(req) == null) || (getTargetOwnerType(req) == null)) {
+ if ((getSourceOwnerType(req) == null) || (getTargetOwnerType(req) == null)) {
return UnexecutableCommand.INSTANCE;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/BehavioredClassifierEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/BehavioredClassifierEditHelper.java
index 6eab47c3b66..5b2d17236e0 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/BehavioredClassifierEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/BehavioredClassifierEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -18,12 +18,12 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* <pre>
- *
+ *
* Edit helper class for {@link BehavioredClassifier}
*
* Expected behavior:
* - Add new nested behavior as "ownedBehavior"
- *
+ *
* </pre>
*/
public class BehavioredClassifierEditHelper extends ElementEditHelper {
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ClassEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ClassEditHelper.java
index 2976b13586a..dc9a93d2333 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ClassEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ClassEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -18,16 +18,16 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* <pre>
- *
+ *
* Edit helper class for {@link org.eclipse.uml2.uml.Class}
*
* Expected behavior:
* - Add new nested behavior as "ownedBehavior"
*
- * Also see:
+ * Also see:
* - {@link BehavioredClassifierEditHelper} default containment duplicated here as, due to multiple inheritance
* (Class is also an EncapsulatedClassifier), the ElementType framework may recover an incorrect EditHelper.
- *
+ *
* </pre>
*/
public class ClassEditHelper extends ElementEditHelper {
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/CollaborationEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/CollaborationEditHelper.java
index c3dbf8eba04..dd54ccc8e68 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/CollaborationEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/CollaborationEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -18,13 +18,13 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* <pre>
- *
+ *
* Edit helper class for {@link Collaboration}
*
* Expected behavior:
* - Add new nested behavior as "ownedBehavior"
*
- * Also see:
+ * Also see:
* - {@link BehavioredClassifierEditHelper} default containment duplicated here as, due to multiple inheritance
* (Collaboration is also a StructuredClassifier), the ElementType framework may recover an incorrect EditHelper.
* </pre>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ComponentEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ComponentEditHelper.java
index bd4d634d0e5..2f0028e2d9c 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ComponentEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ComponentEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* Patrick Tessier (CEA LIST) Patrick.Tessier@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -35,13 +35,13 @@ public class ComponentEditHelper extends ElementEditHelper {
protected ICommand getCreateCommand(CreateElementRequest req) {
// overload the creation in order to prevent to create or move a component into a component by using the role
// "nestedClassifier"
- EObject owner= req.getContainer();
- EReference eref=req.getContainmentFeature();
- if(owner!=null &&!canCreate(owner, eref)) {
+ EObject owner = req.getContainer();
+ EReference eref = req.getContainmentFeature();
+ if (owner != null && !canCreate(owner, eref)) {
// Abort creation.
return UnexecutableCommand.INSTANCE;
}
- if(owner instanceof Component && eref==null){
+ if (owner instanceof Component && eref == null) {
req.setContainmentFeature(UMLPackage.eINSTANCE.getComponent_PackagedElement());
}
return super.getCreateCommand(req);
@@ -51,35 +51,40 @@ public class ComponentEditHelper extends ElementEditHelper {
protected ICommand getMoveCommand(MoveRequest req) {
// overload the creation in order to prevent to create or move a component into a component by using the role
// "nestedClassifier"
- for(Object elementToMove : req.getElementsToMove().keySet()) {
- if( elementToMove instanceof Component && (UMLPackage.eINSTANCE.getClass_NestedClassifier().equals(req.getTargetFeature((EObject)elementToMove)))){
+ for (Object elementToMove : req.getElementsToMove().keySet()) {
+ if (elementToMove instanceof Component && (UMLPackage.eINSTANCE.getClass_NestedClassifier().equals(req.getTargetFeature((EObject) elementToMove)))) {
return UnexecutableCommand.INSTANCE;
}
- if( elementToMove instanceof Component && req.getTargetFeature((EObject)elementToMove)==null){
- req.setTargetFeature((EObject)elementToMove, (UMLPackage.eINSTANCE.getComponent_PackagedElement()));
+ if (elementToMove instanceof Component && req.getTargetFeature((EObject) elementToMove) == null) {
+ req.setTargetFeature((EObject) elementToMove, (UMLPackage.eINSTANCE.getComponent_PackagedElement()));
}
}
-
+
return super.getMoveCommand(req);
}
+
@Override
protected ICommand getSetCommand(SetRequest req) {
// overload the creation in order to prevent to create or move a component into a component by using the role
// "nestedClassifier"
- EObject eobject=req.getElementToEdit();
- if( eobject instanceof Component && (UMLPackage.eINSTANCE.getComponent_PackagedElement().equals(req.getFeature()))){
+ EObject eobject = req.getElementToEdit();
+ if (eobject instanceof Component && (UMLPackage.eINSTANCE.getComponent_PackagedElement().equals(req.getFeature()))) {
return UnexecutableCommand.INSTANCE;
}
return super.getSetCommand(req);
}
+
/**
* test if it is possible to create a component into a given container and with the given containment feature
- * @param owner the owner of the component, can be null
- * @param eref the containment feature, can be null
+ *
+ * @param owner
+ * the owner of the component, can be null
+ * @param eref
+ * the containment feature, can be null
* @return false if the container is a component and the feature "nestedClassifier"
*/
- protected boolean canCreate(EObject owner,EReference eref) {
- if(owner instanceof Component && UMLPackage.eINSTANCE.getClass_NestedClassifier().equals(eref)){
+ protected boolean canCreate(EObject owner, EReference eref) {
+ if (owner instanceof Component && UMLPackage.eINSTANCE.getClass_NestedClassifier().equals(eref)) {
return false;
}
return true;
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ComponentRealizationEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ComponentRealizationEditHelper.java
index 08fb98a96f8..74a6b02bd2b 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ComponentRealizationEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ComponentRealizationEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -53,18 +53,18 @@ public class ComponentRealizationEditHelper extends DependencyEditHelper {
if ((source != null) && !(source instanceof Classifier)) {
return false;
}
-
+
if ((target != null) && !(target instanceof Component)) {
return false;
}
-
+
if ((source != null) && (target != null) && (source == target)) {
return false;
}
-
+
return true;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConnectorEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConnectorEditHelper.java
index 3b4e7f9eb65..1ec637a969f 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConnectorEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConnectorEditHelper.java
@@ -8,7 +8,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -60,47 +60,47 @@ public class ConnectorEditHelper extends ElementEditHelper {
/**
* Test if the relationship creation is allowed.
- *
+ *
* @param source
- * the relationship source can be null
+ * the relationship source can be null
* @param target
- * the relationship target can be null
+ * the relationship target can be null
* @param sourceView
- * the relationship graphical source can be null
+ * the relationship graphical source can be null
* @param targetView
- * the relationship graphical target can be null
+ * the relationship graphical target can be null
* @return true if the creation is allowed
*/
protected boolean canCreate(EObject source, EObject target, View sourceView, View targetView) {
- if((source != null) && !(source instanceof ConnectableElement)) {
+ if ((source != null) && !(source instanceof ConnectableElement)) {
return false;
}
- if((target != null) && !(target instanceof ConnectableElement)) {
+ if ((target != null) && !(target instanceof ConnectableElement)) {
return false;
}
- if((sourceView != null) && (targetView != null)) {
+ if ((sourceView != null) && (targetView != null)) {
// Cannot create a self connector on a view
- if(sourceView == targetView) {
+ if (sourceView == targetView) {
return false;
}
// Cannot create a connector from a view representing a Part to its own Port (or the opposite)
- if((sourceView.getChildren().contains(targetView)) || (targetView.getChildren().contains(sourceView))) {
+ if ((sourceView.getChildren().contains(targetView)) || (targetView.getChildren().contains(sourceView))) {
return false;
}
// Cannot connect two Port owned by the same view
- if((sourceView.getElement() instanceof Port) && (targetView.getElement() instanceof Port)) {
- if(ViewUtil.getContainerView(sourceView) == ViewUtil.getContainerView(targetView)) {
+ if ((sourceView.getElement() instanceof Port) && (targetView.getElement() instanceof Port)) {
+ if (ViewUtil.getContainerView(sourceView) == ViewUtil.getContainerView(targetView)) {
return false;
}
}
// Cannot connect a Part to one of its (possibly indirect) containment, must connect to one of its Port.
- if(getStructureContainers(sourceView).contains(targetView) || getStructureContainers(targetView).contains(sourceView)) {
+ if (getStructureContainers(sourceView).contains(targetView) || getStructureContainers(targetView).contains(sourceView)) {
return false;
}
}
@@ -118,46 +118,46 @@ public class ConnectorEditHelper extends ElementEditHelper {
boolean noSourceOrTarget = (source == null || target == null);
boolean noSourceAndTarget = (source == null && target == null);
- if(noSourceOrTarget && !noSourceAndTarget) {
-
- if (!(source instanceof ConnectableElement)){
+ if (noSourceOrTarget && !noSourceAndTarget) {
+
+ if (!(source instanceof ConnectableElement)) {
return UnexecutableCommand.INSTANCE;
- }
+ }
// The request isn't complete yet. Return the identity command so
// that the create relationship gesture is enabled.
- return IdentityCommand.INSTANCE;
+ return IdentityCommand.INSTANCE;
}
-
- if (source != null && target != null){
+
+ if (source != null && target != null) {
// Propose a semantic container for the new Connector.
StructuredClassifier proposedContainer = deduceContainer(req);
- if(proposedContainer == null) {
+ if (proposedContainer == null) {
return UnexecutableCommand.INSTANCE;
}
-
+
EObject container = req.getContainer();
- if (container != proposedContainer){
+ if (container != proposedContainer) {
req.setContainer(proposedContainer);
return new CreateRelationshipCommand(req);
}
-
+
}
-
- boolean umlStrict = true;
- if (!req.getParameters().isEmpty()){
- Object umlStrictParameter = req.getParameter(org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants.UML_STRICT);
- if (umlStrictParameter instanceof Boolean){
- umlStrict = (Boolean) umlStrictParameter;
- }
+
+ boolean umlStrict = true;
+ if (!req.getParameters().isEmpty()) {
+ Object umlStrictParameter = req.getParameter(org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants.UML_STRICT);
+ if (umlStrictParameter instanceof Boolean) {
+ umlStrict = (Boolean) umlStrictParameter;
}
+ }
boolean canCreate = true;
-
- if (umlStrict){
+
+ if (umlStrict) {
canCreate = canCreate(source, target, RequestParameterUtils.getSourceView(req), RequestParameterUtils.getTargetView(req));
}
- if(!noSourceAndTarget && !canCreate) {
+ if (!noSourceAndTarget && !canCreate) {
// Abort creation.
return UnexecutableCommand.INSTANCE;
}
@@ -166,14 +166,14 @@ public class ConnectorEditHelper extends ElementEditHelper {
/**
* This method provides the source role provided as {@link ConfigureRequest} parameter.
- *
+ *
* @return the target role
*/
private ConnectableElement getSourceRole(IEditCommandRequest req) {
ConnectableElement result = null;
Object paramObject = req.getParameter(CreateRelationshipRequest.SOURCE);
- if(paramObject instanceof ConnectableElement) {
- result = (ConnectableElement)paramObject;
+ if (paramObject instanceof ConnectableElement) {
+ result = (ConnectableElement) paramObject;
}
return result;
@@ -181,14 +181,14 @@ public class ConnectorEditHelper extends ElementEditHelper {
/**
* This method provides the target role provided as {@link ConfigureRequest} parameter.
- *
+ *
* @return the target role
*/
private ConnectableElement getTargetRole(IEditCommandRequest req) {
ConnectableElement result = null;
Object paramObject = req.getParameter(CreateRelationshipRequest.TARGET);
- if(paramObject instanceof ConnectableElement) {
- result = (ConnectableElement)paramObject;
+ if (paramObject instanceof ConnectableElement) {
+ result = (ConnectableElement) paramObject;
}
return result;
@@ -196,20 +196,20 @@ public class ConnectorEditHelper extends ElementEditHelper {
/**
* This method provides the source partWithPort provided as {@link ConfigureRequest} parameter.
- *
+ *
* @return the target partWithPort
*/
private Property getSourcePartWithPort(IEditCommandRequest req) {
Property result = null;
- if(getSourceRole(req) instanceof Port) {
+ if (getSourceRole(req) instanceof Port) {
// Only look for PartWithPort if the role is a Port.
View parentView = ViewUtil.getContainerView(RequestParameterUtils.getSourceView(req));
EObject semanticParent = parentView.getElement();
- if((semanticParent instanceof Property) && !(semanticParent instanceof Port)) {
+ if ((semanticParent instanceof Property) && !(semanticParent instanceof Port)) {
// Only add PartWithPort for assembly (not for delegation)
- if(!EcoreUtil.isAncestor(parentView, RequestParameterUtils.getTargetView(req))) {
- result = (Property)semanticParent;
+ if (!EcoreUtil.isAncestor(parentView, RequestParameterUtils.getTargetView(req))) {
+ result = (Property) semanticParent;
}
}
@@ -219,20 +219,20 @@ public class ConnectorEditHelper extends ElementEditHelper {
/**
* This method provides the target partWithPort provided as {@link ConfigureRequest} parameter.
- *
+ *
* @return the target partWithPort
*/
private Property getTargetPartWithPort(IEditCommandRequest req) {
Property result = null;
- if(getTargetRole(req) instanceof Port) {
+ if (getTargetRole(req) instanceof Port) {
// Only look for PartWithPort if the role is a Port.
View parentView = ViewUtil.getContainerView(RequestParameterUtils.getTargetView(req));
EObject semanticParent = parentView.getElement();
- if((semanticParent instanceof Property) && !(semanticParent instanceof Port)) {
+ if ((semanticParent instanceof Property) && !(semanticParent instanceof Port)) {
// Only add PartWithPort for assembly (not for delegation)
- if(!EcoreUtil.isAncestor(parentView, RequestParameterUtils.getSourceView(req))) {
- result = (Property)semanticParent;
+ if (!EcoreUtil.isAncestor(parentView, RequestParameterUtils.getSourceView(req))) {
+ result = (Property) semanticParent;
}
}
@@ -247,7 +247,7 @@ public class ConnectorEditHelper extends ElementEditHelper {
@Override
protected ICommand getConfigureCommand(final ConfigureRequest req) {
- final Connector connector = (Connector)req.getElementToConfigure();
+ final Connector connector = (Connector) req.getElementToConfigure();
final ConnectableElement sourceRole = getSourceRole(req);
final ConnectableElement targetRole = getTargetRole(req);
final Property sourcePartWithPort = getSourcePartWithPort(req);
@@ -255,11 +255,12 @@ public class ConnectorEditHelper extends ElementEditHelper {
ICommand configureCommand = new ConfigureElementCommand(req) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- if((sourceRole == null) || (targetRole == null)) {
- //to allow creation from the ModelExplorer or from the table
- //return CommandResult.newCancelledCommandResult();
+ if ((sourceRole == null) || (targetRole == null)) {
+ // to allow creation from the ModelExplorer or from the table
+ // return CommandResult.newCancelledCommandResult();
}
// Add source connector end
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConstraintEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConstraintEditHelper.java
index b9123a830a2..0f8abdbf9cb 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConstraintEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConstraintEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2010-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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -35,13 +35,13 @@ import org.eclipse.uml2.uml.ValueSpecification;
/**
* <pre>
- *
+ *
* Edit helper class for {@link Constraint}
*
* Expected behavior:
* - Initialize specification with a LiteralString
* - Set new ValueSpecification as specification of the parent constraint
- *
+ *
* </pre>
*/
public class ConstraintEditHelper extends ElementEditHelper {
@@ -49,31 +49,32 @@ public class ConstraintEditHelper extends ElementEditHelper {
{
getDefaultContainmentFeatures().put(UMLPackage.eINSTANCE.getValueSpecification(), UMLPackage.eINSTANCE.getConstraint_Specification());
}
-
+
@Override
protected ICommand getConfigureCommand(final ConfigureRequest req) {
- ICommand configureCommand = new ConfigureElementCommand(req) {
+ ICommand configureCommand = new ConfigureElementCommand(req) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- Constraint element = (Constraint)req.getElementToConfigure();
+ Constraint element = (Constraint) req.getElementToConfigure();
// Create constraint specification
ValueSpecification spec = UMLFactory.eINSTANCE.createLiteralString();
spec.setName("constraintSpec"); //$NON-NLS-1$
element.setSpecification(spec);
-
+
return CommandResult.newOKCommandResult(element);
}
};
-
+
return CompositeCommand.compose(configureCommand, super.getConfigureCommand(req));
}
/**
* @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#getSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
- *
+ *
* @param req
* @return
*/
@@ -82,26 +83,26 @@ public class ConstraintEditHelper extends ElementEditHelper {
protected ICommand getSetCommand(SetRequest req) {
EStructuralFeature feature = req.getFeature();
Object value = req.getValue();
- if(value != null) {
+ if (value != null) {
EObject elementToEdit = req.getElementToEdit();
- if(UMLPackage.eINSTANCE.getInteractionConstraint_Minint() == feature) {
- Integer minintValue = InteractionConstraintUtil.getNonNegativeInteger((ValueSpecification)value);
- if(minintValue == null) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint_Minint() == feature) {
+ Integer minintValue = InteractionConstraintUtil.getNonNegativeInteger(value);
+ if (minintValue == null) {
return UnexecutableCommand.INSTANCE;
}
- InteractionConstraint element = (InteractionConstraint)elementToEdit;
+ InteractionConstraint element = (InteractionConstraint) elementToEdit;
Integer maxintValue = InteractionConstraintUtil.getMaxintValue(element);
- if(maxintValue != null && maxintValue.intValue() < minintValue.intValue()) {
+ if (maxintValue != null && maxintValue.intValue() < minintValue.intValue()) {
return UnexecutableCommand.INSTANCE;
}
- } else if(UMLPackage.eINSTANCE.getInteractionConstraint_Maxint() == feature) {
- InteractionConstraint element = (InteractionConstraint)elementToEdit;
- Integer maxintValue = InteractionConstraintUtil.getNonNegativeInteger((ValueSpecification)value);
- if(maxintValue == null || maxintValue.intValue() == 0) {
+ } else if (UMLPackage.eINSTANCE.getInteractionConstraint_Maxint() == feature) {
+ InteractionConstraint element = (InteractionConstraint) elementToEdit;
+ Integer maxintValue = InteractionConstraintUtil.getNonNegativeInteger(value);
+ if (maxintValue == null || maxintValue.intValue() == 0) {
return UnexecutableCommand.INSTANCE;
}
Integer minintValue = InteractionConstraintUtil.getMinintValue(element);
- if(minintValue != null && maxintValue.intValue() < minintValue.intValue()) {
+ if (minintValue != null && maxintValue.intValue() < minintValue.intValue()) {
return UnexecutableCommand.INSTANCE;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ControlFlowEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ControlFlowEditHelper.java
index 5a8a21b5db7..2e74b2699ff 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ControlFlowEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ControlFlowEditHelper.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -50,19 +50,19 @@ public class ControlFlowEditHelper extends ElementEditHelper {
/**
* Test if the relationship creation is allowed.
- *
+ *
* @param source
- * the relationship source can be null
+ * the relationship source can be null
* @param target
- * the relationship target can be null
+ * the relationship target can be null
* @param sourceView
- * the relationship graphical source can be null
+ * the relationship graphical source can be null
* @param targetView
- * the relationship graphical target can be null
+ * the relationship graphical target can be null
* @return true if the creation is allowed
*/
protected boolean canCreate(EObject source, EObject target, View sourceView, View targetView) {
- return canCreate(source, target);
+ return canCreate(source, target);
}
/**
@@ -76,16 +76,16 @@ public class ControlFlowEditHelper extends ElementEditHelper {
boolean noSourceOrTarget = (source == null || target == null);
boolean noSourceAndTarget = (source == null && target == null);
- if(!noSourceAndTarget && !canCreate(source, target, RequestParameterUtils.getSourceView(req), RequestParameterUtils.getTargetView(req))) {
+ if (!noSourceAndTarget && !canCreate(source, target, RequestParameterUtils.getSourceView(req), RequestParameterUtils.getTargetView(req))) {
// Abort creation.
return UnexecutableCommand.INSTANCE;
}
- if(noSourceOrTarget && !noSourceAndTarget) {
+ if (noSourceOrTarget && !noSourceAndTarget) {
// The request isn't complete yet. Return the identity command so
// that the create relationship gesture is enabled.
// this can be before first creation => check the source
- if(source != null && !(source instanceof ActivityNode)) {
+ if (source != null && !(source instanceof ActivityNode)) {
return UnexecutableCommand.INSTANCE;
}
return IdentityCommand.INSTANCE;
@@ -93,7 +93,7 @@ public class ControlFlowEditHelper extends ElementEditHelper {
// Propose a semantic container for the new control flow.
Activity proposedContainer = deduceContainer(req);
- if(proposedContainer == null) {
+ if (proposedContainer == null) {
return UnexecutableCommand.INSTANCE;
}
@@ -101,11 +101,11 @@ public class ControlFlowEditHelper extends ElementEditHelper {
return new CreateRelationshipCommand(req);
}
-
+
protected Activity deduceContainer(CreateRelationshipRequest request) {
return deduceContainer(request.getSource(), request.getTarget());
}
-
+
/**
* @param source
* @param target
@@ -115,9 +115,9 @@ public class ControlFlowEditHelper extends ElementEditHelper {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Activity) {
- return (Activity)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof Activity) {
+ return (Activity) element;
}
}
return null;
@@ -131,15 +131,16 @@ public class ControlFlowEditHelper extends ElementEditHelper {
ICommand configureCommand = new ConfigureElementCommand(req) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- ControlFlow element = (ControlFlow)req.getElementToConfigure();
+ ControlFlow element = (ControlFlow) req.getElementToConfigure();
ActivityNode source = getSourceObject(req);
ActivityNode target = getTargetObject(req);
- if(source !=null) {
+ if (source != null) {
element.setSource(getSourceObject(req));
}
- if(target !=null) {
+ if (target != null) {
element.setTarget(target);
}
@@ -149,45 +150,45 @@ public class ControlFlowEditHelper extends ElementEditHelper {
return CompositeCommand.compose(configureCommand, super.getConfigureCommand(req));
}
-
+
/**
* This method provides the object to be use as source.
- *
+ *
* @return the source value
*/
protected ActivityNode getSourceObject(ConfigureRequest req) {
Object result = req.getParameter(CreateRelationshipRequest.SOURCE);
- return ( result instanceof ActivityNode) ? (ActivityNode)result : null;
+ return (result instanceof ActivityNode) ? (ActivityNode) result : null;
}
/**
* This method provides the object to be used as target.
- *
+ *
* @return the target value
*/
protected ActivityNode getTargetObject(ConfigureRequest req) {
Object result = req.getParameter(CreateRelationshipRequest.TARGET);
- return ( result instanceof ActivityNode) ? (ActivityNode)result : null;
+ return (result instanceof ActivityNode) ? (ActivityNode) result : null;
}
/**
* {@inheritDoc}
*/
protected boolean canCreate(EObject source, EObject target) {
- if((source != null) && !(source instanceof ActivityNode)) {
+ if ((source != null) && !(source instanceof ActivityNode)) {
return false;
}
- if((target != null) && !(target instanceof ActivityNode)) {
+ if ((target != null) && !(target instanceof ActivityNode)) {
return false;
}
-
+
Activity container = deduceContainer(source, target);
- if(container == null) {
+ if (container == null) {
return false;
}
- return ControlFlowUtil.canExistControlFlow(container, null, (ActivityNode)source, (ActivityNode)target);
+ return ControlFlowUtil.canExistControlFlow(container, null, (ActivityNode) source, (ActivityNode) target);
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DefaultEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DefaultEditHelper.java
index ce7e04ae4e6..a3916a435b0 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DefaultEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DefaultEditHelper.java
@@ -1,13 +1,13 @@
/*****************************************************************************
* Copyright (c) 2010, 2014 CEA LIST 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 (CEA) - bug 440108
*
@@ -47,12 +47,12 @@ import org.eclipse.papyrus.uml.service.types.command.CreateEditBasedElementComma
* The changes are replacing:
* ElementTypeRegistry.getInstance().getElementType(req.getElementToDestroy());
* by
- * ElementTypeRegistry.getInstance().getElementType(req.getElementToDestroy(), req.getClientContext());
+ * ElementTypeRegistry.getInstance().getElementType(req.getElementToDestroy(), req.getClientContext());
*
* See:
* - Bug328232 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=328232)
* - Bug328506 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=328506)
- *
+ *
* </pre>
*/
public class DefaultEditHelper extends AbstractEditHelper {
@@ -61,10 +61,10 @@ public class DefaultEditHelper extends AbstractEditHelper {
public static final String Cache_Maps = "Cache_Maps";//$NON-NLS-1$
/** Defined in org.eclipse.gmf.runtime.emf.type.core.internal.requests.RequestCacheEntries (internal) */
- public static final String Element_Type = "Element_Type";//$NON-NLS-1$
+ public static final String Element_Type = "Element_Type";//$NON-NLS-1$
/** Defined in org.eclipse.gmf.runtime.emf.type.core.internal.requests.RequestCacheEntries (internal) */
- public static final String Checked_Elements = "Checked_Elements";//$NON-NLS-1$
+ public static final String Checked_Elements = "Checked_Elements";//$NON-NLS-1$
/** Defined in org.eclipse.gmf.runtime.emf.type.core.internal.requests.RequestCacheEntries (internal) */
public static final String EditHelper_Advice = "EditHelper_Advice";//$NON-NLS-1$
@@ -73,31 +73,32 @@ public class DefaultEditHelper extends AbstractEditHelper {
* Gets the command to destroy a single child of an element of my kind along
* with its dependents (not related by containment). By default, returns a
* composite that destroys the elements and zero or more dependents.
- *
+ *
* @param req
- * the destroy request
+ * the destroy request
* @return a command that destroys the element specified as the request's {@linkplain DestroyElementRequest#getElementToDestroy() element to
* destroy} and its non-containment dependents
*/
+ @Override
protected ICommand getDestroyElementWithDependentsCommand(DestroyElementRequest req) {
ICommand result = getBasicDestroyElementCommand(req);
- EObject initial = (EObject)req.getParameter(DestroyElementRequest.INITIAL_ELEMENT_TO_DESTROY_PARAMETER);
+ EObject initial = (EObject) req.getParameter(DestroyElementRequest.INITIAL_ELEMENT_TO_DESTROY_PARAMETER);
- if(initial == null) {
+ if (initial == null) {
// set the parameter to keep track of the initial element to destroy
req.setParameter(DestroyElementRequest.INITIAL_ELEMENT_TO_DESTROY_PARAMETER, req.getElementToDestroy());
}
- // get elements dependent on the element we are destroying, that
- // must also be destroyed
- DestroyDependentsRequest ddr = (DestroyDependentsRequest)req.getParameter(DestroyElementRequest.DESTROY_DEPENDENTS_REQUEST_PARAMETER);
- if(ddr == null) {
+ // get elements dependent on the element we are destroying, that
+ // must also be destroyed
+ DestroyDependentsRequest ddr = (DestroyDependentsRequest) req.getParameter(DestroyElementRequest.DESTROY_DEPENDENTS_REQUEST_PARAMETER);
+ if (ddr == null) {
// create the destroy-dependents request that will be propagated to
- // destroy requests for all elements destroyed in this operation
+ // destroy requests for all elements destroyed in this operation
ddr = new DestroyDependentsRequest(req.getEditingDomain(), req.getElementToDestroy(), req.isConfirmationRequired());
// propagate the parameters, including the initial element to
- // destroy parameter
+ // destroy parameter
ddr.addParameters(req.getParameters());
ddr.setClientContext(req.getClientContext());
req.setParameter(DestroyElementRequest.DESTROY_DEPENDENTS_REQUEST_PARAMETER, ddr);
@@ -106,29 +107,29 @@ public class DefaultEditHelper extends AbstractEditHelper {
}
IElementType typeToDestroy = null;
- Map cacheMaps = (Map)req.getParameter(Cache_Maps);
- if(cacheMaps != null) {
- Map map = (Map)cacheMaps.get(req.getElementToDestroy());
- if(map != null) {
- typeToDestroy = (IElementType)map.get(Element_Type);
+ Map cacheMaps = (Map) req.getParameter(Cache_Maps);
+ if (cacheMaps != null) {
+ Map map = (Map) cacheMaps.get(req.getElementToDestroy());
+ if (map != null) {
+ typeToDestroy = (IElementType) map.get(Element_Type);
}
}
- if(typeToDestroy == null) {
+ if (typeToDestroy == null) {
typeToDestroy = ElementTypeRegistry.getInstance().getElementType(req.getElementToDestroy(), req.getClientContext());
}
- if(typeToDestroy != null) {
+ if (typeToDestroy != null) {
ICommand command = typeToDestroy.getEditCommand(ddr);
- if(command != null) {
+ if (command != null) {
result = result.compose(command);
}
}
return result;
}
-
+
/**
* {@inheritDoc}
*/
@@ -141,31 +142,31 @@ public class DefaultEditHelper extends AbstractEditHelper {
* Gets the command to destroy a child of an element of my kind. By
* default, returns a composite command that destroys the element specified
* by the request and all of its contents.
- *
+ *
* @param req
- * the destroy request
- * @return a command that destroys the element specified as the request's {@link DestroyElementRequest#getElementToDestroy() element to destroy}
- * along with its contents and other dependents
+ * the destroy request
+ * @return a command that destroys the element specified as the request's {@link DestroyElementRequest#getElementToDestroy() element to destroy} along with its contents and other dependents
*/
+ @Override
protected ICommand getDestroyElementCommand(DestroyElementRequest req) {
ICommand result = null;
EObject parent = req.getElementToDestroy();
- if(req.getParameter(DestroyElementRequest.INITIAL_ELEMENT_TO_DESTROY_PARAMETER) == null) {
+ if (req.getParameter(DestroyElementRequest.INITIAL_ELEMENT_TO_DESTROY_PARAMETER) == null) {
req.setParameter(DestroyElementRequest.INITIAL_ELEMENT_TO_DESTROY_PARAMETER, parent);
}
IElementType parentType = null;
- Map cacheMaps = (Map)req.getParameter(Cache_Maps);
+ Map cacheMaps = (Map) req.getParameter(Cache_Maps);
Set checkedElement = null;
- if(cacheMaps != null) {
- checkedElement = (Set)cacheMaps.get(Checked_Elements);
+ if (cacheMaps != null) {
+ checkedElement = (Set) cacheMaps.get(Checked_Elements);
checkedElement.add(parent);
- Map parentMap = (Map)cacheMaps.get(parent);
- if(parentMap != null) {
- parentType = (IElementType)parentMap.get(Element_Type);
+ Map parentMap = (Map) cacheMaps.get(parent);
+ if (parentMap != null) {
+ parentType = (IElementType) parentMap.get(Element_Type);
} else {
parentType = ElementTypeRegistry.getInstance().getElementType(parent, req.getClientContext());
}
@@ -173,22 +174,22 @@ public class DefaultEditHelper extends AbstractEditHelper {
parentType = ElementTypeRegistry.getInstance().getElementType(parent, req.getClientContext());
}
- if(parentType != null) {
- for(Iterator iter = parent.eContents().iterator(); iter.hasNext();) {
- EObject next = (EObject)iter.next();
+ if (parentType != null) {
+ for (Iterator iter = parent.eContents().iterator(); iter.hasNext();) {
+ EObject next = (EObject) iter.next();
- DestroyDependentsRequest ddr = (DestroyDependentsRequest)req.getParameter(DestroyElementRequest.DESTROY_DEPENDENTS_REQUEST_PARAMETER);
+ DestroyDependentsRequest ddr = (DestroyDependentsRequest) req.getParameter(DestroyElementRequest.DESTROY_DEPENDENTS_REQUEST_PARAMETER);
// if another object is already destroying this one because it
// is (transitively) a dependent, then don't destroy it again .
- if((ddr == null) || ((checkedElement != null) && checkedElement.add(next)) || (!ddr.getDependentElementsToDestroy().contains(next))) {
+ if ((ddr == null) || ((checkedElement != null) && checkedElement.add(next)) || (!ddr.getDependentElementsToDestroy().contains(next))) {
// set the element to be destroyed
req.setElementToDestroy(next);
ICommand command = parentType.getEditCommand(req);
- if(command != null) {
- if(result == null) {
+ if (command != null) {
+ if (result == null) {
result = command;
} else {
result = result.compose(command);
@@ -197,10 +198,10 @@ public class DefaultEditHelper extends AbstractEditHelper {
// Under normal circumstances the command is executable.
// Checking canExecute here slows down large scenarios and it is therefore
// better to skip this check.
- // if (!command.canExecute()) {
- // // no point in continuing if we're abandoning the works
- // break;
- // }
+ // if (!command.canExecute()) {
+ // // no point in continuing if we're abandoning the works
+ // break;
+ // }
}
}
}
@@ -211,8 +212,8 @@ public class DefaultEditHelper extends AbstractEditHelper {
ICommand destroyParent = getDestroyElementWithDependentsCommand(req);
- //bottom-up destruction: destroy children before parent
- if(result == null) {
+ // bottom-up destruction: destroy children before parent
+ if (result == null) {
result = destroyParent;
} else {
result = result.compose(destroyParent);
@@ -223,29 +224,30 @@ public class DefaultEditHelper extends AbstractEditHelper {
/**
* Gets the array of edit helper advice for this request.
- *
+ *
* @param req
- * the edit request
+ * the edit request
* @return the edit helper advice, or <code>null</code> if there is none
*/
+ @Override
protected IEditHelperAdvice[] getEditHelperAdvice(IEditCommandRequest req) {
IEditHelperAdvice[] advices = null;
Object editHelperContext = req.getEditHelperContext();
- Map cacheMaps = (Map)req.getParameter(Cache_Maps);
- if(cacheMaps != null) {
- Map contextMap = (Map)cacheMaps.get(editHelperContext);
- if(contextMap != null) {
- advices = (IEditHelperAdvice[])contextMap.get(EditHelper_Advice);
+ Map cacheMaps = (Map) req.getParameter(Cache_Maps);
+ if (cacheMaps != null) {
+ Map contextMap = (Map) cacheMaps.get(editHelperContext);
+ if (contextMap != null) {
+ advices = (IEditHelperAdvice[]) contextMap.get(EditHelper_Advice);
}
}
- if(advices == null) {
+ if (advices == null) {
- if(editHelperContext instanceof EObject) {
- advices = ElementTypeRegistry.getInstance().getEditHelperAdvice((EObject)editHelperContext, req.getClientContext());
+ if (editHelperContext instanceof EObject) {
+ advices = ElementTypeRegistry.getInstance().getEditHelperAdvice((EObject) editHelperContext, req.getClientContext());
- } else if(editHelperContext instanceof IElementType) {
- advices = ElementTypeRegistry.getInstance().getEditHelperAdvice((IElementType)editHelperContext, req.getClientContext());
+ } else if (editHelperContext instanceof IElementType) {
+ advices = ElementTypeRegistry.getInstance().getEditHelperAdvice((IElementType) editHelperContext, req.getClientContext());
} else {
advices = ElementTypeRegistry.getInstance().getEditHelperAdvice(editHelperContext);
@@ -260,11 +262,11 @@ public class DefaultEditHelper extends AbstractEditHelper {
protected ICommand getBasicDestroyElementCommand(DestroyElementRequest req) {
ICommand result = req.getBasicDestroyCommand();
- if(result == null) {
+ if (result == null) {
result = new DestroyElementPapyrusCommand(req);
} else {
// ensure that re-use of this request will not accidentally
- // propagate this command, which would destroy the wrong object
+ // propagate this command, which would destroy the wrong object
req.setBasicDestroyCommand(null);
}
@@ -274,13 +276,13 @@ public class DefaultEditHelper extends AbstractEditHelper {
@Override
protected ICommand getInsteadCommand(IEditCommandRequest req) {
ICommand result = null;
-
- if(req instanceof UnsetRequest) {
- result = new UnsetValueCommand((UnsetRequest)req);
+
+ if (req instanceof UnsetRequest) {
+ result = new UnsetValueCommand((UnsetRequest) req);
} else {
result = super.getInsteadCommand(req);
}
-
+
return result;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DependencyEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DependencyEditHelper.java
index 81ab687f981..0a64581a429 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DependencyEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DependencyEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010-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
@@ -58,14 +58,14 @@ public class DependencyEditHelper extends DirectedRelationshipEditHelper {
if ((source != null) && !(source instanceof NamedElement)) {
return false;
}
-
+
if ((target != null) && !(target instanceof NamedElement)) {
return false;
}
-
+
return true;
}
-
+
/**
* {@inheritDoc}
*/
@@ -82,22 +82,22 @@ public class DependencyEditHelper extends DirectedRelationshipEditHelper {
ICommand command = super.getDestroyReferenceCommand(req);
- Dependency elementToEdit = (Dependency)req.getContainer();
+ Dependency elementToEdit = (Dependency) req.getContainer();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(elementToEdit.eContainer());
- if(provider == null) {
+ if (provider == null) {
return command;
}
boolean shouldDestroyDependency = false;
- if(getSourceReference().equals(req.getContainingFeature()) && (elementToEdit.getClients().size() == 1)) {
+ if (getSourceReference().equals(req.getContainingFeature()) && (elementToEdit.getClients().size() == 1)) {
shouldDestroyDependency = true;
}
- if(getTargetReference().equals(req.getContainingFeature()) && (elementToEdit.getSuppliers().size() == 1)) {
+ if (getTargetReference().equals(req.getContainingFeature()) && (elementToEdit.getSuppliers().size() == 1)) {
shouldDestroyDependency = true;
}
- if(shouldDestroyDependency) {
+ if (shouldDestroyDependency) {
DestroyElementRequest destroyRequest = new DestroyElementRequest(elementToEdit, false);
command = provider.getEditCommand(destroyRequest);
}
@@ -111,16 +111,16 @@ public class DependencyEditHelper extends DirectedRelationshipEditHelper {
@Override
protected ICommand getSetCommand(SetRequest req) {
- // If sources or targets are set with an empty list, the dependency
+ // If sources or targets are set with an empty list, the dependency
// should be destroyed.
- if(getSourceReference().equals(req.getFeature()) || getTargetReference().equals(req.getFeature())) {
+ if (getSourceReference().equals(req.getFeature()) || getTargetReference().equals(req.getFeature())) {
Object values = req.getValue();
- if((values != null) && (values instanceof EList) && ((EList<?>)values).isEmpty()) {
+ if ((values != null) && (values instanceof EList) && ((EList<?>) values).isEmpty()) {
// Get dependency destroy command from Element Edit Service
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getElementToEdit());
- if(provider != null) {
+ if (provider != null) {
DestroyElementRequest destroyRequest = new DestroyElementRequest(req.getElementToEdit(), false);
ICommand destroyCommand = provider.getEditCommand(destroyRequest);
return destroyCommand;
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DirectedRelationshipEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DirectedRelationshipEditHelper.java
index 71d6ab5f359..56309469425 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DirectedRelationshipEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/DirectedRelationshipEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -45,25 +45,25 @@ public abstract class DirectedRelationshipEditHelper extends ElementEditHelper {
/**
* Subclasses should implement this method providing the EReference to be used as source.
- *
+ *
* @return the source EReference
*/
protected abstract EReference getSourceReference();
/**
* Subclasses should implement this method providing the EReference to be used as target.
- *
+ *
* @return the target EReference
*/
protected abstract EReference getTargetReference();
/**
* Test if the relationship creation is allowed.
- *
+ *
* @param source
- * the relationship source can be null
+ * the relationship source can be null
* @param target
- * the relationship target can be null
+ * the relationship target can be null
* @return true if the creation is allowed
*/
protected abstract boolean canCreate(EObject source, EObject target);
@@ -84,15 +84,15 @@ public abstract class DirectedRelationshipEditHelper extends ElementEditHelper {
// Abort creation.
return UnexecutableCommand.INSTANCE;
}
-
- if(noSourceOrTarget && !noSourceAndTarget) {
+
+ if (noSourceOrTarget && !noSourceAndTarget) {
// The request isn't complete yet. Return the identity command so
// that the create relationship gesture is enabled.
return IdentityCommand.INSTANCE;
}
-
+
// Propose a container if none is set in request.
- EObject proposedContainer = EMFCoreUtil.getLeastCommonContainer(Arrays.asList(new EObject[]{source, target}), UMLPackage.eINSTANCE.getPackage());
+ EObject proposedContainer = EMFCoreUtil.getLeastCommonContainer(Arrays.asList(new EObject[] { source, target }), UMLPackage.eINSTANCE.getPackage());
// If no common container is found try source nearest package
EObject sourcePackage = EMFCoreUtil.getContainer(source, UMLPackage.eINSTANCE.getPackage());
@@ -105,29 +105,29 @@ public abstract class DirectedRelationshipEditHelper extends ElementEditHelper {
if ((proposedContainer == null) && !(isReadOnly(targetPackage))) {
proposedContainer = targetPackage;
}
-
+
req.setContainer(proposedContainer);
-
+
return new CreateRelationshipCommand(req);
}
private boolean isReadOnly(EObject eObject) {
EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
boolean isReadOnly = (eObject.eResource() != null) && (editingDomain.isReadOnly(eObject.eResource()));
-
+
return isReadOnly;
}
/**
* This method provides the object to be use as source.
- *
+ *
* @return the source value (EList or EObject)
*/
protected Object getSourceObject(ConfigureRequest req) {
Object result = null;
- if(getSourceReference().getUpperBound() != 1) {
+ if (getSourceReference().getUpperBound() != 1) {
EList<EObject> objects = new BasicEList<EObject>();
- objects.add((EObject)req.getParameter(CreateRelationshipRequest.SOURCE));
+ objects.add((EObject) req.getParameter(CreateRelationshipRequest.SOURCE));
result = objects;
} else {
@@ -139,14 +139,14 @@ public abstract class DirectedRelationshipEditHelper extends ElementEditHelper {
/**
* This method provides the object to be used as target.
- *
+ *
* @return the target value (EList or EObject)
*/
protected Object getTargetObject(ConfigureRequest req) {
Object result = null;
- if(getTargetReference().getUpperBound() != 1) {
+ if (getTargetReference().getUpperBound() != 1) {
EList<EObject> objects = new BasicEList<EObject>();
- objects.add((EObject)req.getParameter(CreateRelationshipRequest.TARGET));
+ objects.add((EObject) req.getParameter(CreateRelationshipRequest.TARGET));
result = objects;
} else {
@@ -164,15 +164,16 @@ public abstract class DirectedRelationshipEditHelper extends ElementEditHelper {
ICommand configureCommand = new ConfigureElementCommand(req) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- DirectedRelationship element = (DirectedRelationship)req.getElementToConfigure();
+ DirectedRelationship element = (DirectedRelationship) req.getElementToConfigure();
- if(req.getParameter(CreateRelationshipRequest.SOURCE) != null) {
+ if (req.getParameter(CreateRelationshipRequest.SOURCE) != null) {
element.eSet(getSourceReference(), getSourceObject(req));
}
- if(req.getParameter(CreateRelationshipRequest.TARGET) != null) {
+ if (req.getParameter(CreateRelationshipRequest.TARGET) != null) {
element.eSet(getTargetReference(), getTargetObject(req));
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ElementEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ElementEditHelper.java
index 795014620e5..c4e33fcf71b 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ElementEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ElementEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -29,7 +29,7 @@ import org.eclipse.uml2.uml.Element;
/**
* <pre>
- *
+ *
* Edit helper class for {@link Element}
*
* Expected behavior:
@@ -58,7 +58,7 @@ public class ElementEditHelper extends DefaultEditHelper {
@SuppressWarnings("unchecked")
@Override
protected Map<EClass, EReference> getDefaultContainmentFeatures() {
- return (Map<EClass, EReference>)super.getDefaultContainmentFeatures();
+ return super.getDefaultContainmentFeatures();
}
/**
@@ -74,13 +74,13 @@ public class ElementEditHelper extends DefaultEditHelper {
// Prepare stereotype application remove command
EObject elementToDestroy = req.getElementToDestroy();
- if(elementToDestroy instanceof Element) {
- removeStereotypeCommand = new UnapplyAllStereotypesCommand(req.getEditingDomain(), req.getLabel(), (Element)elementToDestroy);
+ if (elementToDestroy instanceof Element) {
+ removeStereotypeCommand = new UnapplyAllStereotypesCommand(req.getEditingDomain(), req.getLabel(), (Element) elementToDestroy);
}
// Compose both commands
destroyCommand = CompositeCommand.compose(removeStereotypeCommand, destroyCommand);
- if(destroyCommand != null) {
+ if (destroyCommand != null) {
destroyCommand = destroyCommand.reduce();
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExceptionHandlerEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExceptionHandlerEditHelper.java
index d8b6ca987e2..61ef66a5e64 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExceptionHandlerEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExceptionHandlerEditHelper.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -34,7 +34,6 @@ import org.eclipse.uml2.uml.ActivityNode;
import org.eclipse.uml2.uml.ExceptionHandler;
import org.eclipse.uml2.uml.ExecutableNode;
import org.eclipse.uml2.uml.ObjectNode;
-import org.eclipse.uml2.uml.Type;
/**
* Edit helper class for binary {@link ExceptionHandler}
@@ -47,29 +46,29 @@ public class ExceptionHandlerEditHelper extends ElementEditHelper {
@Override
protected ICommand getReorientRelationshipCommand(ReorientRelationshipRequest req) {
return new ExceptionHandlerReorientCommand(req);
-
+
}
/**
* Test if the relationship creation is allowed.
- *
+ *
* @param source
- * the relationship source can be null
+ * the relationship source can be null
* @param target
- * the relationship target can be null
+ * the relationship target can be null
* @param sourceView
- * the relationship graphical source can be null
+ * the relationship graphical source can be null
* @param targetView
- * the relationship graphical target can be null
+ * the relationship graphical target can be null
* @return true if the creation is allowed
*/
protected boolean canCreate(EObject source, EObject target, View sourceView, View targetView) {
- if((source != null) && !(source instanceof ActivityNode)) {
+ if ((source != null) && !(source instanceof ActivityNode)) {
return false;
}
- if((target != null) && !(target instanceof ActivityNode)) {
+ if ((target != null) && !(target instanceof ActivityNode)) {
return false;
}
@@ -87,15 +86,15 @@ public class ExceptionHandlerEditHelper extends ElementEditHelper {
boolean noSourceOrTarget = (source == null || target == null);
boolean noSourceAndTarget = (source == null && target == null);
- if(!noSourceAndTarget && !canCreate(source, target, RequestParameterUtils.getSourceView(req), RequestParameterUtils.getTargetView(req))) {
+ if (!noSourceAndTarget && !canCreate(source, target, RequestParameterUtils.getSourceView(req), RequestParameterUtils.getTargetView(req))) {
// Abort creation.
return UnexecutableCommand.INSTANCE;
}
- if(noSourceOrTarget && !noSourceAndTarget) {
+ if (noSourceOrTarget && !noSourceAndTarget) {
// The request isn't complete yet. Return the identity command so
// that the create relationship gesture is enabled.
- if(source != null && !(source instanceof ExecutableNode)) {
+ if (source != null && !(source instanceof ExecutableNode)) {
return UnexecutableCommand.INSTANCE;
}
return IdentityCommand.INSTANCE;
@@ -103,7 +102,7 @@ public class ExceptionHandlerEditHelper extends ElementEditHelper {
// Propose a semantic container for the new Exception Handler.
ExecutableNode proposedContainer = deduceContainer(req);
- if(proposedContainer == null) {
+ if (proposedContainer == null) {
return UnexecutableCommand.INSTANCE;
}
@@ -115,21 +114,21 @@ public class ExceptionHandlerEditHelper extends ElementEditHelper {
/**
* Default approach is to traverse ancestors of the source to find instance of container.
* Modify with appropriate logic.
- *
+ *
* @generated
*/
protected ExecutableNode deduceContainer(CreateRelationshipRequest req) {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = req.getSource(); element != null; element = element.eContainer()) {
- if(element instanceof ExecutableNode) {
- return (ExecutableNode)element;
+ for (EObject element = req.getSource(); element != null; element = element.eContainer()) {
+ if (element instanceof ExecutableNode) {
+ return (ExecutableNode) element;
}
}
return null;
}
-
+
/**
* {@inheritDoc}
*/
@@ -138,15 +137,16 @@ public class ExceptionHandlerEditHelper extends ElementEditHelper {
ICommand configureCommand = new ConfigureElementCommand(req) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- ExceptionHandler element = (ExceptionHandler)req.getElementToConfigure();
+ ExceptionHandler element = (ExceptionHandler) req.getElementToConfigure();
- if(req.getParameter(CreateRelationshipRequest.SOURCE) != null) {
+ if (req.getParameter(CreateRelationshipRequest.SOURCE) != null) {
element.setProtectedNode(getSourceObject(req));
}
- if(req.getParameter(CreateRelationshipRequest.TARGET) != null) {
+ if (req.getParameter(CreateRelationshipRequest.TARGET) != null) {
element.setExceptionInput(getTargetObject(req));
}
@@ -156,29 +156,29 @@ public class ExceptionHandlerEditHelper extends ElementEditHelper {
return CompositeCommand.compose(configureCommand, super.getConfigureCommand(req));
}
-
+
/**
* This method provides the object to be use as source.
- *
+ *
* @return the source value (EList or EObject)
*/
protected ExecutableNode getSourceObject(ConfigureRequest req) {
Object result = req.getParameter(CreateRelationshipRequest.SOURCE);
- if(result instanceof ExecutableNode) {
- return (ExecutableNode)result;
+ if (result instanceof ExecutableNode) {
+ return (ExecutableNode) result;
}
return null;
}
/**
* This method provides the object to be used as target.
- *
+ *
* @return the target value (EList or EObject)
*/
protected ObjectNode getTargetObject(ConfigureRequest req) {
Object result = req.getParameter(CreateRelationshipRequest.TARGET);
- if(result instanceof ObjectNode) {
- return (ObjectNode)result;
+ if (result instanceof ObjectNode) {
+ return (ObjectNode) result;
}
return null;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExpansionNodeHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExpansionNodeHelper.java
index 544ec7ef403..7eecd6f765f 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExpansionNodeHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExpansionNodeHelper.java
@@ -11,24 +11,22 @@ import org.eclipse.uml2.uml.ExpansionRegion;
public class ExpansionNodeHelper extends ActivityNodeHelper {
- /**
- * Parameter name for {@link ConfigureRequest}
- * Used to pass the parent EObject to actual new element to set it in referenced not containment list.
+ /**
+ * Parameter name for {@link ConfigureRequest} Used to pass the parent EObject to actual new element to set it in referenced not containment list.
*/
public static final String IN_EXPANSION_REGION = "IN_EXPANSION_REGION";
-
- /**
- * Parameter name for {@link ConfigureRequest}
- * Used to determine feature to add new element in referenced not containment parent list.
+
+ /**
+ * Parameter name for {@link ConfigureRequest} Used to determine feature to add new element in referenced not containment parent list.
*/
public static final String EXPANSION_REGION_FEATURE = "EXPANSION_REGION_FEATURE";
-
+
@Override
protected ICommand getConfigureCommand(ConfigureRequest req) {
- EObject expectedExpansionRegion = (EObject)req.getParameter(IN_EXPANSION_REGION);
+ EObject expectedExpansionRegion = (EObject) req.getParameter(IN_EXPANSION_REGION);
if (expectedExpansionRegion instanceof ExpansionRegion) {
- EObject feature = (EObject)req.getParameter(EXPANSION_REGION_FEATURE);
- return new SetValueCommand(new SetRequest(expectedExpansionRegion, (EReference)feature, req.getElementToConfigure()));
+ EObject feature = (EObject) req.getParameter(EXPANSION_REGION_FEATURE);
+ return new SetValueCommand(new SetRequest(expectedExpansionRegion, (EReference) feature, req.getElementToConfigure()));
}
return super.getConfigureCommand(req);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExpansionRegionHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExpansionRegionHelper.java
index 64bee5c7ea2..7cefdb7af30 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExpansionRegionHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExpansionRegionHelper.java
@@ -18,17 +18,15 @@ public class ExpansionRegionHelper extends ActivityNodeHelper {
}
/**
- * This method return new request for creation {@link ExpansionNode} with right containment feature {@link ExpansionRegion#getInputElements()} and
- * {@link ExpansionRegion#getOutputElements()} are referenced list and
- * cannot contains {@link ExpansionNode}. Thats why we add new {@link ExpansionNode} element to {@link StructuredActivityNode#getNodes()}
- * containment list
- *
+ * This method return new request for creation {@link ExpansionNode} with right containment feature {@link ExpansionRegion#getInputElements()} and {@link ExpansionRegion#getOutputElements()} are referenced list and
+ * cannot contains {@link ExpansionNode}. Thats why we add new {@link ExpansionNode} element to {@link StructuredActivityNode#getNodes()} containment list
+ *
* @param ItemSemanticPolicy
- * {@link CreateElementRequest}
+ * {@link CreateElementRequest}
* @return {@link CreateElementRequest} with changed containment feature
*/
protected CreateElementRequest getCreateExpansionRegionAffixedChildRequest(CreateElementRequest req) {
- if(req == null) {
+ if (req == null) {
return null;
}
CreateElementRequest result = new CreateElementRequest(req.getEditingDomain(), req.getContainer(), req.getElementType());
@@ -40,9 +38,9 @@ public class ExpansionRegionHelper extends ActivityNodeHelper {
/**
* Method check CreateEmentRequest to create {@link ExpansionNode} It check new ElementType and check containmentFeature
- *
+ *
* @param ItemSematicPolicy
- * {@link CreateElementRequest}
+ * {@link CreateElementRequest}
* @return
*/
protected boolean isRequestToCreateExpansionNode(CreateElementRequest req) {
@@ -53,7 +51,7 @@ public class ExpansionRegionHelper extends ActivityNodeHelper {
/**
* Check can this feature add {@link ExpansionNode} to {@link ExpansionRegion#getInputElements()} or {@link ExpansionRegion#getOutputElements()}
- *
+ *
* @param {@link CreateElementRequest} containment feature.
*/
protected boolean isExpansionNodeFeature(EReference feature) {
@@ -62,9 +60,9 @@ public class ExpansionRegionHelper extends ActivityNodeHelper {
/**
* Check is this type {@link ExpansionNode}
- *
+ *
* @param type
- * the {@link CreateElementRequest} new {@link IElementType}
+ * the {@link CreateElementRequest} new {@link IElementType}
*/
protected boolean isExpansionNodeType(IElementType type) {
return UMLPackage.eINSTANCE.getExpansionNode().equals(type.getEClass());
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExtendEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExtendEditHelper.java
index 15c42b3a5b7..c1b12efa57d 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExtendEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ExtendEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -26,7 +26,7 @@ import org.eclipse.uml2.uml.UseCase;
* This helper provides edit commands for UML {@link Extend}.
*/
public class ExtendEditHelper extends DirectedRelationshipEditHelper {
-
+
/**
* {@inheritDoc}
*/
@@ -52,18 +52,18 @@ public class ExtendEditHelper extends DirectedRelationshipEditHelper {
if ((source != null) && !(source instanceof UseCase)) {
return false;
}
-
+
if ((target != null) && !(target instanceof UseCase)) {
return false;
}
-
+
if ((source != null) && (target != null) && (source == target)) {
return false;
}
-
+
return true;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/GeneralizationEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/GeneralizationEditHelper.java
index 61b948f8112..9e4018bd1a0 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/GeneralizationEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/GeneralizationEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2010-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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -56,18 +56,18 @@ public class GeneralizationEditHelper extends DirectedRelationshipEditHelper {
if ((source != null) && !(source instanceof Classifier)) {
return false;
}
-
+
if ((target != null) && !(target instanceof Classifier)) {
return false;
}
-
+
if ((source != null) && (target != null) && (source == target)) {
return false;
}
-
+
return true;
}
-
+
/**
* {@inheritDoc}
*/
@@ -84,8 +84,8 @@ public class GeneralizationEditHelper extends DirectedRelationshipEditHelper {
// Abort creation.
return UnexecutableCommand.INSTANCE;
}
-
- if(noSourceOrTarget && !noSourceAndTarget) {
+
+ if (noSourceOrTarget && !noSourceAndTarget) {
// The request isn't complete yet. Return the identity command so
// that the create relationship gesture is enabled.
return IdentityCommand.INSTANCE;
@@ -94,10 +94,10 @@ public class GeneralizationEditHelper extends DirectedRelationshipEditHelper {
// Propose a container if none is set in request.
EObject proposedContainer = source;
req.setContainer(proposedContainer);
-
+
return new CreateRelationshipCommand(req);
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/IncludeEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/IncludeEditHelper.java
index 3d1fdf8670b..f7c3d8a9faa 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/IncludeEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/IncludeEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -52,18 +52,18 @@ public class IncludeEditHelper extends DirectedRelationshipEditHelper {
if ((source != null) && !(source instanceof UseCase)) {
return false;
}
-
+
if ((target != null) && !(target instanceof UseCase)) {
return false;
}
-
+
if ((source != null) && (target != null) && (source == target)) {
return false;
}
-
+
return true;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InformationFlowEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InformationFlowEditHelper.java
index 2a52ca1c796..6e131907c60 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InformationFlowEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InformationFlowEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -52,14 +52,14 @@ public class InformationFlowEditHelper extends DirectedRelationshipEditHelper {
if ((source != null) && !(source instanceof NamedElement)) {
return false;
}
-
+
if ((target != null) && !(target instanceof NamedElement)) {
return false;
}
-
+
return true;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InterfaceRealizationEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InterfaceRealizationEditHelper.java
index a97a2957c89..9bbd63a5a9c 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InterfaceRealizationEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InterfaceRealizationEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -52,15 +52,15 @@ public class InterfaceRealizationEditHelper extends DependencyEditHelper {
@Override
protected boolean canCreate(EObject source, EObject target) {
- if((source != null) && !(source instanceof BehavioredClassifier)) {
+ if ((source != null) && !(source instanceof BehavioredClassifier)) {
return false;
}
- if((target != null) && !(target instanceof Interface)) {
+ if ((target != null) && !(target instanceof Interface)) {
return false;
}
- if((source != null) && (target != null) && (source == target)) {
+ if ((source != null) && (target != null) && (source == target)) {
return false;
}
@@ -76,12 +76,12 @@ public class InterfaceRealizationEditHelper extends DependencyEditHelper {
}
/**
- *
+ *
* @see org.eclipse.papyrus.uml.service.types.helper.DirectedRelationshipEditHelper#getCreateRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest)
*
* @param req
* @return
- * the command to use to create the interface realization link
+ * the command to use to create the interface realization link
*/
@Override
protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) {
@@ -91,17 +91,17 @@ public class InterfaceRealizationEditHelper extends DependencyEditHelper {
}
/**
- *
+ *
* @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#configureRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
+ *
* @param request
- * the request
+ * the request
*/
@Override
protected void configureRequest(final IEditCommandRequest request) {
super.configureRequest(request);
- if(request instanceof CreateRelationshipRequest) {
- ((CreateRelationshipRequest)request).setContainer(((CreateRelationshipRequest)request).getSource());
+ if (request instanceof CreateRelationshipRequest) {
+ ((CreateRelationshipRequest) request).setContainer(((CreateRelationshipRequest) request).getSource());
}
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InterruptibleActivityRegionHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InterruptibleActivityRegionHelper.java
index d72b16e195a..914eaab21f0 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InterruptibleActivityRegionHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/InterruptibleActivityRegionHelper.java
@@ -19,18 +19,19 @@ import org.eclipse.uml2.uml.InterruptibleActivityRegion;
import org.eclipse.uml2.uml.UMLPackage;
public class InterruptibleActivityRegionHelper extends ActivityGroupHelper {
-
+
@Override
protected ICommand getCreateCommand(CreateElementRequest req) {
CreateElementRequest createRequest = isActivityNode(req.getElementType()) ? initCreateActivityNodeRequestInInterruptibleRegion(req) : req;
return super.getCreateCommand(createRequest);
}
-
+
/**
- * {@link InterruptibleActivityRegion} cannot contain any {@link ActivityNode}.
+ * {@link InterruptibleActivityRegion} cannot contain any {@link ActivityNode}.
* That's why we create new element in {@link Activity} and added it to {@link InterruptibleActivityRegion#getNodes()} referenced list
- *
- * @param baseReq {@link CreateElementRequest} from ItemSemanticEditPolicy with not containment {@link InterruptibleActivityRegion#getNodes()} feature
+ *
+ * @param baseReq
+ * {@link CreateElementRequest} from ItemSemanticEditPolicy with not containment {@link InterruptibleActivityRegion#getNodes()} feature
* @return new {@link CreateElementRequest} with {@link Activity} as container and right containment {@link ActivityNode} feature
*/
protected CreateElementRequest initCreateActivityNodeRequestInInterruptibleRegion(CreateElementRequest baseReq) {
@@ -38,16 +39,16 @@ public class InterruptibleActivityRegionHelper extends ActivityGroupHelper {
return null;
}
CreateElementRequest req = new CreateElementRequest(baseReq.getElementType());
- InterruptibleActivityRegion inrruptibleActivityRegion = ((InterruptibleActivityRegion)baseReq.getContainer());
+ InterruptibleActivityRegion inrruptibleActivityRegion = ((InterruptibleActivityRegion) baseReq.getContainer());
req.setContainer(inrruptibleActivityRegion.getInActivity());
req.setContainmentFeature(findActivityFeature(baseReq.getElementType().getEClass()));
req.setParameter(ActivityNodeHelper.IN_INTERRUPTIBLE_ACTIVITY_REGION, inrruptibleActivityRegion);
return req;
}
-
+
/**
* Find {@link Activity} feature appropriate to {@link InterruptibleActivityRegion} feature.
- *
+ *
* @return Appropriate feature.
*/
protected EReference findActivityFeature(EClass eClass) {
@@ -56,11 +57,11 @@ public class InterruptibleActivityRegionHelper extends ActivityGroupHelper {
}
return UMLPackage.eINSTANCE.getActivity_OwnedNode();
}
-
+
private boolean isActivityNode(IElementType type) {
return UMLPackage.eINSTANCE.getActivityNode().isSuperTypeOf(type.getEClass());
}
-
+
@Override
protected ICommand getMoveCommand(MoveRequest req) {
if (req != null) {
@@ -70,45 +71,48 @@ public class InterruptibleActivityRegionHelper extends ActivityGroupHelper {
}
return super.getMoveCommand(req);
}
-
+
private boolean isTargetContainerInterruptibleActivityRegioin(MoveRequest req) {
return req.getTargetContainer() instanceof InterruptibleActivityRegion;
}
-
+
/**
* This method create {@link CompositeCommand}. It contain redirected {@link MoveCommand} to Activity
* and commands to set references on ActivityNodes for base container which can't contain they.
- *
- * @param req base {@MoveRequest}
- * @param featureToSetReference {@link EReference} to set {@link ActivityNode} in base request target container's referenced list
+ *
+ * @param req
+ * base {@MoveRequest}
+ * @param featureToSetReference
+ * {@link EReference} to set {@link ActivityNode} in base request target container's referenced list
* @return {@link CompositeCommand} which contain {@link MoveCommand} elements to Activity and {@link SetValueCommand}s to base container's referenced list
*/
protected ICommand createMoveCommandWithSetReference(MoveRequest req, EReference featureToSetReference) {
- EObject nonContainmentContainer = (EObject)req.getTargetContainer();
+ EObject nonContainmentContainer = req.getTargetContainer();
CompositeCommand result = new CompositeCommand("Move elements in non containment Activity container");
MoveElementsCommand moveCommand = new NotContainmentMoveCommand(createMoveToActivityRequest(req));
result.add(moveCommand);
- for (Object o: req.getElementsToMove().keySet()) {
+ for (Object o : req.getElementsToMove().keySet()) {
if (o instanceof ActivityNode) {
result.add(new SetValueCommand(new SetRequest(nonContainmentContainer, featureToSetReference, o)));
}
}
return result;
}
-
+
/**
- * @param base move request in which target container can't contain {@link ActivityNode}
+ * @param base
+ * move request in which target container can't contain {@link ActivityNode}
* @return {@link MoveRequest} in which replaced base container on {@link Activity}and replaced containment features for it.
*/
protected MoveRequest createMoveToActivityRequest(MoveRequest baseReq) {
if (baseReq == null) {
return null;
}
- MoveRequest result = new MoveRequest(baseReq.getEditingDomain(), ((InterruptibleActivityRegion)(baseReq.getTargetContainer())).getInActivity(), baseReq.getElementsToMove());
+ MoveRequest result = new MoveRequest(baseReq.getEditingDomain(), ((InterruptibleActivityRegion) (baseReq.getTargetContainer())).getInActivity(), baseReq.getElementsToMove());
for (Object o : baseReq.getElementsToMove().keySet()) {
if (o instanceof ActivityNode) {
- ActivityNode node = (ActivityNode)o;
- result.setTargetFeature(node ,findActivityFeature(node.eClass()));
+ ActivityNode node = (ActivityNode) o;
+ result.setTargetFeature(node, findActivityFeature(node.eClass()));
}
}
return result;
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/LiteralIntegerEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/LiteralIntegerEditHelper.java
index 8e5661ed648..a326163c47e 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/LiteralIntegerEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/LiteralIntegerEditHelper.java
@@ -15,35 +15,35 @@ public class LiteralIntegerEditHelper extends ElementEditHelper {
/**
* @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#getSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
- *
+ *
* @param req
* @return
*/
@Override
protected ICommand getSetCommand(SetRequest req) {
- LiteralInteger element = (LiteralInteger)req.getElementToEdit();
+ LiteralInteger element = (LiteralInteger) req.getElementToEdit();
EObject eContainer = element.eContainer();
Object value = req.getValue();
- if(eContainer instanceof InteractionConstraint) {
- InteractionConstraint parent = (InteractionConstraint)eContainer;
+ if (eContainer instanceof InteractionConstraint) {
+ InteractionConstraint parent = (InteractionConstraint) eContainer;
EStructuralFeature eContainingFeature = element.eContainingFeature();
- if(UMLPackage.eINSTANCE.getInteractionConstraint_Minint() == eContainingFeature) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint_Minint() == eContainingFeature) {
Integer minintValue = InteractionConstraintUtil.getNonNegativeInteger(value);
- if(minintValue == null) {
+ if (minintValue == null) {
return UnexecutableCommand.INSTANCE;
}
Integer maxintValue = InteractionConstraintUtil.getMaxintValue(parent);
- if(maxintValue != null && maxintValue.intValue() < minintValue.intValue()) {
+ if (maxintValue != null && maxintValue.intValue() < minintValue.intValue()) {
return UnexecutableCommand.INSTANCE;
}
- } else if(UMLPackage.eINSTANCE.getInteractionConstraint_Maxint() == eContainingFeature) {
+ } else if (UMLPackage.eINSTANCE.getInteractionConstraint_Maxint() == eContainingFeature) {
Integer maxintValue = InteractionConstraintUtil.getNonNegativeInteger(value);
- if(maxintValue == null || maxintValue.intValue() == 0) {
+ if (maxintValue == null || maxintValue.intValue() == 0) {
return UnexecutableCommand.INSTANCE;
}
Integer minintValue = InteractionConstraintUtil.getMinintValue(parent);
- if(minintValue != null && maxintValue.intValue() < minintValue.intValue()) {
+ if (minintValue != null && maxintValue.intValue() < minintValue.intValue()) {
return UnexecutableCommand.INSTANCE;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/MessageEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/MessageEditHelper.java
index 876c846303a..db4c54c8414 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/MessageEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/MessageEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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
*
*****************************************************************************/
@@ -21,6 +21,7 @@ import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
@@ -46,9 +47,9 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* <pre>
- *
+ *
* This helper provides edit commands for UML {@link Message}.
- *
+ *
* </pre>
*/
public class MessageEditHelper extends ElementEditHelper {
@@ -58,11 +59,11 @@ public class MessageEditHelper extends ElementEditHelper {
* This method build a re-orient command depending on the kind of Message,
* and compose this basic command with another which updates the MessageEnd.
* </pre>
- *
+ *
* @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#getReorientRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest)
- *
+ *
* @param req
- * the re-orient request
+ * the re-orient request
* @return the re-orient command
*/
@Override
@@ -70,36 +71,36 @@ public class MessageEditHelper extends ElementEditHelper {
ICommand reorientCommand = null;
// Build the initial re-orient command depending on the kind of Message
- Message msgToReorient = (Message)req.getRelationship();
+ Message msgToReorient = (Message) req.getRelationship();
- if(msgToReorient.getMessageKind() == MessageKind.LOST_LITERAL) {
+ if (msgToReorient.getMessageKind() == MessageKind.LOST_LITERAL) {
reorientCommand = new MessageLostReorientCommand(req);
- } else if(msgToReorient.getMessageKind() == MessageKind.FOUND_LITERAL) {
+ } else if (msgToReorient.getMessageKind() == MessageKind.FOUND_LITERAL) {
reorientCommand = new MessageFoundReorientCommand(req);
- } else if(msgToReorient.getMessageSort() == MessageSort.SYNCH_CALL_LITERAL) {
+ } else if (msgToReorient.getMessageSort() == MessageSort.SYNCH_CALL_LITERAL) {
reorientCommand = new MessageSyncReorientCommand(req);
- } else if(msgToReorient.getMessageSort() == MessageSort.ASYNCH_CALL_LITERAL) {
+ } else if (msgToReorient.getMessageSort() == MessageSort.ASYNCH_CALL_LITERAL) {
reorientCommand = new MessageAsyncReorientCommand(req);
- } else if(msgToReorient.getMessageSort() == MessageSort.ASYNCH_SIGNAL_LITERAL) {
+ } else if (msgToReorient.getMessageSort() == MessageSort.ASYNCH_SIGNAL_LITERAL) {
reorientCommand = new MessageAsyncReorientCommand(req);
- } else if(msgToReorient.getMessageSort() == MessageSort.REPLY_LITERAL) {
+ } else if (msgToReorient.getMessageSort() == MessageSort.REPLY_LITERAL) {
reorientCommand = new MessageReplyReorientCommand(req);
- } else if(msgToReorient.getMessageSort() == MessageSort.CREATE_MESSAGE_LITERAL) {
+ } else if (msgToReorient.getMessageSort() == MessageSort.CREATE_MESSAGE_LITERAL) {
reorientCommand = new MessageCreateReorientCommand(req);
- } else if(msgToReorient.getMessageSort() == MessageSort.DELETE_MESSAGE_LITERAL) {
+ } else if (msgToReorient.getMessageSort() == MessageSort.DELETE_MESSAGE_LITERAL) {
// Forbid the target re-orient command of delete Message.
// The re-orient command is provided but the MessageEnd update is not correctly implemented.
- if(req.getDirection() == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (req.getDirection() == ReorientRequest.REORIENT_SOURCE) {
reorientCommand = new MessageDeleteReorientCommand(req);
- } else if(req.getDirection() == ReorientRelationshipRequest.REORIENT_TARGET) {
+ } else if (req.getDirection() == ReorientRequest.REORIENT_TARGET) {
// Not correctly implemented - Forbid this kind of re-orient for now.
reorientCommand = UnexecutableCommand.INSTANCE;
}
@@ -109,13 +110,13 @@ public class MessageEditHelper extends ElementEditHelper {
ICommand updateMessageEndCommand = null;
MessageEnd msgEndToUpdate = null;
- if(req.getDirection() == ReorientRelationshipRequest.REORIENT_SOURCE) {
+ if (req.getDirection() == ReorientRequest.REORIENT_SOURCE) {
msgEndToUpdate = msgToReorient.getSendEvent();
- } else if(req.getDirection() == ReorientRelationshipRequest.REORIENT_TARGET) {
+ } else if (req.getDirection() == ReorientRequest.REORIENT_TARGET) {
msgEndToUpdate = msgToReorient.getReceiveEvent();
}
- updateMessageEndCommand = getUpdateMessageEndCommand(msgEndToUpdate, (Element)req.getOldRelationshipEnd(), (Element)req.getNewRelationshipEnd());
+ updateMessageEndCommand = getUpdateMessageEndCommand(msgEndToUpdate, (Element) req.getOldRelationshipEnd(), (Element) req.getNewRelationshipEnd());
// Compose both commands
reorientCommand = CompositeCommand.compose(reorientCommand, updateMessageEndCommand);
@@ -127,23 +128,23 @@ public class MessageEditHelper extends ElementEditHelper {
* <pre>
* This method provides a command to update the {@link MessageEnd} concerned by a re-orient request.
* </pre>
- *
+ *
* @param messageEnd
- * the {@link MessageEnd} concerned by the re-orient command
+ * the {@link MessageEnd} concerned by the re-orient command
* @param oldElement
- * the old {@link Element} graphically attached to the {@link Message}
+ * the old {@link Element} graphically attached to the {@link Message}
* @param newElement
- * the new {@link Element} graphically attached to the {@link Message}
+ * the new {@link Element} graphically attached to the {@link Message}
* @return the update command
*/
private ICommand getUpdateMessageEndCommand(MessageEnd messageEnd, Element oldElement, Element newElement) {
ICommand updateCommand = null;
- if(messageEnd instanceof MessageOccurrenceSpecification) {
- updateCommand = getUpdateMessageOccurenceSpecificationCommand((MessageOccurrenceSpecification)messageEnd, oldElement, newElement);
- } else if(messageEnd instanceof Gate) { // Gate case is not currently implemented
- updateCommand = getUpdateGateCommand((Gate)messageEnd, oldElement, newElement);
+ if (messageEnd instanceof MessageOccurrenceSpecification) {
+ updateCommand = getUpdateMessageOccurenceSpecificationCommand((MessageOccurrenceSpecification) messageEnd, oldElement, newElement);
+ } else if (messageEnd instanceof Gate) { // Gate case is not currently implemented
+ updateCommand = getUpdateGateCommand((Gate) messageEnd, oldElement, newElement);
}
return updateCommand;
@@ -153,25 +154,25 @@ public class MessageEditHelper extends ElementEditHelper {
* <pre>
* This method provides a command to update the {@link MessageOccurrenceSpecification} concerned by a re-orient request.
* </pre>
- *
+ *
* @param messageEnd
- * the {@link MessageOccurrenceSpecification} concerned by the re-orient command
+ * the {@link MessageOccurrenceSpecification} concerned by the re-orient command
* @param oldElement
- * the old {@link Element} graphically attached to the {@link Message}
+ * the old {@link Element} graphically attached to the {@link Message}
* @param newElement
- * the new {@link Element} graphically attached to the {@link Message}
+ * the new {@link Element} graphically attached to the {@link Message}
* @return the update command
*/
private ICommand getUpdateMessageOccurenceSpecificationCommand(MessageOccurrenceSpecification messageEnd, Element oldElement, Element newElement) {
ICommand updateCommand = null;
- if(newElement instanceof Lifeline) {
- updateCommand = getUpdateOccurenceSpecificationCommand(messageEnd, (Lifeline)newElement);
+ if (newElement instanceof Lifeline) {
+ updateCommand = getUpdateOccurenceSpecificationCommand(messageEnd, (Lifeline) newElement);
- } else if(newElement instanceof ExecutionSpecification) {
- Lifeline lifeline = ExecutionSpecificationUtil.getExecutionSpecificationLifeline((ExecutionSpecification)newElement);
- if(lifeline != null) {
+ } else if (newElement instanceof ExecutionSpecification) {
+ Lifeline lifeline = ExecutionSpecificationUtil.getExecutionSpecificationLifeline((ExecutionSpecification) newElement);
+ if (lifeline != null) {
updateCommand = getUpdateOccurenceSpecificationCommand(messageEnd, lifeline);
}
@@ -184,11 +185,11 @@ public class MessageEditHelper extends ElementEditHelper {
* <pre>
* This method provides a command to update the {@link OccurrenceSpecification} concerned by a re-orient request.
* </pre>
- *
+ *
* @param os
- * the {@link OccurrenceSpecification} concerned by the re-orient command
+ * the {@link OccurrenceSpecification} concerned by the re-orient command
* @param newLifeline
- * the new {@link Lifeline} graphically covered by the {@link OccurrenceSpecification}
+ * the new {@link Lifeline} graphically covered by the {@link OccurrenceSpecification}
* @return the update command
*/
private ICommand getUpdateOccurenceSpecificationCommand(OccurrenceSpecification os, Lifeline newLifeline) {
@@ -199,7 +200,7 @@ public class MessageEditHelper extends ElementEditHelper {
covereds.add(newLifeline);
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(os);
- if(provider != null) {
+ if (provider != null) {
// Create a command the set the OccurenceSpecification covered EReference with the newLifeline
SetRequest setCoveredRequest = new SetRequest(os, UMLPackage.eINSTANCE.getInteractionFragment_Covered(), covereds);
@@ -216,13 +217,13 @@ public class MessageEditHelper extends ElementEditHelper {
*
* TODO : Not currently implemented.
* </pre>
- *
+ *
* @param gate
- * the {@link Gate} concerned by the re-orient command
+ * the {@link Gate} concerned by the re-orient command
* @param oldElement
- * the old {@link Element} graphically attached to the {@link Message}
+ * the old {@link Element} graphically attached to the {@link Message}
* @param newElement
- * the new {@link Element} graphically attached to the {@link Message}
+ * the new {@link Element} graphically attached to the {@link Message}
* @return the update command
*/
private ICommand getUpdateGateCommand(Gate gate, Element oldElement, Element newElement) {
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ObjectFlowEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ObjectFlowEditHelper.java
index 5f3b4562c4a..9a238d0ef2a 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ObjectFlowEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ObjectFlowEditHelper.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -50,15 +50,15 @@ public class ObjectFlowEditHelper extends ElementEditHelper {
/**
* Test if the relationship creation is allowed.
- *
+ *
* @param source
- * the relationship source can be null
+ * the relationship source can be null
* @param target
- * the relationship target can be null
+ * the relationship target can be null
* @param sourceView
- * the relationship graphical source can be null
+ * the relationship graphical source can be null
* @param targetView
- * the relationship graphical target can be null
+ * the relationship graphical target can be null
* @return true if the creation is allowed
*/
protected boolean canCreate(EObject source, EObject target, View sourceView, View targetView) {
@@ -74,21 +74,21 @@ public class ObjectFlowEditHelper extends ElementEditHelper {
EObject target = req.getTarget();
boolean noSourceOrTarget = (source == null || target == null);
boolean noSourceAndTarget = (source == null && target == null);
- if(!noSourceAndTarget && !canCreate(source, target, RequestParameterUtils.getSourceView(req), RequestParameterUtils.getTargetView(req))) {
+ if (!noSourceAndTarget && !canCreate(source, target, RequestParameterUtils.getSourceView(req), RequestParameterUtils.getTargetView(req))) {
// Abort creation.
return UnexecutableCommand.INSTANCE;
}
- if(noSourceOrTarget && !noSourceAndTarget) {
+ if (noSourceOrTarget && !noSourceAndTarget) {
// The request isn't complete yet. Return the identity command so
// that the create relationship gesture is enabled.
- if(source != null && !(source instanceof ActivityNode)) {
+ if (source != null && !(source instanceof ActivityNode)) {
return UnexecutableCommand.INSTANCE;
}
return IdentityCommand.INSTANCE;
}
// Propose a semantic container for the new control flow.
Activity proposedContainer = deduceContainer(req);
- if(proposedContainer == null) {
+ if (proposedContainer == null) {
return UnexecutableCommand.INSTANCE;
}
req.setContainer(proposedContainer);
@@ -103,9 +103,9 @@ public class ObjectFlowEditHelper extends ElementEditHelper {
// Find container element for the new link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null; element = element.eContainer()) {
- if(element instanceof Activity) {
- return (Activity)element;
+ for (EObject element = source; element != null; element = element.eContainer()) {
+ if (element instanceof Activity) {
+ return (Activity) element;
}
}
return null;
@@ -118,14 +118,15 @@ public class ObjectFlowEditHelper extends ElementEditHelper {
protected ICommand getConfigureCommand(final ConfigureRequest req) {
ICommand configureCommand = new ConfigureElementCommand(req) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- ObjectFlow element = (ObjectFlow)req.getElementToConfigure();
+ ObjectFlow element = (ObjectFlow) req.getElementToConfigure();
ActivityNode source = getSourceObject(req);
ActivityNode target = getTargetObject(req);
- if(source != null) {
+ if (source != null) {
element.setSource(getSourceObject(req));
}
- if(target != null) {
+ if (target != null) {
element.setTarget(target);
}
return CommandResult.newOKCommandResult(element);
@@ -136,39 +137,39 @@ public class ObjectFlowEditHelper extends ElementEditHelper {
/**
* This method provides the object to be use as source.
- *
+ *
* @return the source value
*/
protected ActivityNode getSourceObject(ConfigureRequest req) {
Object result = req.getParameter(CreateRelationshipRequest.SOURCE);
- return (result instanceof ActivityNode) ? (ActivityNode)result : null;
+ return (result instanceof ActivityNode) ? (ActivityNode) result : null;
}
/**
* This method provides the object to be used as target.
- *
+ *
* @return the target value
*/
protected ActivityNode getTargetObject(ConfigureRequest req) {
Object result = req.getParameter(CreateRelationshipRequest.TARGET);
- return (result instanceof ActivityNode) ? (ActivityNode)result : null;
+ return (result instanceof ActivityNode) ? (ActivityNode) result : null;
}
/**
* {@inheritDoc}
*/
protected boolean canCreate(EObject source, EObject target) {
- if((source != null) && !(source instanceof ActivityNode)) {
+ if ((source != null) && !(source instanceof ActivityNode)) {
return false;
}
- if((target != null) && !(target instanceof ActivityNode)) {
+ if ((target != null) && !(target instanceof ActivityNode)) {
return false;
}
-
+
Activity container = deduceContainer(source, target);
- if(container == null) {
+ if (container == null) {
return false;
}
- return ObjectFlowUtil.canExistObjectFlow(container, null, (ActivityNode)source, (ActivityNode)target);
+ return ObjectFlowUtil.canExistObjectFlow(container, null, (ActivityNode) source, (ActivityNode) target);
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ObjectNodeHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ObjectNodeHelper.java
index 520f1317376..ec829c9a8bb 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ObjectNodeHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ObjectNodeHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,7 +35,7 @@ public class ObjectNodeHelper extends ElementEditHelper {
@Override
protected ICommand getBasicDestroyElementCommand(DestroyElementRequest req) {
- ICommand result = new DestroyActivityNode(req);
+ ICommand result = new DestroyActivityNode(req);
return result;
}
@@ -44,42 +44,45 @@ public class ObjectNodeHelper extends ElementEditHelper {
* inner class for the destruction of element
*
*/
- private class DestroyActivityNode extends DestroyElementCommand{
+ private class DestroyActivityNode extends DestroyElementCommand {
+
+ private Command emfcmd = null;
- private Command emfcmd=null;
public DestroyActivityNode(DestroyElementRequest request) {
super(request);
}
+
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- //this code comes from super class and we replace explicitly by a call of the command of UML
+ throws ExecutionException {
+ // this code comes from super class and we replace explicitly by a call of the command of UML
// for node specific commands have been done
EObject destructee = getElementToDestroy();
// only destroy attached elements
if ((destructee != null) && (destructee.eResource() != null)) {
-
+
// here has been commented because uml commands take all in charge
// tear down incoming references
- //tearDownIncomingReferences(destructee);
+ // tearDownIncomingReferences(destructee);
// also tear down outgoing references, because we don't want
- // reverse-reference lookups to find destroyed objects
- //tearDownOutgoingReferences(destructee);
+ // reverse-reference lookups to find destroyed objects
+ // tearDownOutgoingReferences(destructee);
// remove the object from its container
- emfcmd=DeleteCommand.create(getRequest().getEditingDomain(),getElementToDestroy());
+ emfcmd = DeleteCommand.create(getRequest().getEditingDomain(), getElementToDestroy());
if (emfcmd != null && emfcmd.canExecute()) {
emfcmd.execute();
}
- // here has been commented because uml commands take all in charge
- // in case it was cross-resource-contained
- // Resource res = destructee.eResource();
- // if (res != null) {
- //res.getContents().remove(destructee);
- // }
+ // here has been commented because uml commands take all in charge
+ // in case it was cross-resource-contained
+ // Resource res = destructee.eResource();
+ // if (res != null) {
+ // res.getContents().remove(destructee);
+ // }
}
return CommandResult.newOKCommandResult();
@@ -88,8 +91,8 @@ public class ObjectNodeHelper extends ElementEditHelper {
@Override
protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // The undo has to be explicitly called
- emfcmd.canUndo();
+ // The undo has to be explicitly called
+ emfcmd.canUndo();
emfcmd.undo();
return Status.OK_STATUS;
@@ -97,12 +100,12 @@ public class ObjectNodeHelper extends ElementEditHelper {
@Override
protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // The redo has to be explicitly called
- //IStatus status =super.doRedo(monitor, info);
+ // The redo has to be explicitly called
+ // IStatus status =super.doRedo(monitor, info);
// IStatus status =super.doRedo(monitor, info);
// emfcmd.canExecute();
emfcmd.redo();
-
+
return Status.OK_STATUS;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/PinEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/PinEditHelper.java
index f4763a5602d..1efb0331602 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/PinEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/PinEditHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2011 Atos.
*
- *
+ *
* 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
@@ -27,45 +27,46 @@ import org.eclipse.uml2.uml.Pin;
/**
* PinEditHelper. used for:
- * -> Delete command should delete incoming and outgoing activity edge from the model
+ * -> Delete command should delete incoming and outgoing activity edge from the model
+ *
* @author arthur daussy
*
*/
-public class PinEditHelper extends ElementEditHelper{
+public class PinEditHelper extends ElementEditHelper {
@Override
- protected ICommand getBasicDestroyElementCommand(DestroyElementRequest req) {
+ protected ICommand getBasicDestroyElementCommand(DestroyElementRequest req) {
ICommand cmd = super.getBasicDestroyElementCommand(req);
CompositeTransactionalCommand cc = new CompositeTransactionalCommand(req.getEditingDomain(), "Destroy Pin Command");////$NON-NLS-1$
- if ( cmd != null && cmd.canExecute()){
+ if (cmd != null && cmd.canExecute()) {
cc.compose(cmd);
}
cc.compose(cmd);
EObject pin_ = req.getElementToDestroy();
- if (pin_ instanceof Pin){
+ if (pin_ instanceof Pin) {
Set<ActivityEdge> edgesToDestroy = new HashSet<ActivityEdge>();
- Pin pin = (Pin)pin_;
- //Destroy incoming edge
- for (ActivityEdge activityEdge : pin.getIncomings()){
- if ( activityEdge != null){
+ Pin pin = (Pin) pin_;
+ // Destroy incoming edge
+ for (ActivityEdge activityEdge : pin.getIncomings()) {
+ if (activityEdge != null) {
edgesToDestroy.add(activityEdge);
}
}
- //Destroy outgoing edge
- for (ActivityEdge activityEdge : pin.getOutgoings()){
- if ( activityEdge != null){
+ // Destroy outgoing edge
+ for (ActivityEdge activityEdge : pin.getOutgoings()) {
+ if (activityEdge != null) {
edgesToDestroy.add(activityEdge);
}
}
- for ( ActivityEdge edgeToDstroy : edgesToDestroy){
+ for (ActivityEdge edgeToDstroy : edgesToDestroy) {
DestroyElementPapyrusCommand destroyCommand = new DestroyElementPapyrusCommand(new DestroyElementRequest(req.getEditingDomain(), edgeToDstroy, false));
- if ( destroyCommand != null && destroyCommand.canExecute()){
+ if (destroyCommand != null && destroyCommand.canExecute()) {
cc.compose(destroyCommand);
}
}
}
return cc;
}
-
-
+
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/PortEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/PortEditHelper.java
index a44dff151c3..c4f44425218 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/PortEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/PortEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2010-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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -33,14 +33,14 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* <pre>
- *
+ *
* Edit helper class for {@link Port}
*
* Expected behavior:
* - Initialize {@link AggregationKind} on {@link Port} creation.
* - Forbid aggregation modification during the element life cycle.
* - Restrict creation context.
- *
+ *
* </pre>
*/
public class PortEditHelper extends ElementEditHelper {
@@ -50,7 +50,7 @@ public class PortEditHelper extends ElementEditHelper {
*/
@Override
protected ICommand getEditContextCommand(GetEditContextRequest req) {
-
+
// Avoid Port creation is the container is not an EncapsulatedClassifier (return null edit context).
if (req.getEditCommandRequest() instanceof CreateElementRequest) {
CreateElementRequest createRequest = (CreateElementRequest) req.getEditCommandRequest();
@@ -59,7 +59,7 @@ public class PortEditHelper extends ElementEditHelper {
}
return null;
}
-
+
return super.getEditContextCommand(req);
}
@@ -68,18 +68,19 @@ public class PortEditHelper extends ElementEditHelper {
*/
@Override
protected ICommand getConfigureCommand(final ConfigureRequest req) {
-
+
ICommand configureCommand = new ConfigureElementCommand(req) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- Port element = (Port)req.getElementToConfigure();
+ Port element = (Port) req.getElementToConfigure();
element.setAggregation(AggregationKind.COMPOSITE_LITERAL);
return CommandResult.newOKCommandResult(element);
}
};
-
+
return CompositeCommand.compose(configureCommand, super.getConfigureCommand(req));
}
@@ -90,7 +91,7 @@ public class PortEditHelper extends ElementEditHelper {
protected ICommand getSetCommand(SetRequest req) {
// Forbid any attempt to change Port aggregation
- if(UMLPackage.eINSTANCE.getProperty_Aggregation().equals(req.getFeature())) {
+ if (UMLPackage.eINSTANCE.getProperty_Aggregation().equals(req.getFeature())) {
return UnexecutableCommand.INSTANCE;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ProtocolConformanceEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ProtocolConformanceEditHelper.java
index 8a30a4f898b..a0e561a0c5d 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ProtocolConformanceEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ProtocolConformanceEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -52,18 +52,18 @@ public class ProtocolConformanceEditHelper extends DirectedRelationshipEditHelpe
if ((source != null) && !(source instanceof ProtocolStateMachine)) {
return false;
}
-
+
if ((target != null) && !(target instanceof ProtocolStateMachine)) {
return false;
}
-
+
if ((source != null) && (target != null) && (source == target)) {
return false;
}
-
+
return true;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ProtocolStateMachineEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ProtocolStateMachineEditHelper.java
index a11851dcc28..9bee75d8b59 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ProtocolStateMachineEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ProtocolStateMachineEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -25,12 +25,12 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
* <pre>
- *
+ *
* Edit helper class for {@link ProtocolStateMachine}
*
* Expected behavior:
* - Remove any related {@link ProtocolConformance}
- *
+ *
* </pre>
*/
public class ProtocolStateMachineEditHelper extends ClassEditHelper {
@@ -41,7 +41,7 @@ public class ProtocolStateMachineEditHelper extends ClassEditHelper {
@Override
protected ICommand getDestroyDependentsCommand(DestroyDependentsRequest req) {
- ProtocolStateMachine elementToDelete = (ProtocolStateMachine)req.getElementToDestroy();
+ ProtocolStateMachine elementToDelete = (ProtocolStateMachine) req.getElementToDestroy();
List<DirectedRelationship> relationships = new ArrayList<DirectedRelationship>();
// Get related ProtocolConformance
@@ -49,7 +49,7 @@ public class ProtocolStateMachineEditHelper extends ClassEditHelper {
relationships.addAll(elementToDelete.getTargetDirectedRelationships(UMLPackage.eINSTANCE.getProtocolConformance()));
// Return the command to destroy all these ProtocolConformance
- if(!relationships.isEmpty()) {
+ if (!relationships.isEmpty()) {
return req.getDestroyDependentsCommand(relationships);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/SubstitutionEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/SubstitutionEditHelper.java
index 7c676667dbd..5d5b3ea8aeb 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/SubstitutionEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/SubstitutionEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -52,18 +52,18 @@ public class SubstitutionEditHelper extends DependencyEditHelper {
if ((source != null) && !(source instanceof Classifier)) {
return false;
}
-
+
if ((target != null) && !(target instanceof Classifier)) {
return false;
}
-
+
if ((source != null) && (target != null) && (source == target)) {
return false;
}
-
+
return true;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/UseCaseEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/UseCaseEditHelper.java
index 65c7b07eb7b..bb07a006f8b 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/UseCaseEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/UseCaseEditHelper.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -25,12 +25,12 @@ import org.eclipse.uml2.uml.UseCase;
/**
* <pre>
- *
+ *
* Edit helper class for {@link UseCase}
*
* Expected behavior:
* - Remove any related {@link Include} or {@link Extend}
- *
+ *
* </pre>
*/
public class UseCaseEditHelper extends BehavioredClassifierEditHelper {
@@ -41,7 +41,7 @@ public class UseCaseEditHelper extends BehavioredClassifierEditHelper {
@Override
protected ICommand getDestroyDependentsCommand(DestroyDependentsRequest req) {
- UseCase elementToDelete = (UseCase)req.getElementToDestroy();
+ UseCase elementToDelete = (UseCase) req.getElementToDestroy();
List<DirectedRelationship> relationships = new ArrayList<DirectedRelationship>();
// Get related includes
@@ -52,7 +52,7 @@ public class UseCaseEditHelper extends BehavioredClassifierEditHelper {
relationships.addAll(elementToDelete.getTargetDirectedRelationships(UMLPackage.eINSTANCE.getExtend()));
// Return the command to destroy all these Include and Extend relationships
- if(!relationships.isEmpty()) {
+ if (!relationships.isEmpty()) {
return req.getDestroyDependentsCommand(relationships);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractStereotypedElementEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractStereotypedElementEditHelperAdvice.java
index b8d409b05ab..ac3d4755cd9 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractStereotypedElementEditHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractStereotypedElementEditHelperAdvice.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -38,9 +38,9 @@ public abstract class AbstractStereotypedElementEditHelperAdvice extends Abstrac
/**
* Check required profile application before approving the request.
- *
+ *
* @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
+ *
* @param request
* @return true if the request is approved
*/
@@ -48,23 +48,23 @@ public abstract class AbstractStereotypedElementEditHelperAdvice extends Abstrac
public boolean approveRequest(IEditCommandRequest request) {
boolean isApproved = super.approveRequest(request);
- if((request != null) && (request instanceof GetEditContextRequest)) {
+ if ((request != null) && (request instanceof GetEditContextRequest)) {
// Retrieve the edit context from request
- GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
+ GetEditContextRequest editContextRequest = (GetEditContextRequest) request;
Package profileApplicationContext = null;
// Retrieve the context nearest package (or itself)
- if(editContextRequest.getEditContext() instanceof Package) {
- profileApplicationContext = (Package)editContextRequest.getEditContext();
- } else if(editContextRequest.getEditContext() instanceof Element) {
- profileApplicationContext = ((Element)editContextRequest.getEditContext()).getNearestPackage();
+ if (editContextRequest.getEditContext() instanceof Package) {
+ profileApplicationContext = (Package) editContextRequest.getEditContext();
+ } else if (editContextRequest.getEditContext() instanceof Element) {
+ profileApplicationContext = ((Element) editContextRequest.getEditContext()).getNearestPackage();
}
// Ensure all necessary profiles are effectively applied
- if(profileApplicationContext != null) {
- for(EPackage requiredProfile : requiredProfiles) {
- if(! profileApplicationContext.getAllAppliedProfiles().contains(UMLUtil.getProfile(requiredProfile, profileApplicationContext))) {
+ if (profileApplicationContext != null) {
+ for (EPackage requiredProfile : requiredProfiles) {
+ if (!profileApplicationContext.getAllAppliedProfiles().contains(UMLUtil.getProfile(requiredProfile, profileApplicationContext))) {
isApproved = false;
break;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ActivityGroupEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ActivityGroupEditHelperAdvice.java
index f9b30221c64..3ecd40d1c5b 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ActivityGroupEditHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ActivityGroupEditHelperAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2011 Atos.
*
- *
+ *
* 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
@@ -14,85 +14,69 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.service.types.helper.advice;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyDependentsRequest;
-import org.eclipse.uml2.uml.Activity;
-import org.eclipse.uml2.uml.ActivityGroup;
-import org.eclipse.uml2.uml.UMLPackage;
/**
* Add the behavior for deletion of an activity group:
* 1 Remove a group when delete from the "group" feature
- *
+ *
* @author adaussy
- *
+ *
*/
public class ActivityGroupEditHelperAdvice extends AbstractEditHelperAdvice {
-
-
-// @Override
-// protected ICommand getAfterDestroyDependentsCommand(DestroyDependentsRequest request) {
-// CompositeCommand cc = new CompositeCommand("After Command for an Activity Node");////$NON-NLS-1$
-// /*
-// * Remove from derived feature ownedNode
-// * WARNING:
-// * This should be done in the DestroyElementPapyrusCommand however this command for now prevent removing it from derive feature.
-// * Waiting for discussion.
-// * This is a temporary discussion
-// */
-// ICommand removedFromOwnedNodeCommand = getRemoveFromDerivedFeature(request);
-// if(removedFromOwnedNodeCommand != null) {
-// cc.compose(removedFromOwnedNodeCommand);
-// }
-// if(cc != null && !cc.isEmpty()) {
-// return cc;
-// }
-// return super.getAfterDestroyDependentsCommand(request);
-// }
-//
-// /**
-// * Remove from derived polluting feature
-// *
-// * @param request
-// * @return
-// */
-// protected ICommand getRemoveFromDerivedFeature(DestroyDependentsRequest request) {
-// EObject eObject = request.getElementToDestroy();
-// if(eObject instanceof ActivityGroup) {
-// /*
-// * Destroy Activity Edge
-// */
-// final ActivityGroup activityNode = (ActivityGroup)eObject;
-// final EStructuralFeature containingFeature = activityNode.eContainingFeature();
-// if(UMLPackage.Literals.ACTIVITY__OWNED_GROUP.equals(containingFeature)) {
-// final Activity holder = (Activity)activityNode.eContainer();
-// return new AbstractTransactionalCommand((TransactionalEditingDomain)AdapterFactoryEditingDomain.getEditingDomainFor(activityNode), "Remove a group from the group feature", null) {////$NON-NLS-1$
-//
-// @Override
-// protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-// Object elements = holder.eGet(UMLPackage.Literals.ACTIVITY__GROUP);
-// if(elements instanceof EList<?>) {
-// EList<?> collection = (EList<?>)elements;
-// collection.remove(activityNode);
-// }
-// return CommandResult.newOKCommandResult();
-// }
-// };
-// }
-// }
-// return null;
-// }
+
+
+ // @Override
+ // protected ICommand getAfterDestroyDependentsCommand(DestroyDependentsRequest request) {
+ // CompositeCommand cc = new CompositeCommand("After Command for an Activity Node");////$NON-NLS-1$
+ // /*
+ // * Remove from derived feature ownedNode
+ // * WARNING:
+ // * This should be done in the DestroyElementPapyrusCommand however this command for now prevent removing it from derive feature.
+ // * Waiting for discussion.
+ // * This is a temporary discussion
+ // */
+ // ICommand removedFromOwnedNodeCommand = getRemoveFromDerivedFeature(request);
+ // if(removedFromOwnedNodeCommand != null) {
+ // cc.compose(removedFromOwnedNodeCommand);
+ // }
+ // if(cc != null && !cc.isEmpty()) {
+ // return cc;
+ // }
+ // return super.getAfterDestroyDependentsCommand(request);
+ // }
+ //
+ // /**
+ // * Remove from derived polluting feature
+ // *
+ // * @param request
+ // * @return
+ // */
+ // protected ICommand getRemoveFromDerivedFeature(DestroyDependentsRequest request) {
+ // EObject eObject = request.getElementToDestroy();
+ // if(eObject instanceof ActivityGroup) {
+ // /*
+ // * Destroy Activity Edge
+ // */
+ // final ActivityGroup activityNode = (ActivityGroup)eObject;
+ // final EStructuralFeature containingFeature = activityNode.eContainingFeature();
+ // if(UMLPackage.Literals.ACTIVITY__OWNED_GROUP.equals(containingFeature)) {
+ // final Activity holder = (Activity)activityNode.eContainer();
+ // return new AbstractTransactionalCommand((TransactionalEditingDomain)AdapterFactoryEditingDomain.getEditingDomainFor(activityNode), "Remove a group from the group feature", null) {////$NON-NLS-1$
+ //
+ // @Override
+ // protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ // Object elements = holder.eGet(UMLPackage.Literals.ACTIVITY__GROUP);
+ // if(elements instanceof EList<?>) {
+ // EList<?> collection = (EList<?>)elements;
+ // collection.remove(activityNode);
+ // }
+ // return CommandResult.newOKCommandResult();
+ // }
+ // };
+ // }
+ // }
+ // return null;
+ // }
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ActivityNodeHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ActivityNodeHelperAdvice.java
index 2da015553d0..5c881461397 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ActivityNodeHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ActivityNodeHelperAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2011 Atos.
*
- *
+ *
* 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
@@ -32,9 +32,9 @@ import com.google.common.collect.Sets;
* Add the behavior for deletion of an activity node:
* 1. Delete all activity edges starting/ending from/to a node when this node is deleted
* 2. When deleting a node remove it from derived feature "node"
- *
+ *
* @author adaussy
- *
+ *
*/
public class ActivityNodeHelperAdvice extends AbstractEditHelperAdvice {
@@ -45,96 +45,97 @@ public class ActivityNodeHelperAdvice extends AbstractEditHelperAdvice {
* Destroy edge
*/
ICommand destroyEdgeCommand = getDestroyActivityEdgeCommand(request);
- if(destroyEdgeCommand != null) {
+ if (destroyEdgeCommand != null) {
cc.compose(destroyEdgeCommand);
}
- if(cc != null && !cc.isEmpty()) {
+ if (cc != null && !cc.isEmpty()) {
return cc;
}
return super.getBeforeDestroyDependentsCommand(request);
}
-//
-// @Override
-// protected ICommand getAfterDestroyDependentsCommand(DestroyDependentsRequest request) {
-// CompositeCommand cc = new CompositeCommand("After Command for an Activity Node");////$NON-NLS-1$
-// /*
-// * Remove from derived feature ownedNode
-// * WARNING:
-// * This should be done in the DestroyElementPapyrusCommand however this command for now prevent removing it from derive feature.
-// * Waiting for discussion.
-// * This is a temporary discussion
-// */
-// ICommand removedFromOwnedNodeCommand = getRemoveFromDerivedFeature(request);
-// if(removedFromOwnedNodeCommand != null) {
-// cc.compose(removedFromOwnedNodeCommand);
-// }
-// if(cc != null && !cc.isEmpty()) {
-// return cc;
-// }
-// return super.getAfterDestroyDependentsCommand(request);
-// }
-//
-// /**
-// * Remove from derived polluting feature
-// *
-// * @param request
-// * @return
-// */
-// protected ICommand getRemoveFromDerivedFeature(DestroyDependentsRequest request) {
-// EObject eObject = request.getElementToDestroy();
-// if(eObject instanceof ActivityNode) {
-// /*
-// * Destroy Activity Edge
-// */
-// final ActivityNode activityNode = (ActivityNode)eObject;
-// final EStructuralFeature containingFeature = activityNode.eContainingFeature();
-// if(UMLPackage.Literals.ACTIVITY__OWNED_NODE.equals(containingFeature)) {
-// final Activity holder = (Activity)activityNode.eContainer();
-// return new AbstractTransactionalCommand((TransactionalEditingDomain)AdapterFactoryEditingDomain.getEditingDomainFor(activityNode), "test", null) {
-//
-// @Override
-// protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-// Object elements = holder.eGet(UMLPackage.Literals.ACTIVITY__NODE);
-// if(elements instanceof EList<?>) {
-// EList<?> collection = (EList<?>)elements;
-// collection.remove(activityNode);
-// }
-// return CommandResult.newOKCommandResult();
-// }
-// };
-// }
-// }
-// return null;
-// }
-//
+
+ //
+ // @Override
+ // protected ICommand getAfterDestroyDependentsCommand(DestroyDependentsRequest request) {
+ // CompositeCommand cc = new CompositeCommand("After Command for an Activity Node");////$NON-NLS-1$
+ // /*
+ // * Remove from derived feature ownedNode
+ // * WARNING:
+ // * This should be done in the DestroyElementPapyrusCommand however this command for now prevent removing it from derive feature.
+ // * Waiting for discussion.
+ // * This is a temporary discussion
+ // */
+ // ICommand removedFromOwnedNodeCommand = getRemoveFromDerivedFeature(request);
+ // if(removedFromOwnedNodeCommand != null) {
+ // cc.compose(removedFromOwnedNodeCommand);
+ // }
+ // if(cc != null && !cc.isEmpty()) {
+ // return cc;
+ // }
+ // return super.getAfterDestroyDependentsCommand(request);
+ // }
+ //
+ // /**
+ // * Remove from derived polluting feature
+ // *
+ // * @param request
+ // * @return
+ // */
+ // protected ICommand getRemoveFromDerivedFeature(DestroyDependentsRequest request) {
+ // EObject eObject = request.getElementToDestroy();
+ // if(eObject instanceof ActivityNode) {
+ // /*
+ // * Destroy Activity Edge
+ // */
+ // final ActivityNode activityNode = (ActivityNode)eObject;
+ // final EStructuralFeature containingFeature = activityNode.eContainingFeature();
+ // if(UMLPackage.Literals.ACTIVITY__OWNED_NODE.equals(containingFeature)) {
+ // final Activity holder = (Activity)activityNode.eContainer();
+ // return new AbstractTransactionalCommand((TransactionalEditingDomain)AdapterFactoryEditingDomain.getEditingDomainFor(activityNode), "test", null) {
+ //
+ // @Override
+ // protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ // Object elements = holder.eGet(UMLPackage.Literals.ACTIVITY__NODE);
+ // if(elements instanceof EList<?>) {
+ // EList<?> collection = (EList<?>)elements;
+ // collection.remove(activityNode);
+ // }
+ // return CommandResult.newOKCommandResult();
+ // }
+ // };
+ // }
+ // }
+ // return null;
+ // }
+ //
/**
* When an activity node is deleted than all activity edge starting/ending from/to it should be deleted
- *
+ *
* @param request
* @return
*/
protected ICommand getDestroyActivityEdgeCommand(DestroyDependentsRequest request) {
EObject eObject = request.getElementToDestroy();
- if(eObject instanceof ActivityNode) {
+ if (eObject instanceof ActivityNode) {
/*
* Destroy Activity Edge
*/
- ActivityNode activityNode = (ActivityNode)eObject;
+ ActivityNode activityNode = (ActivityNode) eObject;
EList<ActivityEdge> incomings = activityNode.getIncomings();
EList<ActivityEdge> outgoings = activityNode.getOutgoings();
HashSet<ActivityEdge> edges = Sets.newHashSet();
- if(incomings != null && !incomings.isEmpty()) {
+ if (incomings != null && !incomings.isEmpty()) {
edges.addAll(incomings);
}
- if(outgoings != null && !outgoings.isEmpty()) {
+ if (outgoings != null && !outgoings.isEmpty()) {
edges.addAll(outgoings);
}
- if(!edges.isEmpty()) {
+ if (!edges.isEmpty()) {
CompositeCommand cc = new CompositeCommand("Detele Incomings and outgoings edges from activity node");////$NON-NLS-1$
- for(ActivityEdge e : edges) {
+ for (ActivityEdge e : edges) {
DestroyElementRequest destroyRequest = new DestroyElementRequest(e, false);
DestroyElementPapyrusCommand destroyCommand = new DestroyElementPapyrusCommand(destroyRequest);
- if(destroyCommand != null && destroyCommand.canExecute()) {
+ if (destroyCommand != null && destroyCommand.canExecute()) {
cc.compose(destroyCommand);
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AssociationEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AssociationEditHelperAdvice.java
index 730e272bdc1..736fdbc3eec 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AssociationEditHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AssociationEditHelperAdvice.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -38,6 +38,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
@@ -63,14 +64,14 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
/**
* This method provides the source type provided as {@link ConfigureRequest} parameter.
- *
+ *
* @return the target role
*/
protected Classifier getSourceOwnerType(ConfigureRequest req) {
Classifier result = null;
Object paramObject = req.getParameter(CreateRelationshipRequest.SOURCE);
- if(paramObject instanceof Classifier) {
- result = (Classifier)paramObject;
+ if (paramObject instanceof Classifier) {
+ result = (Classifier) paramObject;
}
return result;
@@ -78,14 +79,14 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
/**
* This method provides the target type provided as {@link ConfigureRequest} parameter.
- *
+ *
* @return the target role
*/
protected Classifier getTargetOwnerType(ConfigureRequest req) {
Classifier result = null;
Object paramObject = req.getParameter(CreateRelationshipRequest.TARGET);
- if(paramObject instanceof Classifier) {
- result = (Classifier)paramObject;
+ if (paramObject instanceof Classifier) {
+ result = (Classifier) paramObject;
}
return result;
@@ -93,9 +94,9 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
/**
* Creates a new source {@link Property} from the targetType.
- *
+ *
* @param targetType
- * the type of the {@link Property}
+ * the type of the {@link Property}
* @return the new {@link Property}
*/
protected Property createSourceProperty(Type targetType) {
@@ -109,9 +110,9 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
/**
* Creates a new target {@link Property} from the sourceType.
- *
+ *
* @param sourceType
- * the type of the {@link Property}
+ * the type of the {@link Property}
* @return the new {@link Property}
*/
protected Property createTargetProperty(Type sourceType) {
@@ -126,42 +127,42 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
/**
* Add the source {@link Property} in the correct container.
- *
+ *
* @param sourceEnd
- * the semantic end
+ * the semantic end
* @param owner
- * the end container
+ * the end container
* @param targetType
- * the target type
+ * the target type
* @param association
- * the association
+ * the association
* @throws UnsupportedOperationException
*/
protected void addSourceInModel(final Property sourceEnd, Classifier owner, Classifier targetType, Association association) throws UnsupportedOperationException {
boolean added = ClassifierUtils.addOwnedAttribute(owner, sourceEnd);
- if(!added) {
+ if (!added) {
throw new UnsupportedOperationException("Cannot add a Property on Classifier " + owner.getQualifiedName());
}
}
/**
* Add the source {@link Property} in the correct container.
- *
+ *
* @param targetEnd
- * the semantic end
+ * the semantic end
* @param owner
- * the end container
+ * the end container
* @param sourceType
- * the source type
+ * the source type
* @param association
- * the association
+ * the association
* @throws UnsupportedOperationException
*/
protected void addTargetInModel(Property targetEnd, Classifier owner, Classifier sourceType, Association association) {
boolean added = ClassifierUtils.addOwnedAttribute(owner, targetEnd);
- if(!added) {
+ if (!added) {
throw new UnsupportedOperationException("Cannot add a Property on Classifier " + owner.getQualifiedName());
}
}
@@ -173,17 +174,17 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
* Complete the {@link Association} creation by:
* adding its {@link Property} ends in the model
* adding the UML Nature on the {@link Association}.
- *
+ *
* </pre>
*/
@Override
protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
- final Association association = (Association)request.getElementToConfigure();
+ final Association association = (Association) request.getElementToConfigure();
final Classifier sourceType = getSourceOwnerType(request);
final Classifier targetType = getTargetOwnerType(request);
- if((sourceType == null) || (targetType == null)) {
+ if ((sourceType == null) || (targetType == null)) {
return UnexecutableCommand.INSTANCE;
}
@@ -221,26 +222,27 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
* <pre>
* {@inheritDoc}
*
- * Add a command to destroy {@link Association} ends referenced by the {@link Association}
+ * Add a command to destroy {@link Association} ends referenced by the {@link Association}
* to delete.
- *
+ *
* </pre>
*/
@Override
protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest req) {
List<EObject> dependentsToDestroy = new ArrayList<EObject>();
- List<EObject> dependentsToKeep = (req.getParameter(RequestParameterConstants.DEPENDENTS_TO_KEEP) != null) ? (List<EObject>)req.getParameter(RequestParameterConstants.DEPENDENTS_TO_KEEP) : new ArrayList<EObject>();
+ List<EObject> dependentsToKeep = (req.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.DEPENDENTS_TO_KEEP) != null) ? (List<EObject>) req
+ .getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.DEPENDENTS_TO_KEEP) : new ArrayList<EObject>();
- Association association = (Association)req.getElementToDestroy();
- for(Property end : association.getMemberEnds()) {
- if(!dependentsToKeep.contains(end)) {
+ Association association = (Association) req.getElementToDestroy();
+ for (Property end : association.getMemberEnds()) {
+ if (!dependentsToKeep.contains(end)) {
dependentsToDestroy.add(end);
}
}
- // Return command to destroy dependents ends
- if(!dependentsToDestroy.isEmpty()) {
+ // Return command to destroy dependents ends
+ if (!dependentsToDestroy.isEmpty()) {
return req.getDestroyDependentsCommand(dependentsToDestroy);
}
@@ -252,24 +254,24 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
* {@inheritDoc}
*
* Add a command to destroy {@link Association} when only 1 end remains.
- *
+ *
* </pre>
*/
@Override
protected ICommand getBeforeDestroyReferenceCommand(DestroyReferenceRequest request) {
ICommand gmfCommand = super.getBeforeDestroyReferenceCommand(request);
- Association association = (Association)request.getContainer();
- if((request.getContainingFeature() == UMLPackage.eINSTANCE.getAssociation_MemberEnd()) && (association.getMemberEnds().contains(request.getReferencedObject()))) {
+ Association association = (Association) request.getContainer();
+ if ((request.getContainingFeature() == UMLPackage.eINSTANCE.getAssociation_MemberEnd()) && (association.getMemberEnds().contains(request.getReferencedObject()))) {
Set<Property> ends = new HashSet<Property>();
ends.addAll(association.getMemberEnds());
ends.remove(request.getReferencedObject());
- if(ends.size() <= 2) {
+ if (ends.size() <= 2) {
DestroyElementRequest destroyRequest = new DestroyElementRequest(association, false);
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(association);
- if(provider != null) {
+ if (provider != null) {
ICommand destroyCommand = provider.getEditCommand(destroyRequest);
gmfCommand = CompositeCommand.compose(gmfCommand, destroyCommand);
}
@@ -285,7 +287,7 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
* {@inheritDoc}
*
* Add a command to related association end during re-orient.
- *
+ *
* </pre>
*/
@Override
@@ -297,16 +299,17 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
SetRequest setTypeRequest = null;
// Retrieve re-oriented association and add it to the list of re-factored elements
- Association association = (Association)request.getRelationship();
- List<EObject> currentlyRefactoredElements = (request.getParameter(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) != null) ? (List<EObject>)request.getParameter(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) : new ArrayList<EObject>();
+ Association association = (Association) request.getRelationship();
+ List<EObject> currentlyRefactoredElements = (request.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) != null) ? (List<EObject>) request
+ .getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) : new ArrayList<EObject>();
- if(currentlyRefactoredElements.contains(association)) {
- // Abort - already treated
+ if (currentlyRefactoredElements.contains(association)) {
+ // Abort - already treated
return null;
} else {
currentlyRefactoredElements.add(association);
- request.getParameters().put(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS, currentlyRefactoredElements);
+ request.getParameters().put(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS, currentlyRefactoredElements);
}
// Retrieve property ends of the Association (assumed to be binary)
@@ -315,8 +318,8 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
EObject modifiedPropertyType = null;
- if(request.getDirection() == ReorientRelationshipRequest.REORIENT_SOURCE) {
- if(!association.getOwnedEnds().contains(semanticSource)) {
+ if (request.getDirection() == ReorientRequest.REORIENT_SOURCE) {
+ if (!association.getOwnedEnds().contains(semanticSource)) {
moveRequest = new MoveRequest(request.getNewRelationshipEnd(), semanticSource);
}
@@ -324,8 +327,8 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
setTypeRequest = new SetRequest(modifiedPropertyType, UMLPackage.eINSTANCE.getTypedElement_Type(), request.getNewRelationshipEnd());
}
- if(request.getDirection() == ReorientRelationshipRequest.REORIENT_TARGET) {
- if(!association.getOwnedEnds().contains(semanticTarget)) {
+ if (request.getDirection() == ReorientRequest.REORIENT_TARGET) {
+ if (!association.getOwnedEnds().contains(semanticTarget)) {
moveRequest = new MoveRequest(request.getNewRelationshipEnd(), semanticTarget);
}
@@ -333,23 +336,23 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
setTypeRequest = new SetRequest(modifiedPropertyType, UMLPackage.eINSTANCE.getTypedElement_Type(), request.getNewRelationshipEnd());
}
- if(moveRequest != null) {
+ if (moveRequest != null) {
// Propagate parameters to the move request
moveRequest.addParameters(request.getParameters());
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(request.getNewRelationshipEnd());
- if(provider != null) {
+ if (provider != null) {
ICommand moveCommand = provider.getEditCommand(moveRequest);
gmfCommand = CompositeCommand.compose(gmfCommand, moveCommand);
}
}
- if(setTypeRequest != null) {
+ if (setTypeRequest != null) {
// Propagate parameters to the set request
setTypeRequest.addParameters(request.getParameters());
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(modifiedPropertyType);
- if(provider != null) {
+ if (provider != null) {
ICommand setTypeCommand = provider.getEditCommand(setTypeRequest);
gmfCommand = CompositeCommand.compose(gmfCommand, setTypeCommand);
}
@@ -359,8 +362,8 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
Set<View> viewsToDestroy = new HashSet<View>();
viewsToDestroy.addAll(getViewsToDestroy(association, request));
- //return the command to destroy all these views
- if(!viewsToDestroy.isEmpty()) {
+ // return the command to destroy all these views
+ if (!viewsToDestroy.isEmpty()) {
DestroyDependentsRequest ddr = new DestroyDependentsRequest(request.getEditingDomain(), request.getRelationship(), false);
ddr.setClientContext(request.getClientContext());
ddr.addParameters(request.getParameters());
@@ -368,7 +371,7 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
gmfCommand = CompositeCommand.compose(gmfCommand, destroyViewsCommand);
}
- if(gmfCommand != null) {
+ if (gmfCommand != null) {
gmfCommand.reduce();
}
return gmfCommand;
@@ -376,18 +379,18 @@ public class AssociationEditHelperAdvice extends AbstractEditHelperAdvice {
/**
* Returns all views referencing Association except the view currently re-oriented.
- *
+ *
* @param association
- * the association referenced by views
+ * the association referenced by views
* @param request
- * the re-orient relationship request
+ * the re-orient relationship request
* @return the list of views to be destroy
*/
private Set<View> getViewsToDestroy(Association association, ReorientRelationshipRequest request) {
Set<View> viewsToDestroy = new HashSet<View>();
// Find all views representing the Associations
- EReference[] refs = new EReference[]{ NotationPackage.eINSTANCE.getView_Element() };
+ EReference[] refs = new EReference[] { NotationPackage.eINSTANCE.getView_Element() };
@SuppressWarnings("unchecked")
Collection<View> associationViews = EMFCoreUtil.getReferencers(association, refs);
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ClassifierHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ClassifierHelperAdvice.java
index f69425fd332..703937d4531 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ClassifierHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ClassifierHelperAdvice.java
@@ -1,13 +1,13 @@
/*****************************************************************************
* Copyright (c) 2010-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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -27,6 +27,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyDependentsRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
@@ -47,7 +48,7 @@ import org.eclipse.uml2.uml.UMLPackage;
*
* This helper also add Association re-factor command when an Association member end is
* moved.
- *
+ *
* </pre>
*/
public class ClassifierHelperAdvice extends AbstractEditHelperAdvice {
@@ -59,25 +60,25 @@ public class ClassifierHelperAdvice extends AbstractEditHelperAdvice {
* While deleting a Classifier:
* - remove {@link Generalization} in which this Classifier is involved
* - remove {@link Association} in which this Classifier is involved
- *
+ *
* </pre>
*/
@Override
protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest request) {
List<EObject> dependents = new ArrayList<EObject>();
- if(request.getElementToDestroy() instanceof Classifier) {
+ if (request.getElementToDestroy() instanceof Classifier) {
- Classifier classifierToDelete = (Classifier)request.getElementToDestroy();
+ Classifier classifierToDelete = (Classifier) request.getElementToDestroy();
// Get related generalizations
dependents.addAll(classifierToDelete.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getGeneralization()));
dependents.addAll(classifierToDelete.getTargetDirectedRelationships(UMLPackage.eINSTANCE.getGeneralization()));
// Get related association for this classifier, then delete member ends for which this classifier is the type.
- for(Association association : classifierToDelete.getAssociations()) {
- for(Property end : association.getMemberEnds()) {
- if(end.getType() == classifierToDelete) {
+ for (Association association : classifierToDelete.getAssociations()) {
+ for (Property end : association.getMemberEnds()) {
+ if (end.getType() == classifierToDelete) {
dependents.add(association);
}
}
@@ -85,7 +86,7 @@ public class ClassifierHelperAdvice extends AbstractEditHelperAdvice {
}
// Return the command to destroy all these dependent elements
- if(!dependents.isEmpty()) {
+ if (!dependents.isEmpty()) {
return request.getDestroyDependentsCommand(dependents);
}
@@ -99,7 +100,7 @@ public class ClassifierHelperAdvice extends AbstractEditHelperAdvice {
* While moving a {@link Property} to a Classifier:
* - re-orient Association possibly related to the moved Property
* - remove deprecated connectorEnd
- *
+ *
* </pre>
*/
@Override
@@ -109,22 +110,22 @@ public class ClassifierHelperAdvice extends AbstractEditHelperAdvice {
// Find any ConnectorEnd that would become invalid after the Property move
- for(Object movedObject : request.getElementsToMove().keySet()) {
+ for (Object movedObject : request.getElementsToMove().keySet()) {
// Select Property (excluding Port) in the list of moved elements
- if(!(movedObject instanceof Property) || (movedObject instanceof Port)) {
+ if (!(movedObject instanceof Property) || (movedObject instanceof Port)) {
continue;
}
// Find ConnectorEnd referencing the edited Property as partWithPort or role
- Property movedProperty = (Property)movedObject;
- EReference[] refs = new EReference[]{ UMLPackage.eINSTANCE.getConnectorEnd_PartWithPort(), UMLPackage.eINSTANCE.getConnectorEnd_Role() };
+ Property movedProperty = (Property) movedObject;
+ EReference[] refs = new EReference[] { UMLPackage.eINSTANCE.getConnectorEnd_PartWithPort(), UMLPackage.eINSTANCE.getConnectorEnd_Role() };
@SuppressWarnings("unchecked")
Collection<ConnectorEnd> referencers = EMFCoreUtil.getReferencers(movedProperty, refs);
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(movedProperty);
- if(provider != null) {
- for(ConnectorEnd end : referencers) {
+ if (provider != null) {
+ for (ConnectorEnd end : referencers) {
// General case, delete the ConnectorEnd
DestroyElementRequest req = new DestroyElementRequest(end, false);
ICommand deleteCommand = provider.getEditCommand(req);
@@ -138,43 +139,44 @@ public class ClassifierHelperAdvice extends AbstractEditHelperAdvice {
// Treat related associations that required a re-factor action
// Retrieve elements already under re-factor.
- List<EObject> currentlyRefactoredElements = (request.getParameter(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) != null) ? (List<EObject>)request.getParameter(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) : new ArrayList<EObject>();
+ List<EObject> currentlyRefactoredElements = (request.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) != null) ? (List<EObject>) request
+ .getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) : new ArrayList<EObject>();
// Find Associations related to any moved Property
- for(Object movedObject : request.getElementsToMove().keySet()) {
+ for (Object movedObject : request.getElementsToMove().keySet()) {
// Select Property (excluding Port) in the list of moved elements
- if(!(movedObject instanceof Property) || (movedObject instanceof Port)) {
+ if (!(movedObject instanceof Property) || (movedObject instanceof Port)) {
continue;
}
- Property movedProperty = (Property)movedObject;
+ Property movedProperty = (Property) movedObject;
Association relatedAssociation = movedProperty.getAssociation();
// The moved property has to be related to a UML association
- if((movedProperty.getAssociation() == null) || !(ElementUtil.hasNature(movedProperty.getAssociation(), UMLElementTypes.UML_NATURE))) {
+ if ((movedProperty.getAssociation() == null) || !(ElementUtil.hasNature(movedProperty.getAssociation(), UMLElementTypes.UML_NATURE))) {
continue;
}
// Make sure the target differs from current container
- if((movedProperty.eContainer() == request.getTargetContainer()) && (movedProperty.eContainingFeature() == request.getTargetFeature(movedProperty))) {
+ if ((movedProperty.eContainer() == request.getTargetContainer()) && (movedProperty.eContainingFeature() == request.getTargetFeature(movedProperty))) {
continue;
}
// Moved element already under re-factor ?
- if(currentlyRefactoredElements.contains(movedObject) || currentlyRefactoredElements.contains(relatedAssociation)) {
+ if (currentlyRefactoredElements.contains(movedObject) || currentlyRefactoredElements.contains(relatedAssociation)) {
continue;
} else {
- currentlyRefactoredElements.add((EObject)movedObject);
- request.getParameters().put(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS, currentlyRefactoredElements);
+ currentlyRefactoredElements.add((EObject) movedObject);
+ request.getParameters().put(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS, currentlyRefactoredElements);
}
ICommand refactorCommand = getAssociationRefactoringCommand(movedProperty, relatedAssociation, request);
gmfCommand = CompositeCommand.compose(gmfCommand, refactorCommand);
}
- if(gmfCommand != null) {
+ if (gmfCommand != null) {
gmfCommand = gmfCommand.reduce();
}
@@ -183,13 +185,13 @@ public class ClassifierHelperAdvice extends AbstractEditHelperAdvice {
/**
* Create a re-factoring command related to a Property move.
- *
+ *
* @param movedProperty
- * the moved property
+ * the moved property
* @param associationToRefactor
- * the association to re-factor (re-orient action)
+ * the association to re-factor (re-orient action)
* @param request
- * the original move request
+ * the original move request
* @return the re-factoring command
*/
private ICommand getAssociationRefactoringCommand(Property movedProperty, Association associationToRefactor, MoveRequest request) {
@@ -197,16 +199,16 @@ public class ClassifierHelperAdvice extends AbstractEditHelperAdvice {
Association relatedAssociation = movedProperty.getAssociation(); // Should not be null, test before calling method.
// Re-orient the related association (do not use edit service to avoid infinite loop here)
- int direction = ReorientRelationshipRequest.REORIENT_TARGET;
- if(movedProperty == associationToRefactor.getMemberEnds().get(0)) {
- direction = ReorientRelationshipRequest.REORIENT_SOURCE;
+ int direction = ReorientRequest.REORIENT_TARGET;
+ if (movedProperty == associationToRefactor.getMemberEnds().get(0)) {
+ direction = ReorientRequest.REORIENT_SOURCE;
}
ReorientRelationshipRequest reorientRequest = new ReorientRelationshipRequest(relatedAssociation, request.getTargetContainer(), movedProperty.eContainer(), direction);
reorientRequest.addParameters(request.getParameters());
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(relatedAssociation);
- if(provider != null) {
+ if (provider != null) {
return provider.getEditCommand(reorientRequest);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/CollaborationHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/CollaborationHelperAdvice.java
index 89111d74124..33d31a2a6d0 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/CollaborationHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/CollaborationHelperAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -50,11 +50,11 @@ public class CollaborationHelperAdvice extends AbstractEditHelperAdvice {
protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest request) {
List<EObject> dependentsToDestroy = new ArrayList<EObject>();
- Collaboration collaboration = (Collaboration)request.getElementToDestroy();
+ Collaboration collaboration = (Collaboration) request.getElementToDestroy();
dependentsToDestroy.addAll(getRelatedRoleBindings(collaboration, null));
// return command to destroy dependents
- if(!dependentsToDestroy.isEmpty()) {
+ if (!dependentsToDestroy.isEmpty()) {
return request.getDestroyDependentsCommand(dependentsToDestroy);
}
@@ -71,17 +71,17 @@ public class CollaborationHelperAdvice extends AbstractEditHelperAdvice {
EObject elementToEdit = request.getContainer();
// Test if current destroy reference is removing a Role from Collaboration role, and destroy related role bindings
- if((elementToEdit instanceof Collaboration) && (request.getContainingFeature() == UMLPackage.eINSTANCE.getCollaboration_CollaborationRole())) {
+ if ((elementToEdit instanceof Collaboration) && (request.getContainingFeature() == UMLPackage.eINSTANCE.getCollaboration_CollaborationRole())) {
- Collaboration collaboration = (Collaboration)elementToEdit;
+ Collaboration collaboration = (Collaboration) elementToEdit;
// Parse relatedBindings
- Iterator<Dependency> bindingsIt = getRelatedRoleBindings(collaboration, (ConnectableElement)request.getReferencedObject()).iterator();
- while(bindingsIt.hasNext()) {
+ Iterator<Dependency> bindingsIt = getRelatedRoleBindings(collaboration, (ConnectableElement) request.getReferencedObject()).iterator();
+ while (bindingsIt.hasNext()) {
Dependency binding = bindingsIt.next();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(binding.eContainer());
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
DestroyElementRequest req = new DestroyElementRequest(binding, false);
@@ -93,7 +93,7 @@ public class CollaborationHelperAdvice extends AbstractEditHelperAdvice {
}
}
- if(gmfCommand != null) {
+ if (gmfCommand != null) {
gmfCommand = gmfCommand.reduce();
}
@@ -110,31 +110,31 @@ public class CollaborationHelperAdvice extends AbstractEditHelperAdvice {
EObject elementToEdit = request.getElementToEdit();
// Test if current destroy reference is removing a Role from Collaboration role, and destroy related role bindings
- if((elementToEdit instanceof Collaboration) && (request.getFeature() == UMLPackage.eINSTANCE.getCollaboration_CollaborationRole())) {
+ if ((elementToEdit instanceof Collaboration) && (request.getFeature() == UMLPackage.eINSTANCE.getCollaboration_CollaborationRole())) {
- Collaboration collaboration = (Collaboration)elementToEdit;
+ Collaboration collaboration = (Collaboration) elementToEdit;
// Parse removed roles and find related RoleBindings that need to be deleted
Set<ConnectableElement> deletedRoles = new HashSet<ConnectableElement>();
deletedRoles.addAll(collaboration.getRoles());
- if(request.getValue() instanceof ConnectableElement) {
- deletedRoles.remove((ConnectableElement)request.getValue());
- } else if(request.getValue() instanceof List<?>) {
- deletedRoles.removeAll((List<?>)request.getValue());
+ if (request.getValue() instanceof ConnectableElement) {
+ deletedRoles.remove(request.getValue());
+ } else if (request.getValue() instanceof List<?>) {
+ deletedRoles.removeAll((List<?>) request.getValue());
}
// Parse roles and create deletion command for related bindings
Iterator<ConnectableElement> it = deletedRoles.iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
ConnectableElement role = it.next();
// Parse relatedBindings
Iterator<Dependency> bindingsIt = getRelatedRoleBindings(collaboration, role).iterator();
- while(bindingsIt.hasNext()) {
+ while (bindingsIt.hasNext()) {
Dependency binding = bindingsIt.next();
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(binding.eContainer());
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
DestroyElementRequest req = new DestroyElementRequest(binding, false);
@@ -147,7 +147,7 @@ public class CollaborationHelperAdvice extends AbstractEditHelperAdvice {
}
}
- if(gmfCommand != null) {
+ if (gmfCommand != null) {
gmfCommand = gmfCommand.reduce();
}
@@ -158,11 +158,11 @@ public class CollaborationHelperAdvice extends AbstractEditHelperAdvice {
* <pre>
* This method retrieve all the role bindings related to a specific role.
* </pre>
- *
+ *
* @param collaboration
- * the {@link Collaboration} owning the role
+ * the {@link Collaboration} owning the role
* @param role
- * the role (if null, all roles are considered)
+ * the role (if null, all roles are considered)
* @return role bindings connecting the role
*/
private Set<Dependency> getRelatedRoleBindings(Collaboration collaboration, ConnectableElement role) {
@@ -174,17 +174,17 @@ public class CollaborationHelperAdvice extends AbstractEditHelperAdvice {
Iterator<?> it = refs.iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
Object object = it.next();
- if(object instanceof CollaborationUse) {
+ if (object instanceof CollaborationUse) {
- CollaborationUse collaborationUse = (CollaborationUse)object;
+ CollaborationUse collaborationUse = (CollaborationUse) object;
Iterator<Dependency> itBindings = collaborationUse.getRoleBindings().iterator();
- while(itBindings.hasNext()) {
+ while (itBindings.hasNext()) {
Dependency roleBinding = itBindings.next();
- if((role == null) || (roleBinding.getClients().contains(role))) {
+ if ((role == null) || (roleBinding.getClients().contains(role))) {
roleBindings.add(roleBinding);
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/CollaborationUseHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/CollaborationUseHelperAdvice.java
index a472a6c1222..b9f534cc79a 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/CollaborationUseHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/CollaborationUseHelperAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -47,13 +47,13 @@ public class CollaborationUseHelperAdvice extends AbstractEditHelperAdvice {
EObject elementToEdit = request.getContainer();
// Test if current destroy reference is removing a RoleBinding from CollaborationUse role, and destroy this role binding
- if((elementToEdit instanceof CollaborationUse) && (request.getContainingFeature() == UMLPackage.eINSTANCE.getCollaborationUse_RoleBinding())) {
+ if ((elementToEdit instanceof CollaborationUse) && (request.getContainingFeature() == UMLPackage.eINSTANCE.getCollaborationUse_RoleBinding())) {
- CollaborationUse cUse = (CollaborationUse)elementToEdit;
+ CollaborationUse cUse = (CollaborationUse) elementToEdit;
// Removing referenced Dependency from roleBinding should delete the dependency
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(cUse);
- if(provider != null) {
+ if (provider != null) {
// Retrieve delete command from the Element Edit service
DestroyElementRequest req = new DestroyElementRequest(request.getReferencedObject(), false);
@@ -64,7 +64,7 @@ public class CollaborationUseHelperAdvice extends AbstractEditHelperAdvice {
}
}
- if(gmfCommand != null) {
+ if (gmfCommand != null) {
gmfCommand = gmfCommand.reduce();
}
@@ -81,25 +81,25 @@ public class CollaborationUseHelperAdvice extends AbstractEditHelperAdvice {
EObject elementToEdit = request.getElementToEdit();
// Test if current set command is removing a RoleBinding(s) from CollaborationUse role, and destroy this role binding
- if((elementToEdit instanceof CollaborationUse) && (request.getFeature() == UMLPackage.eINSTANCE.getCollaborationUse_RoleBinding())) {
+ if ((elementToEdit instanceof CollaborationUse) && (request.getFeature() == UMLPackage.eINSTANCE.getCollaborationUse_RoleBinding())) {
- CollaborationUse cUse = (CollaborationUse)elementToEdit;
+ CollaborationUse cUse = (CollaborationUse) elementToEdit;
// Removing referenced Dependency from roleBinding should delete the dependency
Set<Dependency> roleBindingsToDelete = new HashSet<Dependency>();
roleBindingsToDelete.addAll(cUse.getRoleBindings());
- if(request.getValue() instanceof List<?>) {
- // request.getValue() is expected to be EList<Dependency> here.
- roleBindingsToDelete.removeAll((List<?>)request.getValue());
+ if (request.getValue() instanceof List<?>) {
+ // request.getValue() is expected to be EList<Dependency> here.
+ roleBindingsToDelete.removeAll((List<?>) request.getValue());
}
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(cUse);
- if(provider != null) {
+ if (provider != null) {
// Parse roleBindings and create deletion command
Iterator<Dependency> it = roleBindingsToDelete.iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
Dependency roleBinding = it.next();
// Retrieve delete command from the Element Edit service
@@ -113,19 +113,19 @@ public class CollaborationUseHelperAdvice extends AbstractEditHelperAdvice {
}
// Test if current set command is modifying the type of the CollaborationUse
- if((elementToEdit instanceof CollaborationUse) && (request.getFeature() == UMLPackage.eINSTANCE.getCollaborationUse_Type()) && ((request.getValue() == null) || (request.getValue() instanceof Collaboration))) {
+ if ((elementToEdit instanceof CollaborationUse) && (request.getFeature() == UMLPackage.eINSTANCE.getCollaborationUse_Type()) && ((request.getValue() == null) || (request.getValue() instanceof Collaboration))) {
- CollaborationUse cUse = (CollaborationUse)elementToEdit;
+ CollaborationUse cUse = (CollaborationUse) elementToEdit;
- Collaboration newType = (Collaboration)request.getValue();
- if(newType != cUse.getType()) {
+ Collaboration newType = (Collaboration) request.getValue();
+ if (newType != cUse.getType()) {
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(cUse);
- if(provider != null) {
+ if (provider != null) {
// Parse roleBindings and create deletion command for all
Iterator<Dependency> it = cUse.getRoleBindings().iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
Dependency roleBinding = it.next();
// Retrieve delete command from the Element Edit service
@@ -140,7 +140,7 @@ public class CollaborationUseHelperAdvice extends AbstractEditHelperAdvice {
}
- if(gmfCommand != null) {
+ if (gmfCommand != null) {
gmfCommand = gmfCommand.reduce();
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ConnectorEndHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ConnectorEndHelperAdvice.java
index 9fd77197c44..5a473a8bd3d 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ConnectorEndHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ConnectorEndHelperAdvice.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* 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
@@ -32,12 +32,12 @@ public class ConnectorEndHelperAdvice extends AbstractEditHelperAdvice {
@Override
protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest request) {
- if(request.getElementToDestroy() instanceof ConnectorEnd) {
- ConnectorEnd endToDelete = (ConnectorEnd)request.getElementToDestroy();
- Connector connector = (Connector)endToDelete.getOwner();
+ if (request.getElementToDestroy() instanceof ConnectorEnd) {
+ ConnectorEnd endToDelete = (ConnectorEnd) request.getElementToDestroy();
+ Connector connector = (Connector) endToDelete.getOwner();
- if(connector.getEnds().size() <= 2) {
- //return the command to destroy the Connector
+ if (connector.getEnds().size() <= 2) {
+ // return the command to destroy the Connector
return request.getDestroyDependentCommand(connector);
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ConnectorHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ConnectorHelperAdvice.java
index 12e70d67fb8..7c2c5471d96 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ConnectorHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ConnectorHelperAdvice.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -54,8 +54,8 @@ public class ConnectorHelperAdvice extends AbstractEditHelperAdvice {
ICommand gmfCommand = super.getBeforeMoveCommand(request);
// Parse moved objects and detect ConnectorEnd moves
- for(Object movedObject : request.getElementsToMove().keySet()) {
- if(movedObject instanceof ConnectorEnd) {
+ for (Object movedObject : request.getElementsToMove().keySet()) {
+ if (movedObject instanceof ConnectorEnd) {
// Replace default command.
gmfCommand = UnexecutableCommand.INSTANCE;
break;
@@ -66,30 +66,30 @@ public class ConnectorHelperAdvice extends AbstractEditHelperAdvice {
}
/**
- *
+ *
* @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeReorientRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest)
- *
+ *
* @param request
* @return
- *
+ *
*/
@Override
protected ICommand getBeforeReorientRelationshipCommand(final ReorientRelationshipRequest request) {
- //we need to destroy the invalid views from the diagram
+ // we need to destroy the invalid views from the diagram
final CompositeCommand compositeCommand = new CompositeCommand("Destroy Connector View Command"); //$NON-NLS-1$
final EObject relationShip = request.getRelationship();
final Edge reorientedEdge = RequestParameterUtils.getReconnectedEdge(request);
- if(relationShip instanceof Connector) {
+ if (relationShip instanceof Connector) {
final EObject newEnd = request.getNewRelationshipEnd();
final EObject oldEnd = request.getOldRelationshipEnd();
- if(oldEnd != newEnd) {
- final Set<View> viewsToDestroy = new ConnectorUtils().getViewsRepresentingConnector((Connector)relationShip);
+ if (oldEnd != newEnd) {
+ final Set<View> viewsToDestroy = new ConnectorUtils().getViewsRepresentingConnector((Connector) relationShip);
final Iterator<View> iter = viewsToDestroy.iterator();
- while(iter.hasNext()) {
+ while (iter.hasNext()) {
final View current = iter.next();
- if(current != reorientedEdge) {//we don't destroy the edge that the user is reconnecting!
- //the role is changing, so We remove the invalid views
+ if (current != reorientedEdge) {// we don't destroy the edge that the user is reconnecting!
+ // the role is changing, so We remove the invalid views
final DestroyElementRequest destroyRequest = new DestroyElementRequest(request.getEditingDomain(), current, false);
final IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(current);
compositeCommand.add(commandProvider.getEditCommand(destroyRequest));
@@ -97,7 +97,7 @@ public class ConnectorHelperAdvice extends AbstractEditHelperAdvice {
}
}
}
- if(!compositeCommand.isEmpty()) {
+ if (!compositeCommand.isEmpty()) {
return compositeCommand;
}
return null;
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ContainmentSubsetRemovalAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ContainmentSubsetRemovalAdvice.java
index 871314baba8..bd29cb2fe35 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ContainmentSubsetRemovalAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ContainmentSubsetRemovalAdvice.java
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2014 CEA 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
@@ -38,7 +38,7 @@ public class ContainmentSubsetRemovalAdvice extends AbstractEditHelperAdvice {
// This parameter is set by generated semantic edit policies when delegating to "visual element types" to
// decorate the semantic element command with advice targeting the visual element type, which is a hinted
// element type specializing the semantic element type to suggest the way in which it should be presented
- // in the diagram. Because our advice is already included in the semantic command, it isn't needed in
+ // in the diagram. Because our advice is already included in the semantic command, it isn't needed in
// this additional decoration and, therefore, it won't cause problems when the visual element type is
// a specialization (dubiously) of the null element type
// (see https://www.eclipse.org/forums/index.php/t/781825/ for discussion of that problem)
@@ -52,7 +52,7 @@ public class ContainmentSubsetRemovalAdvice extends AbstractEditHelperAdvice {
protected ICommand getAfterDestroyElementCommand(DestroyElementRequest request) {
ICommand result = super.getAfterDestroyElementCommand(request);
- if(request.getParameter(EDIT_POLICY_COMMAND) != null) {
+ if (request.getParameter(EDIT_POLICY_COMMAND) != null) {
return result;
}
@@ -61,7 +61,7 @@ public class ContainmentSubsetRemovalAdvice extends AbstractEditHelperAdvice {
EReference containment = destructee.eContainmentFeature();
final Collection<EReference> supersets = !UmlUtils.isSubset(containment) ? null : UmlUtils.getAllChangeableSupersets(containment);
- if(supersets != null) {
+ if (supersets != null) {
// Add a command that ensures removal from the supersets on redo, if necessary
final EObject container = destructee.eContainer();
@@ -70,7 +70,7 @@ public class ContainmentSubsetRemovalAdvice extends AbstractEditHelperAdvice {
@Override
protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
// Ensure sanity of the supersets, which redoing the recorded ChangeDescription does not
- for(EReference superset : supersets) {
+ for (EReference superset : supersets) {
remove(container, superset, destructee);
}
@@ -78,9 +78,9 @@ public class ContainmentSubsetRemovalAdvice extends AbstractEditHelperAdvice {
}
private void remove(EObject owner, EReference reference, EObject object) {
- if(reference.isMany()) {
- ((Collection<?>)owner.eGet(reference)).remove(object);
- } else if(owner.eGet(reference) == object) {
+ if (reference.isMany()) {
+ ((Collection<?>) owner.eGet(reference)).remove(object);
+ } else if (owner.eGet(reference) == object) {
owner.eUnset(reference);
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DestructionEventHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DestructionEventHelperAdvice.java
index a9754fc4dbe..19e25320f61 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DestructionEventHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DestructionEventHelperAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 Atos Origin.
*
- *
+ *
* 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
@@ -19,9 +19,10 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyDependentsRequest;
/**
* Helper advice for all {@link DestructionEvent} elements.
- *
+ *
* @deprecated the related element no more exists in UML 2.4
*/
+@Deprecated
public class DestructionEventHelperAdvice extends AbstractEditHelperAdvice {
/**
@@ -29,27 +30,27 @@ public class DestructionEventHelperAdvice extends AbstractEditHelperAdvice {
*/
@Override
protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest request) {
- //FIXME : change for UML 2.4
-//
-// List<EObject> dependentsToDestroy = new ArrayList<EObject>();
-//
-// DestructionEvent de = (DestructionEvent)request.getElementToDestroy();
-//
-// Collection<Setting> usages = PapyrusEcoreUtils.getUsages(de);
-//
-// // remove the associated OccurrenceSpecification
-// // if it is not used by another element.
-// for(Setting usage : usages) {
-// EObject os = usage.getEObject();
-// if(os instanceof OccurrenceSpecification && PapyrusEcoreUtils.isOnlyUsage(os, de)) {
-// dependentsToDestroy.add(os);
-// }
-// }
-//
-// // return command to destroy dependents
-// if(!dependentsToDestroy.isEmpty()) {
-// return request.getDestroyDependentsCommand(dependentsToDestroy);
-// }
+ // FIXME : change for UML 2.4
+ //
+ // List<EObject> dependentsToDestroy = new ArrayList<EObject>();
+ //
+ // DestructionEvent de = (DestructionEvent)request.getElementToDestroy();
+ //
+ // Collection<Setting> usages = PapyrusEcoreUtils.getUsages(de);
+ //
+ // // remove the associated OccurrenceSpecification
+ // // if it is not used by another element.
+ // for(Setting usage : usages) {
+ // EObject os = usage.getEObject();
+ // if(os instanceof OccurrenceSpecification && PapyrusEcoreUtils.isOnlyUsage(os, de)) {
+ // dependentsToDestroy.add(os);
+ // }
+ // }
+ //
+ // // return command to destroy dependents
+ // if(!dependentsToDestroy.isEmpty()) {
+ // return request.getDestroyDependentsCommand(dependentsToDestroy);
+ // }
return null;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DirectedRelationshipHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DirectedRelationshipHelperAdvice.java
index 289f74e1fb9..9afc0ded563 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DirectedRelationshipHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DirectedRelationshipHelperAdvice.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010-2012 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,9 +26,9 @@ import org.eclipse.uml2.uml.DirectedRelationship;
/**
* <pre>
- * This HelperAdvice completes {@link DirectedRelationship} edit commands
+ * This HelperAdvice completes {@link DirectedRelationship} edit commands
* in order to :
- * - remove inconsistent (all except currently edited view) views
+ * - remove inconsistent (all except currently edited view) views
* of the edited DirectedRelationship in case a {@link DirectedRelationship} is re-oriented.
* </pre>
*/
@@ -41,10 +41,10 @@ public class DirectedRelationshipHelperAdvice extends AbstractEditHelperAdvice {
protected ICommand getBeforeReorientRelationshipCommand(ReorientRelationshipRequest request) {
Set<View> viewsToDestroy = new HashSet<View>();
- viewsToDestroy.addAll(getViewsToDestroy((DirectedRelationship)request.getRelationship(), request));
+ viewsToDestroy.addAll(getViewsToDestroy((DirectedRelationship) request.getRelationship(), request));
- //return the command to destroy all these views
- if(!viewsToDestroy.isEmpty()) {
+ // return the command to destroy all these views
+ if (!viewsToDestroy.isEmpty()) {
DestroyDependentsRequest ddr = new DestroyDependentsRequest(request.getEditingDomain(), request.getRelationship(), false);
ddr.setClientContext(request.getClientContext());
@@ -57,11 +57,11 @@ public class DirectedRelationshipHelperAdvice extends AbstractEditHelperAdvice {
/**
* Returns all views referencing DirectedRelationship except the view currently re-oriented.
- *
+ *
* @param relationship
- * the relationship referenced by views
+ * the relationship referenced by views
* @param request
- * the re-orient relationship request
+ * the re-orient relationship request
* @return the list of views to be destroy
*/
private Set<View> getViewsToDestroy(DirectedRelationship relationship, ReorientRelationshipRequest request) {
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/EncapsulatedClassifierHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/EncapsulatedClassifierHelperAdvice.java
index 98effb5655a..247db73a173 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/EncapsulatedClassifierHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/EncapsulatedClassifierHelperAdvice.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* 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
@@ -45,7 +45,7 @@ public class EncapsulatedClassifierHelperAdvice extends AbstractEditHelperAdvice
*
* While moving a {@link Port} to an EncapsulatedClassifier:
* - remove related {@link ConnectorEnd}
- *
+ *
* </pre>
*/
@Override
@@ -55,44 +55,44 @@ public class EncapsulatedClassifierHelperAdvice extends AbstractEditHelperAdvice
List<EObject> dependents = new ArrayList<EObject>();
// Find ConnectorEnds related to any moved Port
- for(Object movedObject : request.getElementsToMove().keySet()) {
+ for (Object movedObject : request.getElementsToMove().keySet()) {
// Select Port in the list of moved elements
- if(!(movedObject instanceof Port)) {
+ if (!(movedObject instanceof Port)) {
continue;
}
- Port movedPort = (Port)movedObject;
+ Port movedPort = (Port) movedObject;
// Make sure the target differs from current container
- if((movedPort.eContainer() == request.getTargetContainer()) && (movedPort.eContainingFeature() == request.getTargetFeature(movedPort))) {
+ if ((movedPort.eContainer() == request.getTargetContainer()) && (movedPort.eContainingFeature() == request.getTargetFeature(movedPort))) {
continue;
}
// Find related ConnectorEnds
- EReference[] refs = new EReference[]{ UMLPackage.eINSTANCE.getConnectorEnd_Role(), UMLPackage.eINSTANCE.getConnectorEnd_PartWithPort() };
+ EReference[] refs = new EReference[] { UMLPackage.eINSTANCE.getConnectorEnd_Role(), UMLPackage.eINSTANCE.getConnectorEnd_PartWithPort() };
@SuppressWarnings("unchecked")
Collection<ConnectorEnd> connectorEndRefs = EMFCoreUtil.getReferencers(movedPort, refs);
dependents.addAll(connectorEndRefs);
}
// Add commands to destroy related ConnectorEnds
- for(EObject eObjectToDestroy : dependents) {
+ for (EObject eObjectToDestroy : dependents) {
// General case, delete the dependents ConnectorEnd(s)
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(eObjectToDestroy.eContainer());
- if(provider == null) {
+ if (provider == null) {
continue;
}
- DestroyElementRequest req = new DestroyElementRequest((ConnectorEnd)eObjectToDestroy, false);
+ DestroyElementRequest req = new DestroyElementRequest(eObjectToDestroy, false);
ICommand deleteCommand = provider.getEditCommand(req);
// Add current EObject destroy command to the global command
gmfCommand = CompositeCommand.compose(gmfCommand, deleteCommand);
}
- if(gmfCommand != null) {
+ if (gmfCommand != null) {
gmfCommand = gmfCommand.reduce();
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ExecutionSpecificationHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ExecutionSpecificationHelperAdvice.java
index 6d1c820bbe6..feb4ca5feb4 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ExecutionSpecificationHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ExecutionSpecificationHelperAdvice.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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
* Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - remove linked messages too
*
@@ -43,14 +43,14 @@ public class ExecutionSpecificationHelperAdvice extends AbstractEditHelperAdvice
/**
* <pre>
* Add a command to associated {@link OccurrenceSpecification} and {@link Message}.
- * This command is only added if the start - finish referenced {@link OccurrenceSpecification} is not
+ * This command is only added if the start - finish referenced {@link OccurrenceSpecification} is not
* referenced by another element or the start/finish references are of type {@link ExecutionOccurrenceSpecification}.
* </pre>
- *
+ *
* @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeDestroyDependentsCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyDependentsRequest)
- *
+ *
* @param request
- * the request
+ * the request
* @return the command to execute before the edit helper work is done
*/
@Override
@@ -58,16 +58,16 @@ public class ExecutionSpecificationHelperAdvice extends AbstractEditHelperAdvice
List<EObject> dependentsToDestroy = new ArrayList<EObject>();
- ExecutionSpecification es = (ExecutionSpecification)request.getElementToDestroy();
+ ExecutionSpecification es = (ExecutionSpecification) request.getElementToDestroy();
// Check whether start - finish referenced OccurrenceSpecification should be added to the dependents list
OccurrenceSpecification osStart = es.getStart();
- if(shouldDestroyOccurrenceSpecification(es, osStart)) {
+ if (shouldDestroyOccurrenceSpecification(es, osStart)) {
dependentsToDestroy.add(osStart);
}
OccurrenceSpecification osFinish = es.getFinish();
- if(shouldDestroyOccurrenceSpecification(es, osFinish)) {
+ if (shouldDestroyOccurrenceSpecification(es, osFinish)) {
dependentsToDestroy.add(osFinish);
}
@@ -75,12 +75,12 @@ public class ExecutionSpecificationHelperAdvice extends AbstractEditHelperAdvice
// find initiating MOS of a synch message
InteractionFragment previousIft = InteractionFragmentHelper.findPreviousFragment(osStart, es.getOwner());
- while(previousIft != null) {
+ while (previousIft != null) {
// keep the first ift with the same lifelines, and check it
- if(coveredLifelines.equals(new HashSet<Lifeline>(previousIft.getCovereds()))) {
- if(previousIft instanceof MessageOccurrenceSpecification) {
- Message msg = ((MessageOccurrenceSpecification)previousIft).getMessage();
- if(msg != null && MessageSort.SYNCH_CALL_LITERAL.equals(msg.getMessageSort())) {
+ if (coveredLifelines.equals(new HashSet<Lifeline>(previousIft.getCovereds()))) {
+ if (previousIft instanceof MessageOccurrenceSpecification) {
+ Message msg = ((MessageOccurrenceSpecification) previousIft).getMessage();
+ if (msg != null && MessageSort.SYNCH_CALL_LITERAL.equals(msg.getMessageSort())) {
dependentsToDestroy.add(previousIft);
}
}
@@ -91,9 +91,9 @@ public class ExecutionSpecificationHelperAdvice extends AbstractEditHelperAdvice
// find MOS between the start and finish
InteractionFragment fragment = osStart;
- while(fragment != null && !fragment.equals(osFinish)) {
+ while (fragment != null && !fragment.equals(osFinish)) {
// remove MOS if it have the same covered lifelines as the ES
- if(fragment instanceof MessageOccurrenceSpecification && coveredLifelines.equals(new HashSet<Lifeline>(fragment.getCovereds()))) {
+ if (fragment instanceof MessageOccurrenceSpecification && coveredLifelines.equals(new HashSet<Lifeline>(fragment.getCovereds()))) {
dependentsToDestroy.add(fragment);
}
@@ -101,7 +101,7 @@ public class ExecutionSpecificationHelperAdvice extends AbstractEditHelperAdvice
}
// return command to destroy dependents
- if(!dependentsToDestroy.isEmpty()) {
+ if (!dependentsToDestroy.isEmpty()) {
return request.getDestroyDependentsCommand(dependentsToDestroy);
}
@@ -112,17 +112,17 @@ public class ExecutionSpecificationHelperAdvice extends AbstractEditHelperAdvice
* <pre>
* Check that given {@link OccurrenceSpecification} should be destroyed along with {@link ExecutionSpecification} which references it.
* It should be destroyed in case:
- * It is of type {@link ExecutionOccurrenceSpecification} (since the opposite reference
+ * It is of type {@link ExecutionOccurrenceSpecification} (since the opposite reference
* 'ExecutionOccurrenceSpecification::execution[1]' which designates given {@link ExecutionSpecification} is mandatory).
* or
* It is not used by another element.
* </pre>
- *
+ *
* @param es
- * {@link ExecutionSpecification} which references {@link OccurrenceSpecification} (by means of #start/#finish references)
+ * {@link ExecutionSpecification} which references {@link OccurrenceSpecification} (by means of #start/#finish references)
* @param os
- * start or finish {@link OccurrenceSpecification} which defines the duration of {@link ExecutionSpecification}
- * @return true in case {@link OccurrenceSpecification} should be destroyed
+ * start or finish {@link OccurrenceSpecification} which defines the duration of {@link ExecutionSpecification}
+ * @return true in case {@link OccurrenceSpecification} should be destroyed
*/
private boolean shouldDestroyOccurrenceSpecification(ExecutionSpecification es, OccurrenceSpecification os) {
return os instanceof ExecutionOccurrenceSpecification
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/LifelineHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/LifelineHelperAdvice.java
index 965d8c23199..1637893d0f9 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/LifelineHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/LifelineHelperAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 Atos Origin.
*
- *
+ *
* 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
@@ -41,34 +41,34 @@ public class LifelineHelperAdvice extends AbstractEditHelperAdvice {
List<EObject> dependentsToDestroy = new ArrayList<EObject>();
- Lifeline lifeline = (Lifeline)request.getElementToDestroy();
+ Lifeline lifeline = (Lifeline) request.getElementToDestroy();
- for(InteractionFragment ift : lifeline.getCoveredBys()) {
+ for (InteractionFragment ift : lifeline.getCoveredBys()) {
// Destroy covered ExecutionSpecification
- if(ift instanceof ExecutionSpecification) {
+ if (ift instanceof ExecutionSpecification) {
dependentsToDestroy.add(ift);
}
// Destroy related Message
// Destroy related Message
- if((ift instanceof MessageOccurrenceSpecification) && (((MessageOccurrenceSpecification)ift).getMessage() != null)) {
- dependentsToDestroy.add(((MessageOccurrenceSpecification)ift).getMessage());
+ if ((ift instanceof MessageOccurrenceSpecification) && (((MessageOccurrenceSpecification) ift).getMessage() != null)) {
+ dependentsToDestroy.add(((MessageOccurrenceSpecification) ift).getMessage());
}
// Destroy covered OccurrenceSpecification
- if(ift instanceof OccurrenceSpecification) {
+ if (ift instanceof OccurrenceSpecification) {
dependentsToDestroy.add(ift);
}
}
// Destroy decomposed lifelines
PartDecomposition decomposition = lifeline.getDecomposedAs();
- if(decomposition != null && EMFHelper.isOnlyUsage(decomposition, lifeline)) {
+ if (decomposition != null && EMFHelper.isOnlyUsage(decomposition, lifeline)) {
dependentsToDestroy.add(decomposition);
}
// return command to destroy dependents
- if(!dependentsToDestroy.isEmpty()) {
+ if (!dependentsToDestroy.isEmpty()) {
return request.getDestroyDependentsCommand(dependentsToDestroy);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageEndHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageEndHelperAdvice.java
index 88de1472c64..a13d8cb26ef 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageEndHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageEndHelperAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 Atos Origin.
*
- *
+ *
* 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
@@ -25,10 +25,10 @@ public class MessageEndHelperAdvice extends AbstractEditHelperAdvice {
*/
@Override
protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest request) {
- MessageEnd me = (MessageEnd)request.getElementToDestroy();
+ MessageEnd me = (MessageEnd) request.getElementToDestroy();
// Destroy the associated message
- if(me.getMessage() != null) {
+ if (me.getMessage() != null) {
return request.getDestroyDependentCommand(me.getMessage());
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageHelperAdvice.java
index 0a314eb87fb..13dda84a7f7 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/MessageHelperAdvice.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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
*
*****************************************************************************/
@@ -32,16 +32,16 @@ public class MessageHelperAdvice extends AbstractEditHelperAdvice {
/**
* <pre>
- * Add a command to destroy {@link MessageEnd} referenced by the {@link Message}
+ * Add a command to destroy {@link MessageEnd} referenced by the {@link Message}
* to delete.
- * This command is only added if the send - receive event referenced is not
+ * This command is only added if the send - receive event referenced is not
* referenced by another element.
* </pre>
- *
+ *
* @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeDestroyDependentsCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyDependentsRequest)
- *
+ *
* @param request
- * the request
+ * the request
* @return the command to execute before the edit helper work is done
*/
@Override
@@ -49,22 +49,22 @@ public class MessageHelperAdvice extends AbstractEditHelperAdvice {
List<EObject> dependentsToDestroy = new ArrayList<EObject>();
- Message message = (Message)request.getElementToDestroy();
+ Message message = (Message) request.getElementToDestroy();
// Add send - receive referenced MessageEnd to the dependents list
// if they are not used by another element.
MessageEnd sendEvent = message.getSendEvent();
- if((sendEvent != null) && (EMFHelper.isOnlyUsage(sendEvent, message))) {
+ if ((sendEvent != null) && (EMFHelper.isOnlyUsage(sendEvent, message))) {
dependentsToDestroy.add(sendEvent);
}
MessageEnd recvEvent = message.getReceiveEvent();
- if((recvEvent != null) && (EMFHelper.isOnlyUsage(recvEvent, message))) {
+ if ((recvEvent != null) && (EMFHelper.isOnlyUsage(recvEvent, message))) {
dependentsToDestroy.add(recvEvent);
}
- // return command to destroy dependents MessageEnd
- if(!dependentsToDestroy.isEmpty()) {
+ // return command to destroy dependents MessageEnd
+ if (!dependentsToDestroy.isEmpty()) {
return request.getDestroyDependentsCommand(dependentsToDestroy);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/NamedElementHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/NamedElementHelperAdvice.java
index bab43237226..c4ede516ac0 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/NamedElementHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/NamedElementHelperAdvice.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -42,29 +42,29 @@ public class NamedElementHelperAdvice extends AbstractEditHelperAdvice {
ICommand command = super.getBeforeDestroyDependentsCommand(request);
- NamedElement elementToDestroy = (NamedElement)request.getElementToDestroy();
+ NamedElement elementToDestroy = (NamedElement) request.getElementToDestroy();
Set<DirectedRelationship> relationshipsWithoutEnds = new HashSet<DirectedRelationship>();
Iterator<DirectedRelationship> srcRelationhipsIt = elementToDestroy.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getDependency()).iterator();
- while(srcRelationhipsIt.hasNext()) {
+ while (srcRelationhipsIt.hasNext()) {
DirectedRelationship directedRelationship = srcRelationhipsIt.next();
- // If all sources from the directed relationship are to be destroyed, add the relationship destruction
- if(request.getDependentElementsToDestroy().containsAll(directedRelationship.getSources())) {
- if(!request.getDependentElementsToDestroy().contains(directedRelationship)) {
+ // If all sources from the directed relationship are to be destroyed, add the relationship destruction
+ if (request.getDependentElementsToDestroy().containsAll(directedRelationship.getSources())) {
+ if (!request.getDependentElementsToDestroy().contains(directedRelationship)) {
relationshipsWithoutEnds.add(directedRelationship);
}
}
}
Iterator<DirectedRelationship> tgtRelationhipsIt = elementToDestroy.getTargetDirectedRelationships(UMLPackage.eINSTANCE.getDependency()).iterator();
- while(tgtRelationhipsIt.hasNext()) {
+ while (tgtRelationhipsIt.hasNext()) {
DirectedRelationship directedRelationship = tgtRelationhipsIt.next();
- // If all sources from the directed relationship are to be destroyed, add the relationship destruction
- if(request.getDependentElementsToDestroy().containsAll(directedRelationship.getTargets())) {
- if(!request.getDependentElementsToDestroy().contains(directedRelationship)) {
+ // If all sources from the directed relationship are to be destroyed, add the relationship destruction
+ if (request.getDependentElementsToDestroy().containsAll(directedRelationship.getTargets())) {
+ if (!request.getDependentElementsToDestroy().contains(directedRelationship)) {
relationshipsWithoutEnds.add(directedRelationship);
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/NamedElementInitializerHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/NamedElementInitializerHelperAdvice.java
index 54136ce15d1..4a578e0fc8b 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/NamedElementInitializerHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/NamedElementInitializerHelperAdvice.java
@@ -1,13 +1,13 @@
/*****************************************************************************
* Copyright (c) 2010. 2014 CEA LIST 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 (CEA) - bug 440263
*
@@ -30,9 +30,9 @@ import org.eclipse.uml2.uml.Namespace;
* <pre>
* This is an advice helper used to initialize namedElement.
*
- * In particular the name of such elements is initialized in order
+ * In particular the name of such elements is initialized in order
* to have a unique name for a specific type of element per {@link Namespace}.
- *
+ *
* </pre>
*/
public class NamedElementInitializerHelperAdvice extends AbstractEditHelperAdvice {
@@ -44,13 +44,14 @@ public class NamedElementInitializerHelperAdvice extends AbstractEditHelperAdvic
protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
return new ConfigureElementCommand(request) {
+ @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
+ NamedElement element = (NamedElement) request.getElementToConfigure();
// Initialize the element name based on the created IElementType
String initializedName = NamedElementUtil.getDefaultNameWithIncrement(element, element.eContainer().eContents());
- if(initializedName != null) {
+ if (initializedName != null) {
element.setName(initializedName);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/OccurrenceSpecificationHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/OccurrenceSpecificationHelperAdvice.java
index 38201bdbad4..63756b1e7c8 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/OccurrenceSpecificationHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/OccurrenceSpecificationHelperAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 Atos Origin.
*
- *
+ *
* 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
@@ -37,18 +37,18 @@ public class OccurrenceSpecificationHelperAdvice extends AbstractEditHelperAdvic
* - related time elements
* - linked general ordering
* </pre>
- *
+ *
* @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeDestroyDependentsCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyDependentsRequest)
- *
+ *
* @param request
- * the request
+ * the request
* @return the command to execute before the edit helper work is done
*/
@Override
protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest request) {
List<EObject> dependentsToDestroy = new ArrayList<EObject>();
- OccurrenceSpecification os = (OccurrenceSpecification)request.getElementToDestroy();
+ OccurrenceSpecification os = (OccurrenceSpecification) request.getElementToDestroy();
// delete linked time elements
dependentsToDestroy.addAll(TimeObservationHelper.getTimeObservations(os));
@@ -59,13 +59,13 @@ public class OccurrenceSpecificationHelperAdvice extends AbstractEditHelperAdvic
// delete linked general ordering
/**
* Note: GeneralOrdering should be necessarily removed because the opposite
- * references 'GeneralOrdering::before[1]' and 'GeneralOrdering::after[1]' which designate
- * this OccurrenceSpecification are mandatory
+ * references 'GeneralOrdering::before[1]' and 'GeneralOrdering::after[1]' which designate
+ * this OccurrenceSpecification are mandatory
*/
dependentsToDestroy.addAll(os.getToBefores());
dependentsToDestroy.addAll(os.getToAfters());
- if(!dependentsToDestroy.isEmpty()) {
+ if (!dependentsToDestroy.isEmpty()) {
return request.getDestroyDependentsCommand(dependentsToDestroy);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ParameterHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ParameterHelperAdvice.java
index b0ee5e8e139..5d6ae0cedec 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ParameterHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/ParameterHelperAdvice.java
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2014 CEA 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
@@ -20,10 +20,9 @@ import org.eclipse.uml2.uml.UMLPackage;
/**
- * Edit-helper advice for parameters. Advice includes:
+ * Edit-helper advice for parameters. Advice includes:
* <ul>
- * <li>advising create-child for value specifications to create them in the <tt>defaultValue</tt> reference instead of <tt>lowerValue</tt> or <tt>upperValue</tt>
- * from {@link MultiplicityElement}.</li>
+ * <li>advising create-child for value specifications to create them in the <tt>defaultValue</tt> reference instead of <tt>lowerValue</tt> or <tt>upperValue</tt> from {@link MultiplicityElement}.</li>
* </ul>
*/
public class ParameterHelperAdvice extends AbstractEditHelperAdvice {
@@ -35,18 +34,18 @@ public class ParameterHelperAdvice extends AbstractEditHelperAdvice {
@Override
public void configureRequest(IEditCommandRequest request) {
- if(request instanceof CreateElementRequest) {
- configureCreateElementRequest((CreateElementRequest)request);
+ if (request instanceof CreateElementRequest) {
+ configureCreateElementRequest((CreateElementRequest) request);
} else {
super.configureRequest(request);
}
}
protected void configureCreateElementRequest(CreateElementRequest request) {
- if((request.getContainmentFeature() == null) && UMLPackage.Literals.VALUE_SPECIFICATION.isSuperTypeOf(request.getElementType().getEClass())) {
+ if ((request.getContainmentFeature() == null) && UMLPackage.Literals.VALUE_SPECIFICATION.isSuperTypeOf(request.getElementType().getEClass())) {
// Prefer to create value specifications as parameter default values, not as lower/upper values for multiplicity
request.setContainmentFeature(UMLPackage.Literals.PARAMETER__DEFAULT_VALUE);
}
}
-
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/PartDecompositionHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/PartDecompositionHelperAdvice.java
index ab66ac6511f..92599e0dd77 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/PartDecompositionHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/PartDecompositionHelperAdvice.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 Atos Origin.
*
- *
+ *
* 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
@@ -25,7 +25,7 @@ public class PartDecompositionHelperAdvice extends AbstractEditHelperAdvice {
*/
@Override
protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest request) {
- PartDecomposition decomposition = (PartDecomposition)request.getElementToDestroy();
+ PartDecomposition decomposition = (PartDecomposition) request.getElementToDestroy();
// destroy the decomposed lifelines
return request.getDestroyDependentsCommand(decomposition.getCovereds());
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/PropertyHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/PropertyHelperAdvice.java
index 7311a313a7f..7b99bd09251 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/PropertyHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/PropertyHelperAdvice.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - bug 413703
*
@@ -33,6 +33,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
@@ -65,7 +66,7 @@ public class PropertyHelperAdvice extends AbstractEditHelperAdvice {
* While deleting a {@link Property}:
* - remove related {@link ConnectorEnd}
* - remove related {@link Association} when less than 2 ends remains.
- *
+ *
* </pre>
*/
@Override
@@ -74,36 +75,36 @@ public class PropertyHelperAdvice extends AbstractEditHelperAdvice {
List<EObject> dependents = new ArrayList<EObject>();
EReference[] refs = null;
- if(request.getElementToDestroy() instanceof Property) {
- Property propertyToDelete = (Property)request.getElementToDestroy();
+ if (request.getElementToDestroy() instanceof Property) {
+ Property propertyToDelete = (Property) request.getElementToDestroy();
// Get related ConnectorEnd to be destroyed with the property
// Possible references from ConnectorEnd to Property (or Port)
- refs = new EReference[]{ UMLPackage.eINSTANCE.getConnectorEnd_Role(), UMLPackage.eINSTANCE.getConnectorEnd_PartWithPort() };
+ refs = new EReference[] { UMLPackage.eINSTANCE.getConnectorEnd_Role(), UMLPackage.eINSTANCE.getConnectorEnd_PartWithPort() };
@SuppressWarnings("unchecked")
Collection<ConnectorEnd> connectorEndRefs = EMFCoreUtil.getReferencers(propertyToDelete, refs);
dependents.addAll(connectorEndRefs);
// Get possible associations using this Property as end
- refs = new EReference[]{ UMLPackage.eINSTANCE.getAssociation_MemberEnd() };
+ refs = new EReference[] { UMLPackage.eINSTANCE.getAssociation_MemberEnd() };
@SuppressWarnings("unchecked")
Collection<Association> associationRefs = EMFCoreUtil.getReferencers(propertyToDelete, refs);
- for(Association association : associationRefs) {
+ for (Association association : associationRefs) {
- // Test the number of remaining ends considering the dependents elements deletion in progress
+ // Test the number of remaining ends considering the dependents elements deletion in progress
List<Property> remainingMembers = new ArrayList<Property>();
remainingMembers.addAll(association.getMemberEnds());
remainingMembers.removeAll(request.getDependentElementsToDestroy());
- if(remainingMembers.size() <= 2) {
+ if (remainingMembers.size() <= 2) {
dependents.add(association);
}
}
}
// Return the command to destroy all these dependents
- if(!dependents.isEmpty()) {
+ if (!dependents.isEmpty()) {
return request.getDestroyDependentsCommand(dependents);
}
@@ -117,29 +118,30 @@ public class PropertyHelperAdvice extends AbstractEditHelperAdvice {
* While setting {@link Property} (excluding {@link Port}) type:
* - remove related {@link ConnectorEnd} if they become inconsistent due to the new {@link Type}.
* - add possibly required (UML) association re-factor command when needed.
- *
+ *
* </pre>
*/
@Override
protected ICommand getBeforeSetCommand(SetRequest request) {
- ICommand gmfCommand = super.getBeforeSetCommand(request);;
+ ICommand gmfCommand = super.getBeforeSetCommand(request);
+ ;
EObject elementToEdit = request.getElementToEdit();
// Two member ends of an association cannot be set to composite at the same time. To avoid
// such a situation this helper turns other ends into aggregation none before changing the property aggregation.
- if((elementToEdit instanceof Property) && !(elementToEdit instanceof Port) && (request.getFeature() == UMLPackage.eINSTANCE.getProperty_Aggregation()) && (request.getValue() != AggregationKind.NONE_LITERAL)) {
- Property propertyToEdit = (Property)elementToEdit;
-
+ if ((elementToEdit instanceof Property) && !(elementToEdit instanceof Port) && (request.getFeature() == UMLPackage.eINSTANCE.getProperty_Aggregation()) && (request.getValue() != AggregationKind.NONE_LITERAL)) {
+ Property propertyToEdit = (Property) elementToEdit;
+
// Only apply if the property is an association end.
Association relatedAssociation = propertyToEdit.getAssociation();
- if(relatedAssociation != null) {
+ if (relatedAssociation != null) {
Set<Property> members = new HashSet<Property>();
members.addAll(relatedAssociation.getMemberEnds());
members.remove(propertyToEdit);
- for(Property member : members) {
- if(member.getAggregation() != AggregationKind.NONE_LITERAL) {
+ for (Property member : members) {
+ if (member.getAggregation() != AggregationKind.NONE_LITERAL) {
SetRequest setRequest = new SetRequest(member, UMLPackage.eINSTANCE.getProperty_Aggregation(), AggregationKind.NONE_LITERAL);
SetValueCommand setAggregationCommand = new SetValueCommand(setRequest);
gmfCommand = CompositeCommand.compose(gmfCommand, setAggregationCommand);
@@ -149,15 +151,15 @@ public class PropertyHelperAdvice extends AbstractEditHelperAdvice {
}
// Type set to null implies the property should be removed from association member ends (if related to an Association)
- if((elementToEdit instanceof Property) && !(elementToEdit instanceof Port) && (request.getFeature() == UMLPackage.eINSTANCE.getTypedElement_Type()) && (request.getValue() == null)) {
- Property propertyToEdit = (Property)elementToEdit;
+ if ((elementToEdit instanceof Property) && !(elementToEdit instanceof Port) && (request.getFeature() == UMLPackage.eINSTANCE.getTypedElement_Type()) && (request.getValue() == null)) {
+ Property propertyToEdit = (Property) elementToEdit;
Association relatedAssociation = propertyToEdit.getAssociation();
- if(relatedAssociation != null) {
+ if (relatedAssociation != null) {
// General case, delete the ConnectorEnd
DestroyReferenceRequest destroyRefRequest = new DestroyReferenceRequest(relatedAssociation, UMLPackage.eINSTANCE.getAssociation_MemberEnd(), propertyToEdit, false);
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(relatedAssociation);
- if(provider != null) {
+ if (provider != null) {
// Add current EObject destroy reference command to the global command
ICommand destroyMemberRefCommand = provider.getEditCommand(destroyRefRequest);
gmfCommand = CompositeCommand.compose(gmfCommand, destroyMemberRefCommand);
@@ -165,31 +167,31 @@ public class PropertyHelperAdvice extends AbstractEditHelperAdvice {
}
}
- if((elementToEdit instanceof Property) && !(elementToEdit instanceof Port) && (request.getFeature() == UMLPackage.eINSTANCE.getTypedElement_Type()) && (request.getValue() instanceof Type)) {
+ if ((elementToEdit instanceof Property) && !(elementToEdit instanceof Port) && (request.getFeature() == UMLPackage.eINSTANCE.getTypedElement_Type()) && (request.getValue() instanceof Type)) {
- Property propertyToEdit = (Property)elementToEdit;
+ Property propertyToEdit = (Property) elementToEdit;
// Find ConnectorEnd referencing the edited Property as partWithPort
- EReference[] refs = new EReference[]{ UMLPackage.eINSTANCE.getConnectorEnd_PartWithPort() };
+ EReference[] refs = new EReference[] { UMLPackage.eINSTANCE.getConnectorEnd_PartWithPort() };
@SuppressWarnings("unchecked")
Collection<ConnectorEnd> referencers = EMFCoreUtil.getReferencers(propertyToEdit, refs);
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(propertyToEdit);
- if(provider != null) {
- for(ConnectorEnd end : referencers) {
- Type newType = (Type)request.getValue();
+ if (provider != null) {
+ for (ConnectorEnd end : referencers) {
+ Type newType = (Type) request.getValue();
// End role should be a Port
ConnectableElement cElt = end.getRole();
- if((newType != null) && (newType instanceof EncapsulatedClassifier) && (cElt != null) && (cElt instanceof Port)) {
+ if ((newType != null) && (newType instanceof EncapsulatedClassifier) && (cElt != null) && (cElt instanceof Port)) {
- // Take the new type into account to decide if current role and partWithPort will remains
+ // Take the new type into account to decide if current role and partWithPort will remains
// valid after type modification.
- Port role = (Port)cElt;
- EncapsulatedClassifier composite = (EncapsulatedClassifier)newType;
+ Port role = (Port) cElt;
+ EncapsulatedClassifier composite = (EncapsulatedClassifier) newType;
// If the role is valid, the ConnectorEnd should not be deleted
- if(composite.getAllAttributes().contains(role)) {
+ if (composite.getAllAttributes().contains(role)) {
continue;
}
}
@@ -208,17 +210,18 @@ public class PropertyHelperAdvice extends AbstractEditHelperAdvice {
Association relatedAssociation = propertyToEdit.getAssociation();
// The edited property has to be related to a UML association
- if((relatedAssociation == null) || !(ElementUtil.hasNature(relatedAssociation, UMLElementTypes.UML_NATURE))) {
+ if ((relatedAssociation == null) || !(ElementUtil.hasNature(relatedAssociation, UMLElementTypes.UML_NATURE))) {
return gmfCommand;
}
- List<EObject> currentlyRefactoredElements = (request.getParameter(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) != null) ? (List<EObject>)request.getParameter(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) : new ArrayList<EObject>();
- if(!currentlyRefactoredElements.contains(propertyToEdit)) {
+ List<EObject> currentlyRefactoredElements = (request.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) != null) ? (List<EObject>) request
+ .getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS) : new ArrayList<EObject>();
+ if (!currentlyRefactoredElements.contains(propertyToEdit)) {
currentlyRefactoredElements.add(propertyToEdit);
- request.getParameters().put(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS, currentlyRefactoredElements);
+ request.getParameters().put(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS, currentlyRefactoredElements);
// Current association already under re-factor ?
- if(currentlyRefactoredElements.contains(relatedAssociation)) {
+ if (currentlyRefactoredElements.contains(relatedAssociation)) {
return gmfCommand;
}
@@ -227,7 +230,7 @@ public class PropertyHelperAdvice extends AbstractEditHelperAdvice {
}
}
- if(gmfCommand != null) {
+ if (gmfCommand != null) {
gmfCommand = gmfCommand.reduce();
}
@@ -236,13 +239,13 @@ public class PropertyHelperAdvice extends AbstractEditHelperAdvice {
/**
* Create a re-factoring command related to a Property move.
- *
+ *
* @param setProperty
- * the property which type is set
+ * the property which type is set
* @param associationToRefactor
- * the association to re-factor (re-orient action)
+ * the association to re-factor (re-orient action)
* @param request
- * the original set request
+ * the original set request
* @return the re-factoring command
*/
private ICommand getAssociationRefactoringCommand(Property setProperty, Association associationToRefactor, SetRequest request) {
@@ -250,16 +253,16 @@ public class PropertyHelperAdvice extends AbstractEditHelperAdvice {
Association relatedAssociation = setProperty.getAssociation(); // Should not be null, test before calling method.
// Re-orient the related association (do not use edit service to avoid infinite loop here)
- int direction = ReorientRelationshipRequest.REORIENT_TARGET;
- if(setProperty == associationToRefactor.getMemberEnds().get(1)) {
- direction = ReorientRelationshipRequest.REORIENT_SOURCE;
+ int direction = ReorientRequest.REORIENT_TARGET;
+ if (setProperty == associationToRefactor.getMemberEnds().get(1)) {
+ direction = ReorientRequest.REORIENT_SOURCE;
}
- ReorientRelationshipRequest reorientRequest = new ReorientRelationshipRequest(relatedAssociation, (Type)request.getValue(), setProperty.eContainer(), direction);
+ ReorientRelationshipRequest reorientRequest = new ReorientRelationshipRequest(relatedAssociation, (Type) request.getValue(), setProperty.eContainer(), direction);
reorientRequest.addParameters(request.getParameters());
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(relatedAssociation);
- if(provider != null) {
+ if (provider != null) {
return provider.getEditCommand(reorientRequest);
}
@@ -268,15 +271,15 @@ public class PropertyHelperAdvice extends AbstractEditHelperAdvice {
@Override
public void configureRequest(IEditCommandRequest request) {
- if(request instanceof CreateElementRequest) {
- configureCreateElementRequest((CreateElementRequest)request);
+ if (request instanceof CreateElementRequest) {
+ configureCreateElementRequest((CreateElementRequest) request);
} else {
super.configureRequest(request);
}
}
protected void configureCreateElementRequest(CreateElementRequest request) {
- if((request.getContainmentFeature() == null) && UMLPackage.Literals.VALUE_SPECIFICATION.isSuperTypeOf(request.getElementType().getEClass())) {
+ if ((request.getContainmentFeature() == null) && UMLPackage.Literals.VALUE_SPECIFICATION.isSuperTypeOf(request.getElementType().getEClass())) {
// Prefer to create value specifications as property default values, not as lower/upper values for multiplicity
request.setContainmentFeature(UMLPackage.Literals.PROPERTY__DEFAULT_VALUE);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/RefineEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/RefineEditHelperAdvice.java
index aadd127a98d..16656151261 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/RefineEditHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/RefineEditHelperAdvice.java
@@ -39,8 +39,8 @@ public class RefineEditHelperAdvice extends AbstractStereotypedElementEditHelper
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
+ NamedElement element = (NamedElement) request.getElementToConfigure();
+ if (element != null) {
StereotypeApplicationHelper.INSTANCE.applyStereotype(element, StandardPackage.eINSTANCE.getRefine());
// Set default name
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StructuredClassifierHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StructuredClassifierHelperAdvice.java
index a02d1185555..faf94102a80 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StructuredClassifierHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StructuredClassifierHelperAdvice.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -22,7 +22,7 @@ import org.eclipse.uml2.uml.Connector;
/**
* <pre>
* This HelperAdvice completes {@link StructuredClassifier} edit commands with:
- * - forbidding Connector to be moved to another {@link StructuredClassifier},
+ * - forbidding Connector to be moved to another {@link StructuredClassifier},
* the owner is used to know whether the Connector is valid or not (upon creation).
* </pre>
*/
@@ -41,8 +41,8 @@ public class StructuredClassifierHelperAdvice extends AbstractEditHelperAdvice {
ICommand gmfCommand = super.getBeforeMoveCommand(request);
// Parse moved objects and detect connector moves
- for(Object movedObject : request.getElementsToMove().keySet()) {
- if(movedObject instanceof Connector) {
+ for (Object movedObject : request.getElementsToMove().keySet()) {
+ if (movedObject instanceof Connector) {
// Replace default command.
gmfCommand = UnexecutableCommand.INSTANCE;
break;
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TraceEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TraceEditHelperAdvice.java
index a4398e55b23..ea2d8cbf53d 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TraceEditHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TraceEditHelperAdvice.java
@@ -39,8 +39,8 @@ public class TraceEditHelperAdvice extends AbstractStereotypedElementEditHelperA
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
+ NamedElement element = (NamedElement) request.getElementToConfigure();
+ if (element != null) {
StereotypeApplicationHelper.INSTANCE.applyStereotype(element, StandardPackage.eINSTANCE.getRefine());
// Set default name
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/AssociationMatcher.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/AssociationMatcher.java
index c1043c52a66..706ed0dd94f 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/AssociationMatcher.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/AssociationMatcher.java
@@ -35,20 +35,20 @@ public class AssociationMatcher implements IElementMatcher {
boolean isMatch = false;
if (eObject instanceof Association) {
-
+
Association association = (Association) eObject;
if (hasValidNature(association) || hasNoNature(association)) {
isMatch = true;
}
}
-
+
return isMatch;
}
-
+
private boolean hasValidNature(Element element) {
return ElementUtil.hasNature(element, UMLElementTypes.UML_NATURE);
}
-
+
private boolean hasNoNature(Element element) {
return (ElementUtil.getNature(element) == null);
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/RefineMatcher.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/RefineMatcher.java
index 9fc19e7d01e..1da3b7b3bb5 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/RefineMatcher.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/RefineMatcher.java
@@ -23,10 +23,10 @@ public class RefineMatcher implements IElementMatcher {
public boolean matches(EObject eObject) {
boolean isMatch = false;
- if(eObject instanceof Abstraction) {
+ if (eObject instanceof Abstraction) {
- Abstraction element = (Abstraction)eObject;
- if(UMLUtil.getStereotypeApplication(element, Refine.class) != null) {
+ Abstraction element = (Abstraction) eObject;
+ if (UMLUtil.getStereotypeApplication(element, Refine.class) != null) {
isMatch = true;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/TraceMatcher.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/TraceMatcher.java
index bb8b819d572..8fc515eb70c 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/TraceMatcher.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/matcher/TraceMatcher.java
@@ -23,10 +23,10 @@ public class TraceMatcher implements IElementMatcher {
public boolean matches(EObject eObject) {
boolean isMatch = false;
- if(eObject instanceof Abstraction) {
+ if (eObject instanceof Abstraction) {
- Abstraction element = (Abstraction)eObject;
- if(UMLUtil.getStereotypeApplication(element, Trace.class) != null) {
+ Abstraction element = (Abstraction) eObject;
+ if (UMLUtil.getStereotypeApplication(element, Trace.class) != null) {
isMatch = true;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/menu/AbstractCreateUmlChildMenu.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/menu/AbstractCreateUmlChildMenu.java
index 22f81dd048a..7d16bab3205 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/menu/AbstractCreateUmlChildMenu.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/menu/AbstractCreateUmlChildMenu.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,9 +23,9 @@ public abstract class AbstractCreateUmlChildMenu extends AbstractCreateMenuFromC
public static final String UML_CREATION_COMMAND_CATEGORY = "org.eclipse.papyrus.uml.service.types.umlElementCreationCommands"; //$NON-NLS-1$
/**
- *
+ *
* Constructor.
- *
+ *
*/
public AbstractCreateUmlChildMenu() {
super(UML_CREATION_COMMAND_CATEGORY);
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/messages/Messages.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/messages/Messages.java
index 638266af2f7..a49e4ae6156 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/messages/Messages.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/messages/Messages.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ClassifierUtils.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ClassifierUtils.java
index a6c5e363374..5838d164583 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ClassifierUtils.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ClassifierUtils.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* 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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -35,11 +35,11 @@ public class ClassifierUtils {
/**
* This method provides a switch to ease the addition of a new Property in a Classifier.
- *
+ *
* @param classifier
- * the parent classifier.
+ * the parent classifier.
* @param property
- * the contained property.
+ * the contained property.
* @return false if the addition fails.
*/
public static boolean addOwnedAttribute(Classifier classifier, Property property) {
@@ -49,11 +49,11 @@ public class ClassifierUtils {
/**
* This method provides a switch to ease the addition of a new Property in a Classifier.
- *
+ *
* @param classifier
- * the parent classifier.
+ * the parent classifier.
* @param property
- * the contained property.
+ * the contained property.
* @return false if the addition fails.
*/
public static List<Property> getOwnedAttributes(Classifier classifier) {
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/CommandContext.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/CommandContext.java
index b8944a67f2e..4d76a68ff94 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/CommandContext.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/CommandContext.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ConnectorUtils.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ConnectorUtils.java
index e80e554f039..1ae48022257 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ConnectorUtils.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ConnectorUtils.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -49,11 +49,11 @@ public class ConnectorUtils {
/**
* Tries to find a common structure container view for source and target.
- *
+ *
* @param source
- * the source view
+ * the source view
* @param target
- * the target view
+ * the target view
* @return the least common structure container view
*/
public View deduceViewContainer(View source, View target) {
@@ -64,8 +64,8 @@ public class ConnectorUtils {
// The deduced container is the StructuredClassifier related to the least
// common containing View.
View deducedContainer = null;
- for(View container : sourceProposedContainers) {
- if(targetProposedContainers.contains(container)) {
+ for (View container : sourceProposedContainers) {
+ if (targetProposedContainers.contains(container)) {
deducedContainer = container;
break;
}
@@ -77,15 +77,15 @@ public class ConnectorUtils {
public Property getPartWithPort(View checkedView, View oppositeView) {
Property result = null;
EObject targetPort = checkedView.getElement();
- if(targetPort instanceof Port) {
+ if (targetPort instanceof Port) {
// Only look for PartWithPort if the role is a Port.
View parentView = ViewUtil.getContainerView(checkedView);
EObject semanticParent = parentView.getElement();
- if((semanticParent instanceof Property) && !(semanticParent instanceof Port)) {
+ if ((semanticParent instanceof Property) && !(semanticParent instanceof Port)) {
// Only add PartWithPort for assembly (not for delegation)
- if(!EcoreUtil.isAncestor(parentView, oppositeView)) {
- result = (Property)semanticParent;
+ if (!EcoreUtil.isAncestor(parentView, oppositeView)) {
+ result = (Property) semanticParent;
}
}
@@ -97,11 +97,11 @@ public class ConnectorUtils {
/**
* Tries to find a common StructuredClassifier container to add the new Connector.
- *
+ *
* @param source
- * the source graphical view
+ * the source graphical view
* @param target
- * the target graphical view
+ * the target graphical view
* @return a common StructuredClassifier container (graphical search through views)
*/
public StructuredClassifier deduceContainer(View source, View target) {
@@ -110,17 +110,17 @@ public class ConnectorUtils {
/**
* Collect container hierarchy for a view (including itself and keeping containment order).
- *
+ *
* @param view
- * the graphical view
+ * the graphical view
* @return the list of containing Views.
*/
public List<View> getStructureContainers(View view) {
List<View> containerViews = new ArrayList<View>();
- for(View currentView = view; currentView != null; currentView = ViewUtil.getContainerView(currentView)) {
- if((currentView instanceof Shape) && (getStructuredClassifier(currentView) != null)) {
+ for (View currentView = view; currentView != null; currentView = ViewUtil.getContainerView(currentView)) {
+ if ((currentView instanceof Shape) && (getStructuredClassifier(currentView) != null)) {
containerViews.add(currentView);
}
}
@@ -131,9 +131,9 @@ public class ConnectorUtils {
/**
* Get the {@link StructuredClassifier} related to a View.
* If the view relates to a Property, returns its type in case it is a StructuredClassifier.
- *
+ *
* @param view
- * the graphical view
+ * the graphical view
* @return the related {@link StructuredClassifier}
*/
public StructuredClassifier getStructuredClassifier(View view) {
@@ -141,13 +141,13 @@ public class ConnectorUtils {
StructuredClassifier structuredClassifier = null;
EObject semanticElement = view.getElement();
- if(semanticElement instanceof StructuredClassifier) {
- structuredClassifier = (StructuredClassifier)semanticElement;
+ if (semanticElement instanceof StructuredClassifier) {
+ structuredClassifier = (StructuredClassifier) semanticElement;
- } else if(semanticElement instanceof Property) {
- Property property = (Property)semanticElement;
- if((property.getType() != null) && (property.getType() instanceof StructuredClassifier)) {
- structuredClassifier = (StructuredClassifier)property.getType();
+ } else if (semanticElement instanceof Property) {
+ Property property = (Property) semanticElement;
+ if ((property.getType() != null) && (property.getType() instanceof StructuredClassifier)) {
+ structuredClassifier = (StructuredClassifier) property.getType();
}
} // else return null
@@ -167,9 +167,9 @@ public class ConnectorUtils {
/**
* This methods looks for inconsistent views to delete in case the connector is deleted or
* re-oriented.
- *
+ *
* @param connector
- * the modified connector
+ * the modified connector
* @return the list of {@link View} to delete
*/
public final Set<View> getViewsRepresentingConnector(final Connector connector) {
@@ -177,7 +177,7 @@ public class ConnectorUtils {
// Find Views in Diagrams that are referencing current member
final Iterator<View> viewIt = CrossReferencerUtil.getCrossReferencingViews(connector, null).iterator();
- while(viewIt.hasNext()) {
+ while (viewIt.hasNext()) {
View view = viewIt.next();
viewsToDestroy.add(view);
}
@@ -186,22 +186,22 @@ public class ConnectorUtils {
}
/**
- *
+ *
* @param connector
- * the connector
+ * the connector
* @return
* <code>true</code> if we should apply UML rules
*/
- //TODO : find a better way for that!
+ // TODO : find a better way for that!
public static final boolean applyUMLRulesForConnector(final Connector connector) {
final Element element = connector.getOwner();
return element.getAppliedStereotype("SysML::Blocks::Block") == null; //$NON-NLS-1$
}
/**
- *
+ *
* @param connectorOwner
- * the owner of the connector
+ * the owner of the connector
* @return
* the list of the possible role for the connector, according to the UML Standart 2.4 :
* We can deduce the possible roles for a UML Connector, because the roles must have the same owner than the connector :
@@ -213,11 +213,11 @@ public class ConnectorUtils {
availableRole.addAll(connectorOwner.getAllAttributes());
final Iterator<Property> iterator = availableRole.iterator();
final Set<Property> toAdd = new HashSet<Property>();
- while(iterator.hasNext()) {
+ while (iterator.hasNext()) {
final Property prop = iterator.next();
final Type type = prop.getType();
- if(type instanceof EncapsulatedClassifier) {
- toAdd.addAll(((EncapsulatedClassifier)type).getOwnedPorts());
+ if (type instanceof EncapsulatedClassifier) {
+ toAdd.addAll(((EncapsulatedClassifier) type).getOwnedPorts());
}
}
return availableRole;
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/EMFUtil.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/EMFUtil.java
index b181cd681f9..981ad7daf16 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/EMFUtil.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/EMFUtil.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -24,16 +24,16 @@ import org.eclipse.emf.edit.domain.EditingDomain;
/**
* Utility class use to retrieve stereotype applications.
- *
+ *
* Copied from oep.infra.emf.EMFHelper to avoid dependency toward this plug-in.
- *
+ *
*/
public class EMFUtil {
/**
* Tests if an EObject is read only
* Delegates to the EObject's editing domain if it can be found
- *
+ *
* @param eObject
* @return
* True if the EObject is read only
@@ -46,7 +46,7 @@ public class EMFUtil {
/**
* Tests if an EObject is read only
* Delegates to the given editing domain if it isn't null
- *
+ *
* @param eObject
* @param domain
* @return
@@ -59,29 +59,29 @@ public class EMFUtil {
/**
* Tests if the Resource is read only
* Delegates to the given editing domain if it isn't null
- *
+ *
* @param resource
* @param domain
* @return
* True if the Resource is read only
*/
public static boolean isReadOnly(Resource resource, EditingDomain domain) {
- if(domain instanceof AdapterFactoryEditingDomain) {
- return ((AdapterFactoryEditingDomain)domain).isReadOnly(resource);
+ if (domain instanceof AdapterFactoryEditingDomain) {
+ return ((AdapterFactoryEditingDomain) domain).isReadOnly(resource);
}
- if(resource == null) {
+ if (resource == null) {
return false;
}
ResourceSet resourceSet = resource.getResourceSet();
- if(resourceSet == null) {
+ if (resourceSet == null) {
return false;
}
Map<String, ?> attributes = resourceSet.getURIConverter().getAttributes(resource.getURI(), null);
- Boolean readOnly = (Boolean)attributes.get(URIConverter.ATTRIBUTE_READ_ONLY);
+ Boolean readOnly = (Boolean) attributes.get(URIConverter.ATTRIBUTE_READ_ONLY);
return readOnly == null ? false : readOnly;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ElementUtil.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ElementUtil.java
index f3701aa4077..01329ad0319 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ElementUtil.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ElementUtil.java
@@ -1,14 +1,14 @@
/*****************************************************************************
* Copyright (c) 2009-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:
- *
+ *
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
@@ -23,9 +23,9 @@ import org.eclipse.uml2.uml.util.UMLUtil;
/**
* Utility class use to retrieve stereotype applications.
- *
+ *
* Copied from oep.umlutils to avoid dependency toward this plug-in.
- *
+ *
*/
public class ElementUtil {
@@ -35,14 +35,14 @@ public class ElementUtil {
private static final String PAPYRUS_URI = "org.eclipse.papyrus";
/**
- * The ID for element nature in Papyrus EAnnotations.
+ * The ID for element nature in Papyrus EAnnotations.
*/
private static final String PAPYRUS_ELEMENT_NATURE = "nature";
/**
* Convenient method to retrieve the StereotypeApplication by passing an
* element of the static profile.
- *
+ *
* @deprecated prefer using {@link UMLUtil#getStereotypeApplication(Element, Class)}
*/
@Deprecated
@@ -52,16 +52,16 @@ public class ElementUtil {
/**
* Adds the specified nature to this element.
- *
+ *
* @param element
- * The receiving '<em><b>Element</b></em>' model object.
+ * The receiving '<em><b>Element</b></em>' model object.
* @param nature
- * The nature to add.
+ * The nature to add.
*/
public static void addNature(Element element, String nature) {
EMap<String, String> details = UML2Util.getEAnnotation(element, PAPYRUS_URI, true).getDetails();
- if(!details.containsKey(PAPYRUS_ELEMENT_NATURE)) {
+ if (!details.containsKey(PAPYRUS_ELEMENT_NATURE)) {
details.put(PAPYRUS_ELEMENT_NATURE, nature);
} else {
details.removeKey(PAPYRUS_ELEMENT_NATURE);
@@ -72,14 +72,14 @@ public class ElementUtil {
/**
* Retrieves the nature for this element.
- *
+ *
* @param element
- * The receiving '<em><b>Element</b></em>' model object.
+ * The receiving '<em><b>Element</b></em>' model object.
*/
public static String getNature(Element element) {
EAnnotation eAnnotation = element.getEAnnotation(PAPYRUS_URI);
- if((eAnnotation != null) && (eAnnotation.getDetails().containsKey(PAPYRUS_ELEMENT_NATURE))) {
+ if ((eAnnotation != null) && (eAnnotation.getDetails().containsKey(PAPYRUS_ELEMENT_NATURE))) {
return eAnnotation.getDetails().get(PAPYRUS_ELEMENT_NATURE);
}
@@ -88,17 +88,17 @@ public class ElementUtil {
/**
* Removes the nature from this element.
- *
+ *
* @param element
- * The receiving '<em><b>Element</b></em>' model object.
+ * The receiving '<em><b>Element</b></em>' model object.
*/
public static boolean removeNature(Element element) {
EAnnotation eAnnotation = element.getEAnnotation(PAPYRUS_URI);
- if(eAnnotation != null) {
+ if (eAnnotation != null) {
EMap<String, String> details = eAnnotation.getDetails();
- if(details.containsKey(PAPYRUS_ELEMENT_NATURE)) {
+ if (details.containsKey(PAPYRUS_ELEMENT_NATURE)) {
details.removeKey(PAPYRUS_ELEMENT_NATURE);
return true;
}
@@ -109,17 +109,17 @@ public class ElementUtil {
/**
* Determines whether this element has the specified nature.
- *
+ *
* @param element
- * The receiving '<em><b>Element</b></em>' model object.
+ * The receiving '<em><b>Element</b></em>' model object.
* @param nature
- * The nature in question.
+ * The nature in question.
*/
public static boolean hasNature(Element element, String nature) {
EAnnotation eAnnotation = element.getEAnnotation(PAPYRUS_URI);
- if((eAnnotation != null) && (eAnnotation.getDetails().containsKey(PAPYRUS_ELEMENT_NATURE))) {
- if(nature.equals(eAnnotation.getDetails().get(PAPYRUS_ELEMENT_NATURE))) {
+ if ((eAnnotation != null) && (eAnnotation.getDetails().containsKey(PAPYRUS_ELEMENT_NATURE))) {
+ if (nature.equals(eAnnotation.getDetails().get(PAPYRUS_ELEMENT_NATURE))) {
return true;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ICommandContext.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ICommandContext.java
index ee9f994fb5d..5713e76659e 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ICommandContext.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ICommandContext.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,14 +21,14 @@ public interface ICommandContext {
/**
* Get the container of the created element.
- *
+ *
* @return the container.
*/
public EObject getContainer();
/**
* Get the reference the created element relates.
- *
+ *
* @return the EReference.
*/
public EReference getReference();
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/InteractionConstraintUtil.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/InteractionConstraintUtil.java
index cfd660f6748..7a8a97e620b 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/InteractionConstraintUtil.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/InteractionConstraintUtil.java
@@ -8,42 +8,42 @@ import org.eclipse.uml2.uml.ValueSpecification;
* loop-operand ::= loop [ '(' min-int [ ',' max-int ] ')' ]
* min-int ::= non-negative-integer
* max-int ::= positive-integer | '*'
- *
+ *
* 1. If loop has no bounds specified, it means potentially infinite loop with zero as lower bound and infinite upper bound..
* 2. If only min-int is specified, it means that upper bound is equal to the lower bound, and loop will be executed exactly the specified
* number of times.
* 3. If max-int is specified, it should be greater than or equal to min-int. Loop will iterate minimum the min-int number of times and at
* most the max-int number of times.
- *
+ *
* @author Jin Liu (jin.liu@soyatec.com)
*/
public class InteractionConstraintUtil {
public static Integer getNonNegativeInteger(Object value) {
- if(value == null) {
+ if (value == null) {
return null;
}
- if("*".equals(value) || "*".equals(value.toString())) {
+ if ("*".equals(value) || "*".equals(value.toString())) {
return Integer.MAX_VALUE;
- } else if(value instanceof Integer) {
- return (Integer)value;
- } else if(value instanceof ValueSpecification) {
- ValueSpecification valueSpec = (ValueSpecification)value;
+ } else if (value instanceof Integer) {
+ return (Integer) value;
+ } else if (value instanceof ValueSpecification) {
+ ValueSpecification valueSpec = (ValueSpecification) value;
try {
int intValue = valueSpec.integerValue();
- if(intValue >= 0) {
+ if (intValue >= 0) {
return Integer.valueOf(intValue);
}
} catch (Exception e) {
String stringValue = valueSpec.stringValue();
- if("*".equals(stringValue)) {
+ if ("*".equals(stringValue)) {
return Integer.MAX_VALUE;
}
}
} else {
try {
int intValue = Integer.parseInt(value.toString());
- if(intValue >= 0) {
+ if (intValue >= 0) {
return Integer.valueOf(intValue);
}
} catch (NumberFormatException e) {
@@ -53,42 +53,42 @@ public class InteractionConstraintUtil {
}
public static Integer getMinintValue(InteractionConstraint guard) {
- if(guard == null) {
+ if (guard == null) {
return null;
}
ValueSpecification minint = guard.getMinint();
- if(minint == null) {
+ if (minint == null) {
return null;
}
try {
int min = minint.integerValue();
- if(min >= 0) {
+ if (min >= 0) {
return Integer.valueOf(min);
}
} catch (Exception e) {
- //must be a number.
+ // must be a number.
}
return null;
}
public static Integer getMaxintValue(InteractionConstraint guard) {
- if(guard == null) {
+ if (guard == null) {
return null;
}
ValueSpecification maxint = guard.getMaxint();
- if(maxint == null) {
+ if (maxint == null) {
return null;
}
try {
int max = maxint.integerValue();
- if(max < 1) {
+ if (max < 1) {
return null;
} else {
return Integer.valueOf(max);
}
} catch (Exception e) {
- //must be a number or *.
- if("*".equals(maxint.stringValue())) {
+ // must be a number or *.
+ if ("*".equals(maxint.stringValue())) {
return Integer.MAX_VALUE;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/NamedElementHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/NamedElementHelper.java
index d9c457297ae..3ccf7feba8c 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/NamedElementHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/NamedElementHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2008, 2014 CEA LIST 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
@@ -25,7 +25,7 @@ import org.eclipse.uml2.uml.Namespace;
/**
* This singleton is used to find a new element name with
* no duplication in the same workspace.
- *
+ *
* @deprecated Use the {@link NamedElementUtil} API, instead.
*/
@Deprecated
@@ -40,7 +40,7 @@ public class NamedElementHelper {
/**
* Get the base string to use for default name creation
- *
+ *
* @return the base string
* @deprecated should not be used.
*/
@@ -51,12 +51,12 @@ public class NamedElementHelper {
/**
* Generic method that returns a new unique name within a {@link Namespace}.
- *
+ *
* @param umlParent
- * the parent of the element to create
+ * the parent of the element to create
* @param eclass
- * the eClass of the element to name
- *
+ * the eClass of the element to name
+ *
* @return a distinguishable name within the {@link Namespace} of the umlParent
* @deprecated should not be used.
*/
@@ -67,12 +67,12 @@ public class NamedElementHelper {
/**
* Generic method that returns a new unique name within a {@link Namespace}.
- *
+ *
* @param umlParent
- * the parent of the element to create
+ * the parent of the element to create
* @param baseString
- * the base string for the new element name
- *
+ * the base string for the new element name
+ *
* @return a distinguishable name within the {@link Namespace} of the umlParent
* @deprecated use {@link #getDefaultNameWithIncrementFromBase(String, Collection)} directly.
*/
@@ -83,9 +83,9 @@ public class NamedElementHelper {
/**
* set the base string for the name
- *
+ *
* @param baseString
- * a string that is the prefix
+ * a string that is the prefix
* @deprecated should not be used.
*/
@Deprecated
@@ -100,7 +100,7 @@ public class NamedElementHelper {
public static String getDefaultNameWithIncrementFromBase(String base, Collection<?> contents, String separator) {
return getDefaultNameWithIncrementFromBase(base, contents, null, separator);
}
-
+
public static String getDefaultNameWithIncrementFromBase(String base, Collection<?> contents, EObject elementToRename) {
return getDefaultNameWithIncrementFromBase(base, contents, elementToRename, "");
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterConstants.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterConstants.java
index b7e996dc5b3..8e4a54ea16c 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterConstants.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterConstants.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -17,13 +17,14 @@ package org.eclipse.papyrus.uml.service.types.utils;
* <pre>
* IDs of request parameters.
* </pre>
+ *
* @use org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants instead
*/
public interface RequestParameterConstants extends org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants {
/**
* Parameter used to override som UML Constraint (for sysml)
- *
+ *
*/
public static final String UML_STRICT = "UML_STRICT"; //$NON-NLS-1$
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterUtils.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterUtils.java
index 34aa7c5768c..d96f405708a 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterUtils.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/RequestParameterUtils.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -28,84 +28,85 @@ public class RequestParameterUtils {
/**
* Get the source graphical view provided as {@link IEditCommandRequest} parameter.
- *
+ *
* @param req
- * the edit command request
- *
+ * the edit command request
+ *
* @return the source view
*/
public static View getSourceView(IEditCommandRequest req) {
- return (View)req.getParameter(RequestParameterConstants.EDGE_CREATE_REQUEST_SOURCE_VIEW);
+ return (View) req.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.EDGE_CREATE_REQUEST_SOURCE_VIEW);
}
/**
* Get the target graphical view provided as {@link IEditCommandRequest} parameter.
- *
+ *
* @param req
- * the edit command request
- *
+ * the edit command request
+ *
* @return the target view
*/
public static View getTargetView(IEditCommandRequest req) {
- return (View)req.getParameter(RequestParameterConstants.EDGE_CREATE_REQUEST_TARGET_VIEW);
+ return (View) req.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.EDGE_CREATE_REQUEST_TARGET_VIEW);
}
/**
* Get the reconnected graphical edge provided as {@link IEditCommandRequest} parameter.
- *
+ *
* @param req
- * the edit command request
- *
+ * the edit command request
+ *
* @return the reconnected edge
*/
public static Edge getReconnectedEdge(IEditCommandRequest req) {
- return (Edge)req.getParameter(RequestParameterConstants.GRAPHICAL_RECONNECTED_EDGE);
+ return (Edge) req.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.GRAPHICAL_RECONNECTED_EDGE);
}
/**
* Get the reconnected graphical end view provided as {@link IEditCommandRequest} parameter.
- *
+ *
* @param req
- * the edit command request
- *
+ * the edit command request
+ *
* @return the reconnected end view
*/
public static View getReconnectedEndView(IEditCommandRequest req) {
- return (View)req.getParameter(RequestParameterConstants.EDGE_REORIENT_REQUEST_END_VIEW);
+ return (View) req.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.EDGE_REORIENT_REQUEST_END_VIEW);
}
/**
* Get the list of dependents that should not be destroyed during delete.
- *
+ *
* @param req
- * the edit command request
- *
+ * the edit command request
+ *
* @return the list of dependents to keep
*/
public static List<EObject> getDependentsToKeep(IEditCommandRequest req) {
- return (List<EObject>)req.getParameter(RequestParameterConstants.DEPENDENTS_TO_KEEP);
+ return (List<EObject>) req.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.DEPENDENTS_TO_KEEP);
}
/**
* Get the list of association related elements currently re-factored.
- *
+ *
* @param req
- * the edit command request
- *
+ * the edit command request
+ *
* @return the list of association related elements currently re-factored
*/
public static List<EObject> getAssociationRefactoredElements(IEditCommandRequest req) {
- return (List<EObject>)req.getParameter(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS);
+ return (List<EObject>) req.getParameter(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS);
}
/**
* Add an EObject to the list of association related elements currently re-factored.
*
- * @param eObject the eObject to add
+ * @param eObject
+ * the eObject to add
*/
public static void addAssociationRefactoredElement(IEditCommandRequest req, EObject eObject) {
List<EObject> refactoredElements = (getAssociationRefactoredElements(req) != null) ? getAssociationRefactoredElements(req) : new ArrayList<EObject>();
refactoredElements.add(eObject);
- req.getParameters().put(RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS, refactoredElements);
+ req.getParameters().put(org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants.ASSOCIATION_REFACTORED_ELEMENTS, refactoredElements);
}
}

Back to the top