Java Code Examples for org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget#installDecorator()

The following examples show how to use org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget#installDecorator() . 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: 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 2
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 3
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 4
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 5
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 6
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 7
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 8
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 9
Source File: DefinitionSectionDecorationProvider.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
public void createDecorators(IDecoratorTarget decoratorTarget) {
	Object adapter = decoratorTarget.getAdapter(EObject.class);
	if (adapter instanceof SpecificationElement)
		decoratorTarget.installDecorator(DECORATOR_KEY, new DefinitionSectionDecorator(decoratorTarget));
}
 
Example 10
Source File: SubmachineDecorationProvider.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
public void createDecorators(IDecoratorTarget decoratorTarget) {
	Object adapter = decoratorTarget.getAdapter(EObject.class);
	if (adapter instanceof State)
		decoratorTarget.installDecorator(DECORATOR_KEY, new SubmachineDecorator(decoratorTarget));
}
 
Example 11
Source File: HighlightingSubmachineDecorationProvider.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
public void createDecorators(IDecoratorTarget decoratorTarget) {
	Object adapter = decoratorTarget.getAdapter(EObject.class);
	if (adapter instanceof State)
		decoratorTarget.installDecorator(DECORATOR_KEY, new HighlightingSubmachineDecorator(decoratorTarget));
}