Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java420
1 files changed, 272 insertions, 148 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java
index 8f906d7a151..02b40944d4b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java
@@ -96,7 +96,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
public static final String VISUAL_ID_KEY = "visual_id"; //$NON-NLS-1$
/**
- * Extended request data key to hold the edge view during a reconnect request.
+ * Extended request data key to hold the edge view during a reconnect
+ * request.
*
* @generated
*/
@@ -115,25 +116,28 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
}
/**
- * Extended request data key to hold editpart visual id.
- * Add visual id of edited editpart to extended data of the request
- * so command switch can decide what kind of diagram element is being edited.
- * It is done in those cases when it's not possible to deduce diagram
- * element kind from domain element.
- * Add the reoriented view to the request extended data so that the view
- * currently edited can be distinguished from other views of the same element
- * and these latter possibly removed if they become inconsistent after reconnect
+ * Extended request data key to hold editpart visual id. Add visual id of
+ * edited editpart to extended data of the request so command switch can
+ * decide what kind of diagram element is being edited. It is done in those
+ * cases when it's not possible to deduce diagram element kind from domain
+ * element. Add the reoriented view to the request extended data so that the
+ * view currently edited can be distinguished from other views of the same
+ * element and these latter possibly removed if they become inconsistent
+ * after reconnect
*
* @generated
*/
@SuppressWarnings("unchecked")
public Command getCommand(Request request) {
- if(request instanceof ReconnectRequest) {
- Object view = ((ReconnectRequest)request).getConnectionEditPart().getModel();
- if(view instanceof View) {
- Integer id = new Integer(UMLVisualIDRegistry.getVisualID((View)view));
+ if (request instanceof ReconnectRequest) {
+ Object view = ((ReconnectRequest) request).getConnectionEditPart()
+ .getModel();
+ if (view instanceof View) {
+ Integer id = new Integer(
+ UMLVisualIDRegistry.getVisualID((View) view));
request.getExtendedData().put(VISUAL_ID_KEY, id);
- request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, (View)view);
+ request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE,
+ (View) view);
}
}
return super.getCommand(request);
@@ -146,7 +150,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected int getVisualID(IEditCommandRequest request) {
Object id = request.getParameter(VISUAL_ID_KEY);
- return id instanceof Integer ? ((Integer)id).intValue() : -1;
+ return id instanceof Integer ? ((Integer) id).intValue() : -1;
}
/**
@@ -155,10 +159,12 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
protected Command getSemanticCommand(IEditCommandRequest request) {
IEditCommandRequest completedRequest = completeRequest(request);
Command semanticCommand = getSemanticCommandSwitch(completedRequest);
- semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
- if(completedRequest instanceof DestroyRequest) {
- DestroyRequest destroyRequest = (DestroyRequest)completedRequest;
- return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
+ semanticCommand = getEditHelperCommand(completedRequest,
+ semanticCommand);
+ if (completedRequest instanceof DestroyRequest) {
+ DestroyRequest destroyRequest = (DestroyRequest) completedRequest;
+ return shouldProceed(destroyRequest) ? addDeleteViewCommand(
+ semanticCommand, destroyRequest) : null;
}
return semanticCommand;
}
@@ -166,27 +172,35 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View)getHost().getModel()));
- return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
+ protected Command addDeleteViewCommand(Command mainCommand,
+ DestroyRequest completedRequest) {
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(
+ getEditingDomain(), (View) getHost().getModel()));
+ return mainCommand == null ? deleteViewCommand : mainCommand
+ .chain(deleteViewCommand);
}
/**
* @generated
*/
- private Command getEditHelperCommand(IEditCommandRequest request, Command editPolicyCommand) {
- if(editPolicyCommand != null) {
- ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy)editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
- request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, command);
+ private Command getEditHelperCommand(IEditCommandRequest request,
+ Command editPolicyCommand) {
+ if (editPolicyCommand != null) {
+ ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy) editPolicyCommand)
+ .getICommand() : new CommandProxy(editPolicyCommand);
+ request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND,
+ command);
}
IElementType requestContextElementType = getContextElementType(request);
- request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE, requestContextElementType);
+ request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE,
+ requestContextElementType);
ICommand command = requestContextElementType.getEditCommand(request);
request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, null);
request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE, null);
- if(command != null) {
- if(!(command instanceof CompositeTransactionalCommand)) {
- command = new CompositeTransactionalCommand(getEditingDomain(), command.getLabel()).compose(command);
+ if (command != null) {
+ if (!(command instanceof CompositeTransactionalCommand)) {
+ command = new CompositeTransactionalCommand(getEditingDomain(),
+ command.getLabel()).compose(command);
}
return new ICommandProxy(command);
}
@@ -197,36 +211,38 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
protected IElementType getContextElementType(IEditCommandRequest request) {
- IElementType requestContextElementType = UMLElementTypes.getElementType(getVisualID(request));
- return requestContextElementType != null ? requestContextElementType : myElementType;
+ IElementType requestContextElementType = UMLElementTypes
+ .getElementType(getVisualID(request));
+ return requestContextElementType != null ? requestContextElementType
+ : myElementType;
}
/**
* @generated
*/
protected Command getSemanticCommandSwitch(IEditCommandRequest req) {
- if(req instanceof CreateRelationshipRequest) {
- return getCreateRelationshipCommand((CreateRelationshipRequest)req);
- } else if(req instanceof CreateElementRequest) {
- return getCreateCommand((CreateElementRequest)req);
- } else if(req instanceof ConfigureRequest) {
- return getConfigureCommand((ConfigureRequest)req);
- } else if(req instanceof DestroyElementRequest) {
- return getDestroyElementCommand((DestroyElementRequest)req);
- } else if(req instanceof DestroyReferenceRequest) {
- return getDestroyReferenceCommand((DestroyReferenceRequest)req);
- } else if(req instanceof DuplicateElementsRequest) {
- return getDuplicateCommand((DuplicateElementsRequest)req);
- } else if(req instanceof GetEditContextRequest) {
- return getEditContextCommand((GetEditContextRequest)req);
- } else if(req instanceof MoveRequest) {
- return getMoveCommand((MoveRequest)req);
- } else if(req instanceof ReorientReferenceRelationshipRequest) {
- return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest)req);
- } else if(req instanceof ReorientRelationshipRequest) {
- return getReorientRelationshipCommand((ReorientRelationshipRequest)req);
- } else if(req instanceof SetRequest) {
- return getSetCommand((SetRequest)req);
+ if (req instanceof CreateRelationshipRequest) {
+ return getCreateRelationshipCommand((CreateRelationshipRequest) req);
+ } else if (req instanceof CreateElementRequest) {
+ return getCreateCommand((CreateElementRequest) req);
+ } else if (req instanceof ConfigureRequest) {
+ return getConfigureCommand((ConfigureRequest) req);
+ } else if (req instanceof DestroyElementRequest) {
+ return getDestroyElementCommand((DestroyElementRequest) req);
+ } else if (req instanceof DestroyReferenceRequest) {
+ return getDestroyReferenceCommand((DestroyReferenceRequest) req);
+ } else if (req instanceof DuplicateElementsRequest) {
+ return getDuplicateCommand((DuplicateElementsRequest) req);
+ } else if (req instanceof GetEditContextRequest) {
+ return getEditContextCommand((GetEditContextRequest) req);
+ } else if (req instanceof MoveRequest) {
+ return getMoveCommand((MoveRequest) req);
+ } else if (req instanceof ReorientReferenceRelationshipRequest) {
+ return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest) req);
+ } else if (req instanceof ReorientRelationshipRequest) {
+ return getReorientRelationshipCommand((ReorientRelationshipRequest) req);
+ } else if (req instanceof SetRequest) {
+ return getSetCommand((SetRequest) req);
}
return null;
}
@@ -249,16 +265,32 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
protected Command getCreateCommand(CreateElementRequest req) {
- // no more usage of the extended types here.
+ IElementType requestElementType = req.getElementType();
+ if (requestElementType instanceof IExtendedHintedElementType) {
+ IExtendedHintedElementType extendedElementType = (IExtendedHintedElementType) requestElementType;
+
+ // try to get a semantic create command from the extended type
+ IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(req.getContainer());
+ if (commandProvider != null) {
+ ICommand command = commandProvider.getEditCommand(req);
+ if (command != null && command.canExecute()) {
+ return new ICommandProxy(command);
+ }
+ }
+ }
+
return null;
}
/**
* @generated
*/
- protected Command getExtendedTypeCreationCommand(CreateElementRequest request, IExtendedHintedElementType requestElementType) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(request.getContainer());
- if(provider == null) {
+ protected Command getExtendedTypeCreationCommand(
+ CreateElementRequest request,
+ IExtendedHintedElementType requestElementType) {
+ IElementEditService provider = ElementEditServiceUtils
+ .getCommandProvider(request.getContainer());
+ if (provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
@@ -269,9 +301,12 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- protected Command getExtendedStartCreateRelationshipCommand(CreateElementRequest request, IExtendedHintedElementType requestElementType) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(requestElementType);
- if(provider == null) {
+ protected Command getExtendedStartCreateRelationshipCommand(
+ CreateElementRequest request,
+ IExtendedHintedElementType requestElementType) {
+ IElementEditService provider = ElementEditServiceUtils
+ .getCommandProvider(requestElementType);
+ if (provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
@@ -282,9 +317,12 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- protected Command getExtendedCompleteCreateRelationshipCommand(CreateElementRequest request, IExtendedHintedElementType requestElementType) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(requestElementType);
- if(provider == null) {
+ protected Command getExtendedCompleteCreateRelationshipCommand(
+ CreateElementRequest request,
+ IExtendedHintedElementType requestElementType) {
+ IElementEditService provider = ElementEditServiceUtils
+ .getCommandProvider(requestElementType);
+ if (provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
@@ -332,11 +370,12 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected Command getMoveCommand(MoveRequest req) {
EObject targetCEObject = req.getTargetContainer();
- if(targetCEObject != null) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(targetCEObject);
- if(provider != null) {
+ if (targetCEObject != null) {
+ IElementEditService provider = ElementEditServiceUtils
+ .getCommandProvider(targetCEObject);
+ if (provider != null) {
ICommand moveCommand = provider.getEditCommand(req);
- if(moveCommand != null) {
+ if (moveCommand != null) {
return new ICommandProxy(moveCommand);
}
}
@@ -349,14 +388,16 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ protected Command getReorientReferenceRelationshipCommand(
+ ReorientReferenceRelationshipRequest req) {
return UnexecutableCommand.INSTANCE;
}
/**
* @generated
*/
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ protected Command getReorientRelationshipCommand(
+ ReorientRelationshipRequest req) {
return UnexecutableCommand.INSTANCE;
}
@@ -373,7 +414,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ return ((IGraphicalEditPart) getHost()).getEditingDomain();
}
/**
@@ -383,9 +424,10 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$
- for(Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
- View nextView = (View)it.next();
- if(nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
+ for (Iterator it = view.getDiagram().getChildren().iterator(); it
+ .hasNext();) {
+ View nextView = (View) it.next();
+ if (nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
continue;
}
cmd.add(new DeleteCommand(getEditingDomain(), nextView));
@@ -396,9 +438,11 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
public static LinkConstraints getLinkConstraints() {
- LinkConstraints cached = UMLDiagramEditorPlugin.getInstance().getLinkConstraints();
- if(cached == null) {
- UMLDiagramEditorPlugin.getInstance().setLinkConstraints(cached = new LinkConstraints());
+ LinkConstraints cached = UMLDiagramEditorPlugin.getInstance()
+ .getLinkConstraints();
+ if (cached == null) {
+ UMLDiagramEditorPlugin.getInstance().setLinkConstraints(
+ cached = new LinkConstraints());
}
return cached;
}
@@ -432,9 +476,10 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- public boolean canCreateCommentAnnotatedElement_4002(Comment source, Element target) {
- if(source != null) {
- if(source.getAnnotatedElements().contains(target)) {
+ public boolean canCreateCommentAnnotatedElement_4002(Comment source,
+ Element target) {
+ if (source != null) {
+ if (source.getAnnotatedElements().contains(target)) {
return false;
}
}
@@ -444,9 +489,10 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- public boolean canCreateConstraintConstrainedElement_4003(Constraint source, Element target) {
- if(source != null) {
- if(source.getConstrainedElements().contains(target)) {
+ public boolean canCreateConstraintConstrainedElement_4003(
+ Constraint source, Element target) {
+ if (source != null) {
+ if (source.getConstrainedElements().contains(target)) {
return false;
}
}
@@ -456,93 +502,108 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- public boolean canCreateComponentRealization_4004(Package container, NamedElement source, NamedElement target) {
- return canExistComponentRealization_4004(container, null, source, target);
+ public boolean canCreateComponentRealization_4004(Package container,
+ NamedElement source, NamedElement target) {
+ return canExistComponentRealization_4004(container, null, source,
+ target);
}
/**
* @generated
*/
- public boolean canCreateInterfaceRealization_4005(Package container, NamedElement source, NamedElement target) {
- return canExistInterfaceRealization_4005(container, null, source, target);
+ public boolean canCreateInterfaceRealization_4005(Package container,
+ NamedElement source, NamedElement target) {
+ return canExistInterfaceRealization_4005(container, null, source,
+ target);
}
/**
* @generated
*/
- public boolean canCreateSubstitution_4011(Package container, NamedElement source, NamedElement target) {
+ public boolean canCreateSubstitution_4011(Package container,
+ NamedElement source, NamedElement target) {
return canExistSubstitution_4011(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateRealization_4006(Package container, NamedElement source, NamedElement target) {
+ public boolean canCreateRealization_4006(Package container,
+ NamedElement source, NamedElement target) {
return canExistRealization_4006(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateManifestation_4012(Package container, NamedElement source, NamedElement target) {
+ public boolean canCreateManifestation_4012(Package container,
+ NamedElement source, NamedElement target) {
return canExistManifestation_4012(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateAbstraction_4007(Package container, NamedElement source, NamedElement target) {
+ public boolean canCreateAbstraction_4007(Package container,
+ NamedElement source, NamedElement target) {
return canExistAbstraction_4007(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateUsage_4008(Package container, NamedElement source, NamedElement target) {
+ public boolean canCreateUsage_4008(Package container,
+ NamedElement source, NamedElement target) {
return canExistUsage_4008(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateDeployment_4009(Package container, NamedElement source, NamedElement target) {
+ public boolean canCreateDeployment_4009(Package container,
+ NamedElement source, NamedElement target) {
return canExistDeployment_4009(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateDependency_4017(Package container, NamedElement source, NamedElement target) {
+ public boolean canCreateDependency_4017(Package container,
+ NamedElement source, NamedElement target) {
return canExistDependency_4017(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateDependency_4010(Package container, NamedElement source, NamedElement target) {
+ public boolean canCreateDependency_4010(Package container,
+ NamedElement source, NamedElement target) {
return canExistDependency_4010(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateConnector_4013(StructuredClassifier container, ConnectorEnd source, ConnectorEnd target) {
+ public boolean canCreateConnector_4013(StructuredClassifier container,
+ ConnectorEnd source, ConnectorEnd target) {
return canExistConnector_4013(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateGeneralization_4015(Classifier container, Classifier source, Classifier target) {
+ public boolean canCreateGeneralization_4015(Classifier container,
+ Classifier source, Classifier target) {
return canExistGeneralization_4015(container, null, source, target);
}
/**
* @generated
*/
- public boolean canCreateTimeObservationEvent_4018(TimeObservation source, NamedElement target) {
- if(source != null) {
- if(source.getEvent() != null) {
+ public boolean canCreateTimeObservationEvent_4018(
+ TimeObservation source, NamedElement target) {
+ if (source != null) {
+ if (source.getEvent() != null) {
return false;
}
}
@@ -552,9 +613,11 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- public boolean canCreateDurationObservationEvent_4019(DurationObservation source, NamedElement target) {
- if(source != null) {
- if(source.getEvents().size() >= 2 || source.getEvents().contains(target)) {
+ public boolean canCreateDurationObservationEvent_4019(
+ DurationObservation source, NamedElement target) {
+ if (source != null) {
+ if (source.getEvents().size() >= 2
+ || source.getEvents().contains(target)) {
return false;
}
}
@@ -564,9 +627,10 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- public boolean canCreateInformationItemRepresented_4020(InformationItem source, Classifier target) {
- if(source != null) {
- if(source.getRepresenteds().contains(target)) {
+ public boolean canCreateInformationItemRepresented_4020(
+ InformationItem source, Classifier target) {
+ if (source != null) {
+ if (source.getRepresenteds().contains(target)) {
return false;
}
}
@@ -576,7 +640,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- public boolean canCreateInformationFlow_4021(Package container, NamedElement source, NamedElement target) {
+ public boolean canCreateInformationFlow_4021(Package container,
+ NamedElement source, NamedElement target) {
return canExistInformationFlow_4021(container, null, source, target);
}
@@ -597,97 +662,119 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- public boolean canExistCommentAnnotatedElement_4002(Comment source, Element target) {
+ public boolean canExistCommentAnnotatedElement_4002(Comment source,
+ Element target) {
return true;
}
/**
* @generated
*/
- public boolean canExistConstraintConstrainedElement_4003(Constraint source, Element target) {
+ public boolean canExistConstraintConstrainedElement_4003(
+ Constraint source, Element target) {
return true;
}
/**
* @generated
*/
- public boolean canExistComponentRealization_4004(Package container, ComponentRealization linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistComponentRealization_4004(Package container,
+ ComponentRealization linkInstance, NamedElement source,
+ NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistInterfaceRealization_4005(Package container, InterfaceRealization linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistInterfaceRealization_4005(Package container,
+ InterfaceRealization linkInstance, NamedElement source,
+ NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistSubstitution_4011(Package container, Substitution linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistSubstitution_4011(Package container,
+ Substitution linkInstance, NamedElement source,
+ NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistRealization_4006(Package container, Realization linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistRealization_4006(Package container,
+ Realization linkInstance, NamedElement source,
+ NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistManifestation_4012(Package container, Manifestation linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistManifestation_4012(Package container,
+ Manifestation linkInstance, NamedElement source,
+ NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistAbstraction_4007(Package container, Abstraction linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistAbstraction_4007(Package container,
+ Abstraction linkInstance, NamedElement source,
+ NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistUsage_4008(Package container, Usage linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistUsage_4008(Package container,
+ Usage linkInstance, NamedElement source, NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistDeployment_4009(Package container, Deployment linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistDeployment_4009(Package container,
+ Deployment linkInstance, NamedElement source,
+ NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistDependency_4017(Package container, Dependency linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistDependency_4017(Package container,
+ Dependency linkInstance, NamedElement source,
+ NamedElement target) {
try {
// RoleBinding source constraint
- if((source != null) && !(source instanceof CollaborationUse)) {
+ if ((source != null) && !(source instanceof CollaborationUse)) {
return false;
}
// RoleBinding source has a type
- if((source != null) && (((CollaborationUse)source).getType() == null)) {
+ if ((source != null)
+ && (((CollaborationUse) source).getType() == null)) {
return false;
}
// RoleBinding target constraint
- if((target != null) && !(target instanceof ConnectableElement)) {
+ if ((target != null) && !(target instanceof ConnectableElement)) {
return false;
}
// RoleBinding source and target have the same semantic parent
- if((source != null) && (target != null) && (source.getOwner() != target.getOwner())) {
+ if ((source != null) && (target != null)
+ && (source.getOwner() != target.getOwner())) {
return false;
}
return true;
} catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Link constraint evaluation error", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Link constraint evaluation error", e); //$NON-NLS-1$
return false;
}
}
@@ -695,52 +782,64 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- public boolean canExistDependency_4010(Package container, Dependency linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistDependency_4010(Package container,
+ Dependency linkInstance, NamedElement source,
+ NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistConnector_4013(StructuredClassifier container, Connector linkInstance, ConnectorEnd source, ConnectorEnd target) {
+ public boolean canExistConnector_4013(StructuredClassifier container,
+ Connector linkInstance, ConnectorEnd source, ConnectorEnd target) {
return true;
}
/**
* @generated
*/
- public boolean canExistGeneralization_4015(Classifier container, Generalization linkInstance, Classifier source, Classifier target) {
+ public boolean canExistGeneralization_4015(Classifier container,
+ Generalization linkInstance, Classifier source,
+ Classifier target) {
return true;
}
/**
* @generated
*/
- public boolean canExistTimeObservationEvent_4018(TimeObservation source, NamedElement target) {
+ public boolean canExistTimeObservationEvent_4018(
+ TimeObservation source, NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistDurationObservationEvent_4019(DurationObservation source, NamedElement target) {
+ public boolean canExistDurationObservationEvent_4019(
+ DurationObservation source, NamedElement target) {
return true;
}
/**
* @generated
*/
- public boolean canExistInformationItemRepresented_4020(InformationItem source, Classifier target) {
+ public boolean canExistInformationItemRepresented_4020(
+ InformationItem source, Classifier target) {
try {
// Represented InformationItem Target
- if(target != null) {
- if(!((target instanceof Class) || (target instanceof Interface) || (target instanceof InformationItem) || (target instanceof Signal) || (target instanceof Component))) {
+ if (target != null) {
+ if (!((target instanceof Class)
+ || (target instanceof Interface)
+ || (target instanceof InformationItem)
+ || (target instanceof Signal) || (target instanceof Component))) {
return false;
}
}
return true;
} catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Link constraint evaluation error", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Link constraint evaluation error", e); //$NON-NLS-1$
return false;
}
}
@@ -748,31 +847,55 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* @generated
*/
- public boolean canExistInformationFlow_4021(Package container, InformationFlow linkInstance, NamedElement source, NamedElement target) {
+ public boolean canExistInformationFlow_4021(Package container,
+ InformationFlow linkInstance, NamedElement source,
+ NamedElement target) {
try {
- //Information Flow source constraint
- if(source != null) {
- if(!((source instanceof Actor) || (source instanceof Node) || (source instanceof UseCase) || (source instanceof Artifact) || (source instanceof Class) || (source instanceof Component) || (source instanceof Port) || (source instanceof Property) || (source instanceof Interface) || (source instanceof Package) || (source instanceof ActivityNode) || (source instanceof ActivityPartition) || (source instanceof InstanceSpecification))) {
+ // Information Flow source constraint
+ if (source != null) {
+ if (!((source instanceof Actor) || (source instanceof Node)
+ || (source instanceof UseCase)
+ || (source instanceof Artifact)
+ || (source instanceof Class)
+ || (source instanceof Component)
+ || (source instanceof Port)
+ || (source instanceof Property)
+ || (source instanceof Interface)
+ || (source instanceof Package)
+ || (source instanceof ActivityNode)
+ || (source instanceof ActivityPartition) || (source instanceof InstanceSpecification))) {
return false;
}
- if(source instanceof InstanceSpecification) {
- EList<Classifier> classes = ((InstanceSpecification)source).getClassifiers();
- for(int i = 0; i < classes.size(); i++) {
- if(classes.get(i) instanceof Relationship) {
+ if (source instanceof InstanceSpecification) {
+ EList<Classifier> classes = ((InstanceSpecification) source)
+ .getClassifiers();
+ for (int i = 0; i < classes.size(); i++) {
+ if (classes.get(i) instanceof Relationship) {
return false;
}
}
}
}
- //Information Flow target constraint
- if(target != null) {
- if(!((target instanceof Actor) || (target instanceof Node) || (target instanceof UseCase) || (target instanceof Artifact) || (target instanceof Class) || (target instanceof Component) || (target instanceof Port) || (target instanceof Property) || (target instanceof Interface) || (target instanceof Package) || (target instanceof ActivityNode) || (target instanceof ActivityPartition) || (target instanceof InstanceSpecification))) {
+ // Information Flow target constraint
+ if (target != null) {
+ if (!((target instanceof Actor) || (target instanceof Node)
+ || (target instanceof UseCase)
+ || (target instanceof Artifact)
+ || (target instanceof Class)
+ || (target instanceof Component)
+ || (target instanceof Port)
+ || (target instanceof Property)
+ || (target instanceof Interface)
+ || (target instanceof Package)
+ || (target instanceof ActivityNode)
+ || (target instanceof ActivityPartition) || (target instanceof InstanceSpecification))) {
return false;
}
- if(target instanceof InstanceSpecification) {
- EList<Classifier> classes = ((InstanceSpecification)target).getClassifiers();
- for(int i = 0; i < classes.size(); i++) {
- if(classes.get(i) instanceof Relationship) {
+ if (target instanceof InstanceSpecification) {
+ EList<Classifier> classes = ((InstanceSpecification) target)
+ .getClassifiers();
+ for (int i = 0; i < classes.size(); i++) {
+ if (classes.get(i) instanceof Relationship) {
return false;
}
}
@@ -780,7 +903,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
}
return true;
} catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Link constraint evaluation error", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Link constraint evaluation error", e); //$NON-NLS-1$
return false;
}
}

Back to the top