Java Code Examples for org.eclipse.gmf.runtime.notation.View#isSetElement()
The following examples show how to use
org.eclipse.gmf.runtime.notation.View#isSetElement() .
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: ValidateAction.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @generated */ private static void validate(DiagramEditPart diagramEditPart, View view) { IFile target = view.eResource() != null ? WorkspaceSynchronizer.getFile(view.eResource()) : null; if (target != null) { ProcessMarkerNavigationProvider.deleteMarkers(target); } Diagnostic diagnostic = runEMFValidator(view); createMarkers(target, diagnostic, diagramEditPart); IBatchValidator validator = (IBatchValidator) ModelValidationService.getInstance() .newValidator(EvaluationMode.BATCH); validator.setIncludeLiveConstraints(true); if (view.isSetElement() && view.getElement() != null) { IStatus status = validator.validate(view.getElement()); createMarkers(target, status, diagramEditPart); } }
Example 2
Source File: ValidateAction.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * @generated */ private static void validate(DiagramEditPart diagramEditPart, View view) { IFile target = view.eResource() != null ? WorkspaceSynchronizer.getFile(view.eResource()) : null; if (target != null) { CrossflowMarkerNavigationProvider.deleteMarkers(target); } Diagnostic diagnostic = runEMFValidator(view); createMarkers(target, diagnostic, diagramEditPart); IBatchValidator validator = (IBatchValidator) ModelValidationService.getInstance() .newValidator(EvaluationMode.BATCH); validator.setIncludeLiveConstraints(true); if (view.isSetElement() && view.getElement() != null) { IStatus status = validator.validate(view.getElement()); createMarkers(target, status, diagramEditPart); } }
Example 3
Source File: ProcessDiagramUpdater.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @generated */ public static List<ProcessNodeDescriptor> getReceiveTask_3026SemanticChildren(View view) { if (!view.isSetElement()) { return Collections.emptyList(); } ReceiveTask modelElement = (ReceiveTask) view.getElement(); LinkedList<ProcessNodeDescriptor> result = new LinkedList<ProcessNodeDescriptor>(); for (Iterator<?> it = modelElement.getBoundaryIntermediateEvents().iterator(); it.hasNext();) { BoundaryEvent childElement = (BoundaryEvent) it.next(); int visualID = ProcessVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == IntermediateErrorCatchEvent3EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 4
Source File: CrossflowDiagramUpdater.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * @generated */ public static List<CrossflowNodeDescriptor> getScriptedTaskScriptedTaskOutputVariablesCompartment_7003SemanticChildren( View view) { if (false == view.eContainer() instanceof View) { return Collections.emptyList(); } View containerView = (View) view.eContainer(); if (!containerView.isSetElement()) { return Collections.emptyList(); } ScriptedTask modelElement = (ScriptedTask) containerView.getElement(); LinkedList<CrossflowNodeDescriptor> result = new LinkedList<CrossflowNodeDescriptor>(); for (Iterator<?> it = modelElement.getOutputVariables().iterator(); it.hasNext();) { Field childElement = (Field) it.next(); int visualID = CrossflowVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == Field2EditPart.VISUAL_ID) { result.add(new CrossflowNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 5
Source File: CrossflowDiagramUpdater.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * @generated */ public static List<CrossflowNodeDescriptor> getTypeTypeFieldsCompartment_7001SemanticChildren(View view) { if (false == view.eContainer() instanceof View) { return Collections.emptyList(); } View containerView = (View) view.eContainer(); if (!containerView.isSetElement()) { return Collections.emptyList(); } Type modelElement = (Type) containerView.getElement(); LinkedList<CrossflowNodeDescriptor> result = new LinkedList<CrossflowNodeDescriptor>(); for (Iterator<?> it = modelElement.getFields().iterator(); it.hasNext();) { Field childElement = (Field) it.next(); int visualID = CrossflowVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == Field3EditPart.VISUAL_ID) { result.add(new CrossflowNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 6
Source File: CrossflowDiagramUpdater.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * @generated */ public static List<CrossflowNodeDescriptor> getLanguageLanguageParametersCompartment_7002SemanticChildren( View view) { if (false == view.eContainer() instanceof View) { return Collections.emptyList(); } View containerView = (View) view.eContainer(); if (!containerView.isSetElement()) { return Collections.emptyList(); } Language modelElement = (Language) containerView.getElement(); LinkedList<CrossflowNodeDescriptor> result = new LinkedList<CrossflowNodeDescriptor>(); for (Iterator<?> it = modelElement.getParameters().iterator(); it.hasNext();) { Parameter childElement = (Parameter) it.next(); int visualID = CrossflowVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == ParameterEditPart.VISUAL_ID) { result.add(new CrossflowNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 7
Source File: CrossflowValidationDecoratorProvider.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * @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 8
Source File: ProcessDiagramUpdater.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @generated */ public static List<ProcessNodeDescriptor> getActivity_3006SemanticChildren(View view) { if (!view.isSetElement()) { return Collections.emptyList(); } Activity modelElement = (Activity) view.getElement(); LinkedList<ProcessNodeDescriptor> result = new LinkedList<ProcessNodeDescriptor>(); for (Iterator<?> it = modelElement.getBoundaryIntermediateEvents().iterator(); it.hasNext();) { BoundaryEvent childElement = (BoundaryEvent) it.next(); int visualID = ProcessVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == IntermediateErrorCatchEvent6EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 9
Source File: ProcessDiagramUpdater.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @generated */ public static List<ProcessNodeDescriptor> getScriptTask_3028SemanticChildren(View view) { if (!view.isSetElement()) { return Collections.emptyList(); } ScriptTask modelElement = (ScriptTask) view.getElement(); LinkedList<ProcessNodeDescriptor> result = new LinkedList<ProcessNodeDescriptor>(); for (Iterator<?> it = modelElement.getBoundaryIntermediateEvents().iterator(); it.hasNext();) { BoundaryEvent childElement = (BoundaryEvent) it.next(); int visualID = ProcessVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == IntermediateErrorCatchEvent5EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 10
Source File: CrossflowDiagramEditorUtil.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * @generated */ private static boolean buildElement2ViewMap(View parentView, Map<EObject, View> element2ViewMap, Set<? extends EObject> elements) { if (elements.size() == element2ViewMap.size()) { return true; } if (parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) { element2ViewMap.put(parentView.getElement(), parentView); if (elements.size() == element2ViewMap.size()) { return true; } } boolean complete = false; for (Iterator<?> it = parentView.getChildren().iterator(); it.hasNext() && !complete;) { complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements); } for (Iterator<?> it = parentView.getSourceEdges().iterator(); it.hasNext() && !complete;) { complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements); } for (Iterator<?> it = parentView.getTargetEdges().iterator(); it.hasNext() && !complete;) { complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements); } return complete; }
Example 11
Source File: ProcessDiagramUpdater.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @generated */ public static List<ProcessNodeDescriptor> getReceiveTask_2025SemanticChildren(View view) { if (!view.isSetElement()) { return Collections.emptyList(); } ReceiveTask modelElement = (ReceiveTask) view.getElement(); LinkedList<ProcessNodeDescriptor> result = new LinkedList<ProcessNodeDescriptor>(); for (Iterator<?> it = modelElement.getBoundaryIntermediateEvents().iterator(); it.hasNext();) { BoundaryEvent childElement = (BoundaryEvent) it.next(); int visualID = ProcessVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == IntermediateErrorCatchEvent3EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 12
Source File: ProcessDiagramUpdater.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @generated */ public static List<ProcessNodeDescriptor> getServiceTask_2027SemanticChildren(View view) { if (!view.isSetElement()) { return Collections.emptyList(); } ServiceTask modelElement = (ServiceTask) view.getElement(); LinkedList<ProcessNodeDescriptor> result = new LinkedList<ProcessNodeDescriptor>(); for (Iterator<?> it = modelElement.getBoundaryIntermediateEvents().iterator(); it.hasNext();) { BoundaryEvent childElement = (BoundaryEvent) it.next(); int visualID = ProcessVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == IntermediateErrorCatchEvent4EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 13
Source File: ProcessDiagramUpdater.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @generated */ public static List<ProcessNodeDescriptor> getScriptTask_2028SemanticChildren(View view) { if (!view.isSetElement()) { return Collections.emptyList(); } ScriptTask modelElement = (ScriptTask) view.getElement(); LinkedList<ProcessNodeDescriptor> result = new LinkedList<ProcessNodeDescriptor>(); for (Iterator<?> it = modelElement.getBoundaryIntermediateEvents().iterator(); it.hasNext();) { BoundaryEvent childElement = (BoundaryEvent) it.next(); int visualID = ProcessVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == IntermediateErrorCatchEvent5EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 14
Source File: ProcessDiagramUpdater.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @generated */ public static List<ProcessNodeDescriptor> getActivity_2006SemanticChildren(View view) { if (!view.isSetElement()) { return Collections.emptyList(); } Activity modelElement = (Activity) view.getElement(); LinkedList<ProcessNodeDescriptor> result = new LinkedList<ProcessNodeDescriptor>(); for (Iterator<?> it = modelElement.getBoundaryIntermediateEvents().iterator(); it.hasNext();) { BoundaryEvent childElement = (BoundaryEvent) it.next(); int visualID = ProcessVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == IntermediateErrorCatchEvent6EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 15
Source File: ProcessDiagramUpdater.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public static List<ProcessNodeDescriptor> getTask_2004SemanticChildren(View view) { if (!view.isSetElement()) { return Collections.emptyList(); } Task modelElement = (Task) view.getElement(); LinkedList<ProcessNodeDescriptor> result = new LinkedList<ProcessNodeDescriptor>(); for (Iterator<?> it = modelElement.getBoundaryIntermediateEvents().iterator(); it.hasNext();) { BoundaryEvent childElement = (BoundaryEvent) it.next(); int visualID = ProcessVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == IntermediateErrorCatchEvent2EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == BoundaryMessageEventEditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == NonInterruptingBoundaryTimerEventEditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == BoundaryTimerEventEditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == BoundarySignalEventEditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 16
Source File: ProcessDiagramUpdater.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public static List<ProcessNodeDescriptor> getCallActivity_3063SemanticChildren(View view) { if (!view.isSetElement()) { return Collections.emptyList(); } CallActivity modelElement = (CallActivity) view.getElement(); LinkedList<ProcessNodeDescriptor> result = new LinkedList<ProcessNodeDescriptor>(); for (Iterator<?> it = modelElement.getBoundaryIntermediateEvents().iterator(); it.hasNext();) { BoundaryEvent childElement = (BoundaryEvent) it.next(); int visualID = ProcessVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == IntermediateErrorCatchEventEditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == BoundaryMessageEvent2EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == NonInterruptingBoundaryTimerEvent2EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == BoundaryTimerEvent2EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == BoundarySignalEvent2EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 17
Source File: ProcessDiagramUpdater.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public static List<ProcessNodeDescriptor> getCallActivity_2036SemanticChildren(View view) { if (!view.isSetElement()) { return Collections.emptyList(); } CallActivity modelElement = (CallActivity) view.getElement(); LinkedList<ProcessNodeDescriptor> result = new LinkedList<ProcessNodeDescriptor>(); for (Iterator<?> it = modelElement.getBoundaryIntermediateEvents().iterator(); it.hasNext();) { BoundaryEvent childElement = (BoundaryEvent) it.next(); int visualID = ProcessVisualIDRegistry.getNodeVisualID(view, childElement); if (visualID == IntermediateErrorCatchEventEditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == BoundaryMessageEvent2EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == NonInterruptingBoundaryTimerEvent2EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == BoundaryTimerEvent2EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } if (visualID == BoundarySignalEvent2EditPart.VISUAL_ID) { result.add(new ProcessNodeDescriptor(childElement, visualID)); continue; } } return result; }
Example 18
Source File: ValidationMarkerProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public Diagnostic runEMFValidator(final View target) { if (target.isSetElement() && target.getElement() != null) { return new Diagnostician() { @Override public String getObjectLabel(final EObject eObject) { return EMFCoreUtil.getQualifiedName(eObject, true); } }.validate(target.getElement()); } return Diagnostic.OK_INSTANCE; }
Example 19
Source File: ValidateAction.java From scava with Eclipse Public License 2.0 | 5 votes |
/** * @generated */ private static Diagnostic runEMFValidator(View target) { if (target.isSetElement() && target.getElement() != null) { return new Diagnostician() { public String getObjectLabel(EObject eObject) { return EMFCoreUtil.getQualifiedName(eObject, true); } }.validate(target.getElement()); } return Diagnostic.OK_INSTANCE; }
Example 20
Source File: CrossflowDiagramUpdater.java From scava with Eclipse Public License 2.0 | 4 votes |
/** * @generated */ public static boolean isShortcutOrphaned(View view) { return !view.isSetElement() || view.getElement() == null || view.getElement().eIsProxy(); }