Search in sources :

Example 1 with TransitionEditPart

use of org.yakindu.sct.ui.editor.editparts.TransitionEditPart in project statecharts by Yakindu.

the class TransitionPriorityDecorationProvider method createDecorators.

@Override
public void createDecorators(IDecoratorTarget decoratorTarget) {
    EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
    if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
        EditDomain ed = editPart.getViewer().getEditDomain();
        if (!(ed instanceof DiagramEditDomain)) {
            return;
        }
        if (shouldInstall(((DiagramEditDomain) ed).getEditorPart()) && editPart instanceof TransitionEditPart) {
            IDecorator decorator = createStatusDecorator(decoratorTarget);
            decorators.add(decorator);
            decoratorTarget.installDecorator(getDecoratorKey(), decorator);
        }
    }
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) TransitionEditPart(org.yakindu.sct.ui.editor.editparts.TransitionEditPart) DiagramEditDomain(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain) EditDomain(org.eclipse.gef.EditDomain) TransitionEditPart(org.yakindu.sct.ui.editor.editparts.TransitionEditPart) GraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart) EditPart(org.eclipse.gef.EditPart) AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) DiagramEditDomain(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain) GraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart) IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) IDecorator(org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator)

Aggregations

EditDomain (org.eclipse.gef.EditDomain)1 EditPart (org.eclipse.gef.EditPart)1 AbstractConnectionEditPart (org.eclipse.gef.editparts.AbstractConnectionEditPart)1 GraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart)1 IGraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)1 DiagramEditDomain (org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain)1 IDecorator (org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator)1 TransitionEditPart (org.yakindu.sct.ui.editor.editparts.TransitionEditPart)1