Community
Participate
Working Groups
The API is needed since when hasAdapter returns true but getAdapter returns false, there are two possible reasons which the expression language has to distnguish: - The factory is not yet loaded - The factory is loaded but cannot adapt that particular object. (see also bug 119948 for a detailed discussion)
*** Bug 152147 has been marked as a duplicate of this bug. ***
From Boris in bug 152147: I am proposing a new method along the following lines: /** Returns true if all applicable adapter factories for the given adaptable * object and the given adapter type name are loaded. */ boolean IAdapterManager.allAdapterFactoriesLoaded(Object adaptable, String adapterTypeName) This would allow more accurate results whenever an adapt expression is used for enablement or other purposes.
Any progress on this one. I got another complain about core expressions not behaving correctly.
Created attachment 48880 [details] Patch The patch adds queryAdapter() method as suggested. Boris: I think that at most one adapter factory per the pair of the {originating type; resulting type} is stored in the current AdapterManager implementation. On the other hand, super types and implemented interfaces are considered and that might add some complexity. Please let me know if this fits your needs; if so, I'll release it into the CVS head.
+ if (factory != null) + return LOADED; + } + return NOT_LOADED; should this not be: + if (factory == null) + return NOT_LOADED; + } + return LOADED;
Created attachment 48897 [details] Patch Yes, that's right! Updated patch is attached.
Patch released into CVS head.