use of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart in project tdi-studio-se by Talend.
the class BusinessEditPartProvider method provides.
/**
* @generated
*/
public synchronized boolean provides(IOperation operation) {
if (operation instanceof CreateGraphicEditPartOperation) {
View view = ((IEditPartOperation) operation).getView();
if (!BusinessProcessEditPart.MODEL_ID.equals(BusinessVisualIDRegistry.getModelID(view))) {
return false;
}
if (isAllowCaching() && getCachedPart(view) != null) {
return true;
}
IGraphicalEditPart part = createEditPart(view);
if (part != null) {
if (isAllowCaching()) {
cachedPart = new WeakReference(part);
cachedView = new WeakReference(view);
}
return true;
}
}
return false;
}
use of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart in project tdi-studio-se by Talend.
the class BusinessEditPartProvider method createGraphicEditPart.
/**
* @generated
*/
public synchronized IGraphicalEditPart createGraphicEditPart(View view) {
if (isAllowCaching()) {
IGraphicalEditPart part = getCachedPart(view);
cachedPart = null;
cachedView = null;
if (part != null) {
return part;
}
}
return createEditPart(view);
}
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;
}
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;
}
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;
}
Aggregations