use of org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart 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.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart 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;
}
use of org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart 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;
}
use of org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart 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.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart in project tdi-studio-se by Talend.
the class BusinessDiagramEditor method selectionChanged.
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
super.selectionChanged(part, selection);
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
JobSettingsView view = (JobSettingsView) page.findView(JobSettingsView.ID);
getDiagramEditorInput().getItem().getProperty().eAdapters().remove(dirtyListener);
if (view == null) {
return;
}
if (!(selection instanceof IStructuredSelection)) {
return;
}
Object firstElement = ((IStructuredSelection) selection).getFirstElement();
if (!(selection instanceof IStructuredSelection)) {
return;
} else if (firstElement instanceof RepositoryNode) {
return;
}
// for Find Assignment
if (((IStructuredSelection) selection).size() > 0) {
DiagramEditPart diagramEditPart = getDiagramEditPart();
if (diagramEditPart instanceof BusinessProcessEditPart) {
BusinessProcessEditPart processPart = (BusinessProcessEditPart) diagramEditPart;
for (Object object : processPart.getChildren()) {
if (object instanceof BusinessItemShapeEditPart) {
BusinessItemShapeEditPart shapEditPart = (BusinessItemShapeEditPart) object;
IFigure figure = shapEditPart.getFigure();
for (Object child : figure.getChildren()) {
if (child instanceof BusinessItemShapeFigure) {
BusinessItemShapeFigure shapFigure = (BusinessItemShapeFigure) child;
Border border = shapFigure.getBorder();
if (border != null) {
shapFigure.setDrawFrame(false);
shapFigure.revalidate();
shapFigure.repaint();
}
}
}
}
}
}
}
// to refresh the jobsettings view
if (((IStructuredSelection) selection).size() > 1) {
view.cleanDisplay();
} else {
if (firstElement instanceof BusinessItemShapeEditPart || firstElement instanceof BaseBusinessItemRelationShipEditPart || firstElement instanceof NoteEditPart || firstElement instanceof NoteAttachmentEditPart) {
view.refresh(false, firstElement);
} else if (firstElement instanceof BusinessProcessEditPart || firstElement instanceof CompartmentEditPart) {
view.refresh(true, this);
}
}
getDiagramEditorInput().getItem().getProperty().eAdapters().add(dirtyListener);
}
Aggregations