org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget Java Examples

The following examples show how to use org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProcessValidationDecoratorProvider.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
/**
* @generated
*/
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof ProcessDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
		}
	}
}
 
Example #2
Source File: CrossflowValidationDecoratorProvider.java    From scava with Eclipse Public License 2.0 6 votes vote down vote up
/**
* @generated
*/
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof CrossflowDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
		}
	}
}
 
Example #3
Source File: ActivityDecoratorProvider.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
public void createDecorators(IDecoratorTarget decoratorTarget) {
    GraphicalEditPart node = getDecoratorTargetNode(decoratorTarget);
    if (node != null) {
        decoratorTarget.installDecorator(CONNECTOR,new ConnectorDecorator(decoratorTarget,this));
        decoratorTarget.installDecorator(HUMAN_TASK, new HumanTaskDecorator(decoratorTarget,this));
        decoratorTarget.installDecorator(SUBPROCESS_DECORATOR, new SubProcessDecorator(decoratorTarget,this));
        decoratorTarget.installDecorator(MULTIINSTANCE_DECORATOR, new MultiInstanceParalellDecorator(decoratorTarget, this));
        decoratorTarget.installDecorator(MULTIINSTANCE_DECORATOR_SEQUENTIAL, new MultiInstanceSequentialDecorator(decoratorTarget, this));
        decoratorTarget.installDecorator(MULTIINSTANCE_SEQUENTIAL_SUBPROCESS_DECORATOR, new MultiInstanceSequentialSubProcessDecorator(decoratorTarget, this));
        decoratorTarget.installDecorator(MULTIINSTANCE_SUBPROCESS_DECORATOR, new MultiInstanceParalellSubprocessDecorator(decoratorTarget, this));
        decoratorTarget.installDecorator(LOOP_DECORATOR, new LoopTaskDecorator(decoratorTarget, this));
        decoratorTarget.installDecorator(LOOP_SUBPROCESS_DECORATOR, new LoopSubprocessTaskDecorator(decoratorTarget, this));
        decoratorTarget.installDecorator(RECEIVETASK_DECORATOR, new ReceiveTaskDecorator(decoratorTarget,this));
        decoratorTarget.installDecorator(SENDTASK_DECORATOR, new SendTaskDecorator(decoratorTarget,this));
        decoratorTarget.installDecorator(SERVICETASK_DECORATOR,  new ServiceTaskDecorator(decoratorTarget,this));
        decoratorTarget.installDecorator(SCRIPTTASK_DECORATOR, new ScriptTaskDecorator(decoratorTarget,this));
        decoratorTarget.installDecorator(SUBPROCEVENT_TIMER_DECORATOR, new TimerSubProcessEventDecorator(decoratorTarget));
        decoratorTarget.installDecorator(SUBPROCEVENT_MESSAGE_DECORATOR,new MessageSubProcessEventDecorator(decoratorTarget));
        decoratorTarget.installDecorator(SUBPROCEVENT_SIGNAL_DECORATOR, new SignalSubProcessEventDecorator(decoratorTarget));
        decoratorTarget.installDecorator(SUBPROCEVENT_ERROR_DECORATOR, new ErrorSubProcessEventStartDecorator(decoratorTarget));

    }
}
 
Example #4
Source File: ProcessValidationDecoratorProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public StatusDecorator(IDecoratorTarget decoratorTarget) {
	super(decoratorTarget);
	try {
		final View view = (View) getDecoratorTarget().getAdapter(View.class);
		TransactionUtil.getEditingDomain(view).runExclusive(new Runnable() {

			public void run() {
				StatusDecorator.this.viewId = view != null ? ViewUtil.getIdStr(view) : null;
			}
		});
	} catch (Exception e) {
		ProcessDiagramEditorPlugin.getInstance().logError("ViewID access failure", e); //$NON-NLS-1$			
	}
}
 
Example #5
Source File: CrossflowShortcutsDecoratorProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
public void refresh() {
	removeDecoration();
	EditPart editPart = (EditPart) getDecoratorTarget().getAdapter(EditPart.class);
	Image image = CrossflowDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"); //$NON-NLS-1$
	if (editPart instanceof ShapeEditPart) {
		setDecoration(getDecoratorTarget().addShapeDecoration(image, IDecoratorTarget.Direction.SOUTH_WEST, 0,
				false));
	} else if (editPart instanceof ConnectionEditPart) {
		setDecoration(getDecoratorTarget().addConnectionDecoration(image, 50, false));
	}
}
 
Example #6
Source File: CrossflowValidationDecoratorProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
public StatusDecorator(IDecoratorTarget decoratorTarget) {
	super(decoratorTarget);
	try {
		final View view = (View) getDecoratorTarget().getAdapter(View.class);
		TransactionUtil.getEditingDomain(view).runExclusive(new Runnable() {

			public void run() {
				StatusDecorator.this.viewId = view != null ? ViewUtil.getIdStr(view) : null;
			}
		});
	} catch (Exception e) {
		CrossflowDiagramEditorPlugin.getInstance().logError("ViewID access failure", e); //$NON-NLS-1$			
	}
}
 
Example #7
Source File: CrossflowValidationDecoratorProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
public boolean provides(IOperation operation) {
	if (!(operation instanceof CreateDecoratorsOperation)) {
		return false;
	}
	IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget();
	View view = (View) decoratorTarget.getAdapter(View.class);
	return view != null && WorkflowEditPart.MODEL_ID.equals(CrossflowVisualIDRegistry.getModelID(view));
}
 
Example #8
Source File: StatechartValidationDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof BorderItemEditPart)
		return;
	if (editPart instanceof IPrimaryEditPart
			&& (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart)) {
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (shouldInstall(((DiagramEditDomain) ed).getEditorPart())) {
			decoratorTarget.installDecorator(getDecoratorKey(), createStatusDecorator(decoratorTarget, issueStore));
		}
	}
}
 
Example #9
Source File: CrossflowShortcutsDecoratorProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
public boolean provides(IOperation operation) {
	if (!(operation instanceof CreateDecoratorsOperation)) {
		return false;
	}
	IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget();
	View view = (View) decoratorTarget.getAdapter(View.class);
	return view != null && WorkflowEditPart.MODEL_ID.equals(CrossflowVisualIDRegistry.getModelID(view));
}
 
Example #10
Source File: TransitionPriorityDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@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);
		}
	}
}
 
Example #11
Source File: RegionPriorityDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@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);
		}
	}
}
 
Example #12
Source File: AbstractMarkerBasedDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public StatusDecorator(IDecoratorTarget decoratorTarget) {
	super(decoratorTarget);
	try {
		final View view = (View) getDecoratorTarget().getAdapter(View.class);
		TransactionUtil.getEditingDomain(view).runExclusive(new Runnable() {
			public void run() {
				StatusDecorator.this.viewId = view != null ? ViewUtil.getIdStr(view) : null;
			}
		});
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
Example #13
Source File: BaseDecorator.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public BaseDecorator(IDecoratorTarget decoratorTarget) {
	super(decoratorTarget);
	gep = (IGraphicalEditPart) getDecoratorTarget().getAdapter(
			IGraphicalEditPart.class);
	semanticElement = gep.resolveSemanticElement();

}
 
Example #14
Source File: AbstractDecoratorProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public boolean provides(IOperation operation) {
	if (!(operation instanceof CreateDecoratorsOperation)) {
		return false;
	}
	IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation)
			.getDecoratorTarget();
	View view = (View) decoratorTarget.getAdapter(View.class);
	return view != null;
}
 
Example #15
Source File: ActivityDecoratorProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public boolean provides(IOperation operation) {
    Assert.isNotNull(operation);

    if (!(operation instanceof CreateDecoratorsOperation)) {
        return false;
    }

    IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation)
            .getDecoratorTarget();
    GraphicalEditPart ep = getDecoratorTargetNode(decoratorTarget) ;
    return ep != null && (((IGraphicalEditPart) ep).resolveSemanticElement() instanceof Activity || ((IGraphicalEditPart) ep).resolveSemanticElement() instanceof SubProcessEvent ) ;
}
 
Example #16
Source File: ActivityDecoratorProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * getDecoratorTargetClassifier Utility method to determine if the
 * decoratorTarget is a supported type for this decorator and return the
 * associated EditPart element.
 * 
 * @param decoratorTarget
 *            IDecoratorTarget to check and return valid Classifier target.
 * @return node GraphicalEditPart if IDecoratorTarget can be supported, null
 *         otherwise.
 */
public static GraphicalEditPart getDecoratorTargetNode(IDecoratorTarget decoratorTarget) {
    if(decoratorTarget == null){
        return null;
    }
    ShapeNodeEditPart node = (ShapeNodeEditPart) decoratorTarget.getAdapter(ShapeNodeEditPart.class);
    if(node != null ){
        return node ;
    }

    return null;

}
 
Example #17
Source File: ProcessValidationDecoratorProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public boolean provides(IOperation operation) {
	if (!(operation instanceof CreateDecoratorsOperation)) {
		return false;
	}
	IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget();
	View view = (View) decoratorTarget.getAdapter(View.class);
	return view != null && MainProcessEditPart.MODEL_ID.equals(ProcessVisualIDRegistry.getModelID(view));
}
 
Example #18
Source File: AbstractMarkerBasedDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
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())) {
			decoratorTarget.installDecorator(getDecoratorKey(), createStatusDecorator(decoratorTarget));
		}
	}
}
 
Example #19
Source File: CrossflowShortcutsDecoratorProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
public void createDecorators(IDecoratorTarget decoratorTarget) {
	View view = (View) decoratorTarget.getAdapter(View.class);
	if (view != null) {
		EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
		if (annotation != null) {
			decoratorTarget.installDecorator(SHORTCUTS_DECORATOR_ID, new ShortcutsDecorator(decoratorTarget));
		}
	}
}
 
Example #20
Source File: LoopSubprocessTaskDecorator.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public LoopSubprocessTaskDecorator(final IDecoratorTarget decoratorTarget, final ActivityDecoratorProvider activityDecoratorProvider) {
    super(decoratorTarget);
}
 
Example #21
Source File: ReceiveTaskDecorator.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public ReceiveTaskDecorator(IDecoratorTarget decoratorTarget, ActivityDecoratorProvider activityDecoratorProvider) {
	super(decoratorTarget);
}
 
Example #22
Source File: CrossflowShortcutsDecoratorProvider.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
public ShortcutsDecorator(IDecoratorTarget decoratorTarget) {
	super(decoratorTarget);
}
 
Example #23
Source File: MultiInstanceSubprocessDecorator.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Direction getDirection() {
    return IDecoratorTarget.Direction.SOUTH;
}
 
Example #24
Source File: MultiInstanceParalellDecorator.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public MultiInstanceParalellDecorator(final IDecoratorTarget decoratorTarget,	final ActivityDecoratorProvider activityDecoratorProvider) {
    super(decoratorTarget, activityDecoratorProvider);
}
 
Example #25
Source File: ReceiveTaskDecorator.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Direction getDirection() {
	return IDecoratorTarget.Direction.NORTH_WEST;
}
 
Example #26
Source File: LoopTaskDecorator.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public LoopTaskDecorator(final IDecoratorTarget decoratorTarget, final ActivityDecoratorProvider activityDecoratorProvider) {
    super(decoratorTarget);
}
 
Example #27
Source File: LoopTaskDecorator.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Direction getDirection() {
    return IDecoratorTarget.Direction.SOUTH;
}
 
Example #28
Source File: SubProcessDecorator.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Direction getDirection() {
    return IDecoratorTarget.Direction.SOUTH;
}
 
Example #29
Source File: MultiInstanceDecorator.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public MultiInstanceDecorator(final IDecoratorTarget decoratorTarget, final ActivityDecoratorProvider activityDecoratorProvider) {
    super(decoratorTarget);
}
 
Example #30
Source File: LoopSubprocessTaskDecorator.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Direction getDirection() {
    return IDecoratorTarget.Direction.SOUTH;
}