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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations