use of org.eclipse.emf.ecore.EAnnotation in project tdi-studio-se by Talend.
the class DecisionBusinessItemViewFactory method decorateView.
/**
* @generated
*/
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
if (semanticHint == null) {
semanticHint = BusinessVisualIDRegistry.getType(org.talend.designer.business.model.business.diagram.edit.parts.DecisionBusinessItemEditPart.VISUAL_ID);
view.setType(semanticHint);
}
super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
if (!BusinessProcessEditPart.MODEL_ID.equals(BusinessVisualIDRegistry.getModelID(containerView))) {
EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
//$NON-NLS-1$
shortcutAnnotation.setSource("Shortcut");
//$NON-NLS-1$
shortcutAnnotation.getDetails().put("modelID", BusinessProcessEditPart.MODEL_ID);
view.getEAnnotations().add(shortcutAnnotation);
}
getViewService().createNode(semanticAdapter, view, BusinessVisualIDRegistry.getType(DecisionBusinessItemNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
}
use of org.eclipse.emf.ecore.EAnnotation in project tdi-studio-se by Talend.
the class TerminalBusinessItemViewFactory method decorateView.
/**
* @generated
*/
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
if (semanticHint == null) {
semanticHint = BusinessVisualIDRegistry.getType(org.talend.designer.business.model.business.diagram.edit.parts.TerminalBusinessItemEditPart.VISUAL_ID);
view.setType(semanticHint);
}
super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
if (!BusinessProcessEditPart.MODEL_ID.equals(BusinessVisualIDRegistry.getModelID(containerView))) {
EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
//$NON-NLS-1$
shortcutAnnotation.setSource("Shortcut");
//$NON-NLS-1$
shortcutAnnotation.getDetails().put("modelID", BusinessProcessEditPart.MODEL_ID);
view.getEAnnotations().add(shortcutAnnotation);
}
getViewService().createNode(semanticAdapter, view, BusinessVisualIDRegistry.getType(TerminalBusinessItemNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
}
use of org.eclipse.emf.ecore.EAnnotation in project xtext-core by eclipse.
the class LazyLinkingResourceTest method testWarningInsteadOfError.
@Test
public void testWarningInsteadOfError() throws Exception {
final EAnnotation source = EcoreFactory.eINSTANCE.createEAnnotation();
LazyLinkingResource res = new LazyLinkingResource();
res.setEncoder(new LazyURIEncoder() {
@Override
public boolean isCrossLinkFragment(Resource res, String s) {
return "foo".equals(s);
}
@Override
public Triple<EObject, EReference, INode> decode(Resource res, String uriFragment) {
return Tuples.create((EObject) source, EcorePackage.Literals.EANNOTATION__REFERENCES, (INode) new LeafNode());
}
});
res.setLinkingService(new ILinkingService() {
@Override
public List<EObject> getLinkedObjects(EObject context, EReference reference, INode node) throws IllegalNodeException {
return Collections.emptyList();
}
});
res.setDiagnosticMessageProvider(new LinkingDiagnosticMessageProvider() {
@Override
public DiagnosticMessage getUnresolvedProxyMessage(ILinkingDiagnosticContext context) {
return new DiagnosticMessage("myMessage", Severity.WARNING, null);
}
});
assertTrue(res.getWarnings().isEmpty());
assertNull(res.getEObject("foo"));
assertEquals(1, res.getWarnings().size());
assertTrue(res.getErrors().isEmpty());
assertEquals("myMessage", res.getWarnings().get(0).getMessage());
}
Aggregations