private static CDOLegacyAdapter getLegacyAdapter(EList<Adapter> adapters) { return (CDOLegacyAdapter)EcoreUtil.getAdapter(adapters, CDOLegacyAdapter.class); }
/** * Returns the specified notifier's existing adapter of the specified type. * @param notifier the adapted object. * @param type the type of adapter. * @return an adapter associated with the specified notifier or null. */ public static Adapter getExistingAdapter(Notifier notifier, Object type) { return getAdapter(notifier.eAdapters(), type); }
private InnerBlockDocumentationAdapter getInnerDocumentation(EObject semanticObject) { if (this.indocumentedSemanticObjects.add(semanticObject)) { return (InnerBlockDocumentationAdapter) EcoreUtil.getAdapter(semanticObject.eAdapters(), InnerBlockDocumentationAdapter.class); } return null; }
/** * Returns the specified notifier's existing adapter of the specified type. * @param notifier the adapted object. * @param type the type of adapter. * @return an adapter associated with the specified notifier or null. */ public static Adapter getExistingAdapter(Notifier notifier, Object type) { return getAdapter(notifier.eAdapters(), type); }
private Adapter getAdapter(EObject anObject) { return EcoreUtil.getAdapter(anObject.eAdapters(),EJBAttributeMaintenanceFactoryImpl.ADAPTER_KEY); } }
/** * Return the DelegateEPackageAdapter for ePackage, if there is one, or null if none. * * @since 3.1 */ public static DelegateEPackageAdapter findAdapter(EPackage ePackage) { return (DelegateEPackageAdapter) EcoreUtil.getAdapter(ePackage.eAdapters(), DelegateEPackageAdapter.class); }
protected void emitDocumentation(EObject semanticObject) { if (this.documentedSemanticObjects.add(semanticObject)) { DocumentationAdapter documentationAdapter = (DocumentationAdapter) EcoreUtil.getAdapter(semanticObject.eAdapters(), DocumentationAdapter.class); if (documentationAdapter != null) { emitDocumentation(semanticObject.getClass(), documentationAdapter.getDocumentation()); } } }
public void requestNotificationOnChange(Notifier notifier, Runnable runnable) { NotificationDispatcher result = (NotificationDispatcher) EcoreUtil.getAdapter( notifier.eAdapters(), NotificationDispatcher.class); if (result == null) { result = new NotificationDispatcher(notifier); notifier.eAdapters().add(result); } synchronized (listeners) { listeners.add(runnable); } }
/** * Set the context. * * @param ctx * The context */ public void setContext(Notifier ctx) { final ResourceSet resourceSet = EcoreUtil2.getResourceSet(ctx); delegate = (IResourceDescriptions) EcoreUtil.getAdapter(resourceSet.eAdapters(), CurrentDescriptions.class); }
public static SourceAdapter adapt(EObject object, EObject source) { SourceAdapter adapter = (SourceAdapter) EcoreUtil.getAdapter(object.eAdapters(), source); if (adapter == null) { adapter = new SourceAdapter(); object.eAdapters().add(adapter); } adapter.sources.add(source); return adapter; }
public void requestNotificationOnChange(Notifier notifier, Runnable runnable) { NotificationDispatcher result = (NotificationDispatcher) EcoreUtil.getAdapter( notifier.eAdapters(), NotificationDispatcher.class); if (result == null) { result = new NotificationDispatcher(notifier); notifier.eAdapters().add(result); } synchronized (listeners) { listeners.add(runnable); } }
public static DelegateEClassifierAdapter getAdapter(EClassifier eClassifier) { DelegateEClassifierAdapter adapter = (DelegateEClassifierAdapter) EcoreUtil .getAdapter(eClassifier.eAdapters(), DelegateEClassifierAdapter.class); if (adapter == null) { adapter = new DelegateEClassifierAdapter(); eClassifier.eAdapters().add(adapter); } return adapter; }
public static JvmTypeChangeDispatcher findResourceChangeDispatcher(Notifier notifier) { JvmTypeChangeDispatcher result = (JvmTypeChangeDispatcher) EcoreUtil.getAdapter( notifier.eAdapters(), JvmTypeChangeDispatcher.class); if (result == null) { result = new JvmTypeChangeDispatcher(); notifier.eAdapters().add(result); } return result; }
public static JvmTypeChangeDispatcher findResourceChangeDispatcher(Notifier notifier) { JvmTypeChangeDispatcher result = (JvmTypeChangeDispatcher) EcoreUtil.getAdapter( notifier.eAdapters(), JvmTypeChangeDispatcher.class); if (result == null) { result = new JvmTypeChangeDispatcher(); notifier.eAdapters().add(result); } return result; }
public static DelegateResourceSetAdapter getAdapter(ResourceSet resourceSet) { DelegateResourceSetAdapter adapter = (DelegateResourceSetAdapter) EcoreUtil.getAdapter(resourceSet.eAdapters(), DelegateResourceSetAdapter.class); if (adapter == null) { adapter = new DelegateResourceSetAdapter(); resourceSet.eAdapters().add(adapter); } return adapter; }
public static DelegateResourceAdapter getAdapter(Resource resource) { DelegateResourceAdapter adapter = (DelegateResourceAdapter) EcoreUtil.getAdapter(resource.eAdapters(), DelegateResourceAdapter.class); if (adapter == null) { adapter = new DelegateResourceAdapter(); resource.eAdapters().add(adapter); } return adapter; }
/** * Return the DelegateEPackageAdapter for ePackage, creating * one if necessary. */ public static DelegateEPackageAdapter getAdapter(EPackage ePackage) { DelegateEPackageAdapter adapter = (DelegateEPackageAdapter) EcoreUtil.getAdapter(ePackage.eAdapters(), DelegateEPackageAdapter.class); if (adapter == null) { adapter = new DelegateEPackageAdapter(); ePackage.eAdapters().add(adapter); } return adapter; }
@Override public String getDocComment() { Adapter _adapter = EcoreUtil.getAdapter(this.getDelegate().eAdapters(), DocumentationAdapter.class); final DocumentationAdapter adapter = ((DocumentationAdapter) _adapter); String _documentation = null; if (adapter!=null) { _documentation=adapter.getDocumentation(); } return _documentation; }
protected JvmType tryFindTypeInIndex(String name, boolean binaryNestedTypeDelimiter) { TypeInResourceSetAdapter adapter = (TypeInResourceSetAdapter) EcoreUtil.getAdapter(getResourceSet().eAdapters(), TypeInResourceSetAdapter.class); if (adapter != null) { return adapter.tryFindTypeInIndex(name, this, binaryNestedTypeDelimiter); } else { return doTryFindInIndex(name, binaryNestedTypeDelimiter); } }
public void setDocComment(final String docComment) { this.checkMutable(); Adapter _adapter = EcoreUtil.getAdapter(this.getDelegate().eAdapters(), DocumentationAdapter.class); DocumentationAdapter adapter = ((DocumentationAdapter) _adapter); if ((adapter == null)) { DocumentationAdapter _documentationAdapter = new DocumentationAdapter(); adapter = _documentationAdapter; EList<Adapter> _eAdapters = this.getDelegate().eAdapters(); _eAdapters.add(adapter); } adapter.setDocumentation(docComment); }