Search in sources :

Example 6 with IGraphicalEditPart

use of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart in project tdi-studio-se by Talend.

the class BusinessModelingAssistantProvider method getRelTypesOnSourceAndTarget.

public List getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
    IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
    IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
    if (sourceEditPart instanceof BusinessItemShapeEditPart && targetEditPart 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;
}
Also used : IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) BusinessItemShapeEditPart(org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 7 with IGraphicalEditPart

use of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart in project tdi-studio-se by Talend.

the class BusinessModelingAssistantProvider method getTypesForSource.

public List getTypesForSource(IAdaptable target, IElementType relationshipType) {
    IGraphicalEditPart editPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
    if (editPart instanceof BusinessItemShapeEditPart && relationshipType.getEClass() != null && relationshipType.getEClass().getEAllSuperTypes().contains(org.talend.designer.business.model.business.BusinessPackage.eINSTANCE.getBaseBusinessItemRelationship())) {
        List types = new ArrayList();
        types.add(BusinessElementTypes.ActionBusinessItem_1001);
        types.add(BusinessElementTypes.TerminalBusinessItem_1002);
        types.add(BusinessElementTypes.DocumentBusinessItem_1003);
        types.add(BusinessElementTypes.DatabaseBusinessItem_1004);
        types.add(BusinessElementTypes.ListBusinessItem_1005);
        types.add(BusinessElementTypes.DataBusinessItem_1006);
        types.add(BusinessElementTypes.InputBusinessItem_1007);
        types.add(BusinessElementTypes.DecisionBusinessItem_1008);
        types.add(BusinessElementTypes.ActorBusinessItem_1009);
        types.add(BusinessElementTypes.EllipseBusinessItem_1010);
        types.add(BusinessElementTypes.GearBusinessItem_1011);
        return types;
    }
    return Collections.EMPTY_LIST;
}
Also used : IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) BusinessItemShapeEditPart(org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 8 with IGraphicalEditPart

use of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart in project tdi-studio-se by Talend.

the class BusinessModelingAssistantProvider method getTypesForPopupBar.

/**
     * @generated
     */
public List getTypesForPopupBar(IAdaptable host) {
    IGraphicalEditPart editPart = (IGraphicalEditPart) host.getAdapter(IGraphicalEditPart.class);
    if (editPart instanceof BusinessProcessEditPart) {
        List types = new ArrayList();
        types.add(BusinessElementTypes.ActionBusinessItem_1001);
        types.add(BusinessElementTypes.TerminalBusinessItem_1002);
        types.add(BusinessElementTypes.DocumentBusinessItem_1003);
        types.add(BusinessElementTypes.DatabaseBusinessItem_1004);
        types.add(BusinessElementTypes.ListBusinessItem_1005);
        types.add(BusinessElementTypes.DataBusinessItem_1006);
        types.add(BusinessElementTypes.InputBusinessItem_1007);
        types.add(BusinessElementTypes.DecisionBusinessItem_1008);
        types.add(BusinessElementTypes.ActorBusinessItem_1009);
        types.add(BusinessElementTypes.EllipseBusinessItem_1010);
        types.add(BusinessElementTypes.GearBusinessItem_1011);
        return types;
    }
    return Collections.EMPTY_LIST;
}
Also used : IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) BusinessProcessEditPart(org.talend.designer.business.model.business.diagram.edit.parts.BusinessProcessEditPart) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 9 with IGraphicalEditPart

use of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart in project tdi-studio-se by Talend.

the class BusinessModelingAssistantProvider method getTypesForTarget.

public List getTypesForTarget(IAdaptable source, IElementType relationshipType) {
    IGraphicalEditPart editPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
    if (editPart instanceof BusinessItemShapeEditPart && relationshipType.getEClass() != null && relationshipType.getEClass().getEAllSuperTypes().contains(org.talend.designer.business.model.business.BusinessPackage.eINSTANCE.getBaseBusinessItemRelationship())) {
        List types = new ArrayList();
        types.add(BusinessElementTypes.ActionBusinessItem_1001);
        types.add(BusinessElementTypes.TerminalBusinessItem_1002);
        types.add(BusinessElementTypes.DocumentBusinessItem_1003);
        types.add(BusinessElementTypes.DatabaseBusinessItem_1004);
        types.add(BusinessElementTypes.ListBusinessItem_1005);
        types.add(BusinessElementTypes.DataBusinessItem_1006);
        types.add(BusinessElementTypes.InputBusinessItem_1007);
        types.add(BusinessElementTypes.DecisionBusinessItem_1008);
        types.add(BusinessElementTypes.ActorBusinessItem_1009);
        types.add(BusinessElementTypes.EllipseBusinessItem_1010);
        types.add(BusinessElementTypes.GearBusinessItem_1011);
        return types;
    }
    return Collections.EMPTY_LIST;
}
Also used : IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) BusinessItemShapeEditPart(org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 10 with IGraphicalEditPart

use of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart in project tdi-studio-se by Talend.

the class BusinessModelingAssistantProvider method getRelTypesOnTarget.

public List getRelTypesOnTarget(IAdaptable target) {
    IGraphicalEditPart editPart = (IGraphicalEditPart) target.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;
}
Also used : IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) BusinessItemShapeEditPart(org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

IGraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)13 List (java.util.List)7 ArrayList (java.util.ArrayList)6 BusinessItemShapeEditPart (org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart)5 TransactionalEditingDomain (org.eclipse.emf.transaction.TransactionalEditingDomain)3 Command (org.eclipse.gef.commands.Command)3 Iterator (java.util.Iterator)2 EObject (org.eclipse.emf.ecore.EObject)2 UnexecutableCommand (org.eclipse.gef.commands.UnexecutableCommand)2 DeleteCommand (org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand)2 ICommandProxy (org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy)2 View (org.eclipse.gmf.runtime.notation.View)2 BusinessProcessEditPart (org.talend.designer.business.model.business.diagram.edit.parts.BusinessProcessEditPart)2 WeakReference (java.lang.ref.WeakReference)1 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 IAdaptable (org.eclipse.core.runtime.IAdaptable)1 EditPart (org.eclipse.gef.EditPart)1 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)1