use of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart in project tdi-studio-se by Talend.
the class BusinessModelingAssistantProvider method selectExistingElement.
/**
* @generated
*/
protected EObject selectExistingElement(IAdaptable host, Collection types) {
if (types.isEmpty()) {
return null;
}
IGraphicalEditPart editPart = (IGraphicalEditPart) host.getAdapter(IGraphicalEditPart.class);
if (editPart == null) {
return null;
}
Diagram diagram = (Diagram) editPart.getRoot().getContents().getModel();
Collection elements = new HashSet();
for (Iterator it = diagram.getElement().eAllContents(); it.hasNext(); ) {
EObject element = (EObject) it.next();
if (isApplicableElement(element, types)) {
elements.add(element);
}
}
if (elements.isEmpty()) {
return null;
}
return selectElement((EObject[]) elements.toArray(new EObject[elements.size()]));
}
use of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart in project tdi-studio-se by Talend.
the class BusinessModelingAssistantProvider method getRelTypesOnSource.
public List getRelTypesOnSource(IAdaptable source) {
IGraphicalEditPart editPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
if (editPart instanceof BusinessItemShapeEditPart) {
List types = new ArrayList();
types.add(BusinessElementTypes.BusinessItemRelationship_3001);
types.add(BusinessElementTypes.DirectionalBusinessItemRelationship_3002);
types.add(BusinessElementTypes.BidirectionalBusinessItemRelationship_3003);
return types;
}
return Collections.EMPTY_LIST;
}
use of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart in project tdi-studio-se by Talend.
the class BusinessGraphicalNodeEditPolicy method getConnectionWithReorientedViewCompleteCommand.
/**
* @generated
*/
protected Command getConnectionWithReorientedViewCompleteCommand(CreateConnectionRequest request) {
ICommandProxy c = (ICommandProxy) super.getConnectionCompleteCommand(request);
CompositeCommand cc = (CompositeCommand) c.getICommand();
TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
BusinessReorientConnectionViewCommand rcvCommand = new BusinessReorientConnectionViewCommand(editingDomain, null);
rcvCommand.setEdgeAdaptor(getViewAdapter());
cc.compose(rcvCommand);
return c;
}
Aggregations