org.eclipse.gmf.runtime.common.core.command.ICommand Java Examples
The following examples show how to use
org.eclipse.gmf.runtime.common.core.command.ICommand.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CompartmentEditPolicy.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
protected Command createChangeConstraintCommand( EditPart child, Object constraint) { org.eclipse.draw2d.geometry.Rectangle newBounds = (org.eclipse.draw2d.geometry.Rectangle) constraint; View shapeView = (View) child.getModel(); TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()) .getEditingDomain(); ICommand boundsCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(shapeView), newBounds); return new ICommandProxy(boundsCommand); }
Example #2
Source File: EntryEditHelper.java From statecharts with Eclipse Public License 1.0 | 6 votes |
/** * Set the right {@link EntryKind} for the given {@link ElementType} */ @Override protected ICommand getConfigureCommand(ConfigureRequest req) { if (StatechartElementTypes.SHALLOWHISTORY.equals(req .getTypeToConfigure())) { return new SetValueCommand(new SetRequest( req.getElementToConfigure(), SGraphPackage.eINSTANCE.getEntry_Kind(), EntryKind.SHALLOW_HISTORY)); } else if (StatechartElementTypes.DEEPHISTORY.equals(req .getTypeToConfigure())) { return new SetValueCommand(new SetRequest( req.getElementToConfigure(), SGraphPackage.eINSTANCE.getEntry_Kind(), EntryKind.DEEP_HISTORY)); } else if (StatechartElementTypes.ENTRY .equals(req.getTypeToConfigure())) { return new SetValueCommand(new SetRequest( req.getElementToConfigure(), SGraphPackage.eINSTANCE.getEntry_Kind(), EntryKind.INITIAL)); } return super.getConfigureCommand(req); }
Example #3
Source File: VertexEditHelper.java From statecharts with Eclipse Public License 1.0 | 6 votes |
@Override protected ICommand getDestroyDependentsCommand(DestroyDependentsRequest req) { Vertex elementToDestroy = (Vertex) req.getElementToDestroy(); EList<Transition> incomingTransitions = elementToDestroy .getIncomingTransitions(); if (incomingTransitions.size() != 0) { CompositeCommand compoundCommand = new CompositeCommand( "Delete vertex"); for (Transition transition : incomingTransitions) { DestroyElementCommand destroyCommand = new DestroyElementCommand( new DestroyElementRequest(transition, false)); compoundCommand.add(destroyCommand); } return compoundCommand; } return super.getDestroyDependentsCommand(req); }
Example #4
Source File: RegionEditHelper.java From statecharts with Eclipse Public License 1.0 | 6 votes |
@Override protected ICommand getBasicDestroyElementCommand(final DestroyElementRequest req) { // Deletion is only allowed if subdiagrams are not opened in another // editor return new DestroyElementCommand(req) { @Override protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (getElementToDestroy() instanceof State && getElementToDestroy().eResource() != null) { boolean success = DiagramPartitioningUtil.closeSubdiagramEditors((State) getElementToDestroy()); if (success) return super.doExecute(monitor, info); else return Status.CANCEL_STATUS; } return super.doExecute(monitor, info); } }; }
Example #5
Source File: InclusiveGateway2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(InclusiveGateway newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #6
Source File: IntermediateCatchSignalEvent2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(IntermediateCatchSignalEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #7
Source File: EndErrorEvent2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(EndErrorEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #8
Source File: IntermediateErrorCatchEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(IntermediateErrorCatchEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #9
Source File: ReceiveTask2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(ReceiveTask newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #10
Source File: ThrowLinkEvent2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(ThrowLinkEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #11
Source File: SendTask2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(SendTask newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #12
Source File: ActivityCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(Activity newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #13
Source File: SubProcessEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(SubProcessEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #14
Source File: StartSignalEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(StartSignalEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #15
Source File: ThrowLinkEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(ThrowLinkEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #16
Source File: IntermediateCatchSignalEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(IntermediateCatchSignalEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #17
Source File: IntermediateErrorCatchEvent2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(IntermediateErrorCatchEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #18
Source File: CatchLinkEvent2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(CatchLinkEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #19
Source File: StartEvent2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(StartEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #20
Source File: StartSignalEvent2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(StartSignalEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #21
Source File: TextAnnotation2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(TextAnnotation newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #22
Source File: IntermediateCatchMessageEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(IntermediateCatchMessageEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #23
Source File: ScriptTask2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(ScriptTask newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #24
Source File: SequenceFlowCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(SequenceFlow newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource()); configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #25
Source File: ANDGateway2CreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(ANDGateway newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #26
Source File: IntermediateCatchTimerEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(IntermediateCatchTimerEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #27
Source File: StartEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(StartEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #28
Source File: StartErrorEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(StartErrorEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #29
Source File: StartMessageEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(StartMessageEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }
Example #30
Source File: NonInterruptingBoundaryTimerEventCreateCommand.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void doConfigure(NonInterruptingBoundaryTimerEvent newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } }