Search in sources :

Example 1 with DiagramEditDomain

use of org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain 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)

Example 2 with DiagramEditDomain

use of org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain in project statecharts by Yakindu.

the class RegionPriorityDecorationProvider 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 RegionEditPart) {
            IDecorator decorator = createStatusDecorator(decoratorTarget);
            decorators.add(decorator);
            decoratorTarget.installDecorator(getDecoratorKey(), decorator);
        }
    }
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) DiagramEditDomain(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain) EditDomain(org.eclipse.gef.EditDomain) RegionEditPart(org.yakindu.sct.ui.editor.editparts.RegionEditPart) 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) RegionEditPart(org.yakindu.sct.ui.editor.editparts.RegionEditPart) 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)2 EditPart (org.eclipse.gef.EditPart)2 AbstractConnectionEditPart (org.eclipse.gef.editparts.AbstractConnectionEditPart)2 GraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart)2 IGraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)2 DiagramEditDomain (org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain)2 IDecorator (org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator)2 RegionEditPart (org.yakindu.sct.ui.editor.editparts.RegionEditPart)1 TransitionEditPart (org.yakindu.sct.ui.editor.editparts.TransitionEditPart)1