Search in sources :

Example 1 with AddCommand

use of org.eclipse.gmf.runtime.diagram.core.commands.AddCommand in project statecharts by Yakindu.

the class CompartmentLayoutEditPolicy method createAddCommand.

@Override
protected Command createAddCommand(EditPart child, EditPart after) {
    int index = getHost().getChildren().indexOf(after);
    TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
    AddCommand command = new CompartmentAddCommand(editingDomain, new EObjectAdapter((View) getHost().getModel()), new EObjectAdapter((View) child.getModel()), index);
    return new ICommandProxy(command);
}
Also used : IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) ICommandProxy(org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy) TransactionalEditingDomain(org.eclipse.emf.transaction.TransactionalEditingDomain) EObjectAdapter(org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter) View(org.eclipse.gmf.runtime.notation.View) AddCommand(org.eclipse.gmf.runtime.diagram.core.commands.AddCommand)

Aggregations

TransactionalEditingDomain (org.eclipse.emf.transaction.TransactionalEditingDomain)1 AddCommand (org.eclipse.gmf.runtime.diagram.core.commands.AddCommand)1 ICommandProxy (org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy)1 IGraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)1 EObjectAdapter (org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter)1 View (org.eclipse.gmf.runtime.notation.View)1