Search in sources :

Example 81 with CompoundCommand

use of org.eclipse.gef.commands.CompoundCommand in project jbosstools-hibernate by jbosstools.

the class ConnectionRouterFanAction method getCommand.

public Command getCommand() {
    CompoundCommand cc = new CompoundCommand();
    boolean checked = editor.isFanConnectionRouter();
    if (!checked) {
        cc.add(new ToggleConnectionRouterFanCommand(getDiagramViewer()));
    }
    return cc;
}
Also used : ToggleConnectionRouterFanCommand(org.jboss.tools.hibernate.ui.diagram.editors.command.ToggleConnectionRouterFanCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Example 82 with CompoundCommand

use of org.eclipse.gef.commands.CompoundCommand in project jbosstools-hibernate by jbosstools.

the class ShapeExpandAction method getCommand.

public Command getCommand() {
    CompoundCommand cc = new CompoundCommand();
    if (getSelectedObjects().isEmpty()) {
        return cc;
    }
    List<ExpandableShape> selectedShape = new ArrayList<ExpandableShape>();
    Iterator<?> it = getSelectedObjects().iterator();
    while (it.hasNext()) {
        Object firstElement = it.next();
        Object obj = null;
        if (firstElement instanceof OrmEditPart) {
            obj = ((OrmEditPart) firstElement).getModel();
        } else if (firstElement instanceof AbstractTreeEditPart) {
            obj = ((AbstractTreeEditPart) firstElement).getModel();
        }
        if (null != obj && obj instanceof ExpandableShape) {
            ExpandableShape es = (ExpandableShape) obj;
            if (!es.isExpanded()) {
                selectedShape.add(es);
            }
        }
    }
    if (selectedShape.size() > 0) {
        cc.add(new ToggleShapeExpandStateCommand(selectedShape, null));
    }
    return cc;
}
Also used : ExpandableShape(org.jboss.tools.hibernate.ui.diagram.editors.model.ExpandableShape) AbstractTreeEditPart(org.eclipse.gef.editparts.AbstractTreeEditPart) OrmEditPart(org.jboss.tools.hibernate.ui.diagram.editors.parts.OrmEditPart) ArrayList(java.util.ArrayList) ToggleShapeExpandStateCommand(org.jboss.tools.hibernate.ui.diagram.editors.command.ToggleShapeExpandStateCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Example 83 with CompoundCommand

use of org.eclipse.gef.commands.CompoundCommand in project jbosstools-hibernate by jbosstools.

the class ShapeShowAction method getCommand.

public Command getCommand() {
    CompoundCommand cc = new CompoundCommand();
    if (getSelectedObjects().isEmpty()) {
        return cc;
    }
    List<OrmShape> selectedShape = new ArrayList<OrmShape>();
    Iterator<?> it = getSelectedObjects().iterator();
    while (it.hasNext()) {
        Object firstElement = it.next();
        Object obj = null;
        if (firstElement instanceof OrmEditPart) {
            obj = ((OrmEditPart) firstElement).getModel();
        } else if (firstElement instanceof AbstractTreeEditPart) {
            obj = ((AbstractTreeEditPart) firstElement).getModel();
        }
        if (null != obj && obj instanceof OrmShape) {
            OrmShape ormShape = (OrmShape) obj;
            if (!ormShape.isVisible()) {
                selectedShape.add(ormShape);
            }
        }
    }
    if (selectedShape.size() > 0) {
        cc.add(new ToggleShapeVisibleStateCommand(selectedShape, null));
    }
    return cc;
}
Also used : OrmShape(org.jboss.tools.hibernate.ui.diagram.editors.model.OrmShape) AbstractTreeEditPart(org.eclipse.gef.editparts.AbstractTreeEditPart) OrmEditPart(org.jboss.tools.hibernate.ui.diagram.editors.parts.OrmEditPart) ArrayList(java.util.ArrayList) ToggleShapeVisibleStateCommand(org.jboss.tools.hibernate.ui.diagram.editors.command.ToggleShapeVisibleStateCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Example 84 with CompoundCommand

use of org.eclipse.gef.commands.CompoundCommand in project jbosstools-hibernate by jbosstools.

the class ToggleAssociationAction method getCommand.

public Command getCommand() {
    CompoundCommand cc = new CompoundCommand();
    cc.add(new ToggleAssociationCommand(getDiagramViewer()));
    return cc;
}
Also used : ToggleAssociationCommand(org.jboss.tools.hibernate.ui.diagram.editors.command.ToggleAssociationCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Example 85 with CompoundCommand

use of org.eclipse.gef.commands.CompoundCommand in project jbosstools-hibernate by jbosstools.

the class ToggleClassMappingAction method getCommand.

public Command getCommand() {
    CompoundCommand cc = new CompoundCommand();
    cc.add(new ToggleClassMappingCommand(getDiagramViewer()));
    return cc;
}
Also used : ToggleClassMappingCommand(org.jboss.tools.hibernate.ui.diagram.editors.command.ToggleClassMappingCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Aggregations

CompoundCommand (org.eclipse.gef.commands.CompoundCommand)193 Command (org.eclipse.gef.commands.Command)86 EObject (org.eclipse.emf.ecore.EObject)40 ArrayList (java.util.ArrayList)28 EditPart (org.eclipse.gef.EditPart)28 List (java.util.List)24 EObjectFeatureCommand (com.archimatetool.editor.model.commands.EObjectFeatureCommand)23 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)22 SelectionEvent (org.eclipse.swt.events.SelectionEvent)22 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)18 Point (org.eclipse.draw2d.geometry.Point)16 IElementParameter (org.talend.core.model.process.IElementParameter)16 Combo (org.eclipse.swt.widgets.Combo)15 PropertyChangeCommand (org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand)15 Node (org.talend.designer.core.ui.editor.nodes.Node)15 SetWidgetPropertyCommand (org.csstudio.opibuilder.commands.SetWidgetPropertyCommand)14 Rectangle (org.eclipse.draw2d.geometry.Rectangle)14 ChangeBoundsRequest (org.eclipse.gef.requests.ChangeBoundsRequest)14 INode (org.talend.core.model.process.INode)14 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)14