use of org.eclipse.emf.ecore.EAnnotation in project tdi-studio-se by Talend.
the class ListBusinessItemViewFactory 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.ListBusinessItemEditPart.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(ListBusinessItemNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
}
use of org.eclipse.emf.ecore.EAnnotation in project xtext-core by eclipse.
the class ConcurrentAccessTest method setUp.
@Before
public void setUp() throws Exception {
globalStateMemento = GlobalRegistries.makeCopyOfGlobalState();
EPackage.Registry.INSTANCE.put(XMLTypePackage.eNS_URI, XMLTypePackage.eINSTANCE);
ResourceSet resourceSet = new ResourceSetImpl();
resource = new XtextResource(URI.createFileURI("something.ecore"));
resourceSet.getResources().add(resource);
EPackage start = EcoreFactory.eINSTANCE.createEPackage();
resource.getContents().add(start);
for (int i = 0; i < 100; i++) {
File tempFile = temporaryFolder.createTempFile("Package" + i, ".ecore");
URI fileURI = URI.createFileURI(tempFile.getAbsolutePath());
Resource toBeProxified = resourceSet.createResource(fileURI);
EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage();
ePackage.setNsURI("http://www.test.me/" + i);
toBeProxified.getContents().add(ePackage);
for (int j = 0; j < 100; j++) {
EAnnotation annotation = EcoreFactory.eINSTANCE.createEAnnotation();
annotation.setSource("Source" + j);
start.getEAnnotations().add(annotation);
EClass superClass = EcoreFactory.eINSTANCE.createEClass();
superClass.setName("SuperClass" + j);
ePackage.getEClassifiers().add(superClass);
annotation.getReferences().add(superClass);
}
toBeProxified.save(null);
}
EcoreUtil.resolveAll(resourceSet);
for (int i = 100; i >= 1; i--) {
Resource toBeProxified = resourceSet.getResources().get(i);
toBeProxified.unload();
resourceSet.getResources().remove(toBeProxified);
}
}
use of org.eclipse.emf.ecore.EAnnotation in project xtext-core by eclipse.
the class LazyLinkingResourceTest method testEObjectReference.
@Test
public void testEObjectReference() throws Exception {
final EAnnotation source = EcoreFactory.eINSTANCE.createEAnnotation();
final EObject referencedObject = XtextFactory.eINSTANCE.createGrammar();
LazyLinkingResource res = new LazyLinkingResource();
res.setLinkingHelper(new LinkingHelper() {
@Override
public String getCrossRefNodeAsString(INode node, boolean convert) {
return node.getText();
}
});
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 Lists.newArrayList(referencedObject);
}
});
res.setDiagnosticMessageProvider(new LinkingDiagnosticMessageProvider());
assertEquals(referencedObject, res.getEObject("foo"));
}
use of org.eclipse.emf.ecore.EAnnotation in project tdi-studio-se by Talend.
the class DocumentBusinessItemViewFactory 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.DocumentBusinessItemEditPart.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(DocumentBusinessItemNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
}
use of org.eclipse.emf.ecore.EAnnotation in project tdi-studio-se by Talend.
the class EllipseBusinessItemViewFactory 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.EllipseBusinessItemEditPart.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(EllipseBusinessItemNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
}
Aggregations