|
Re: AbstractEditPart and IAdaptable [message #197231 is a reply to message #197204] |
Fri, 30 September 2005 12:57 |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
"Krzysztof Ogrodnik" <ogrodnikk@axxia.com> wrote in message
news:dhis17$et0$1@news.eclipse.org...
> Hi,
> Can you tell me why the method getAdapter in AbstractEditPart returns null
> instead of delegating to to the standard eclipse adapter manager
> Platform.getAdapterManager().getAdapter()? Because of this null, extending
> the edit parts using dynamically registered adapters is rather difficult.
>
Why is it difficult?
public Object getAdapter(Class key)
{
Object adapter = super.getAdapter(key);
if(adapter == null) {
adapter = Platform.getAdapterManager().getAdapter(key);
}
return adapter;
}
---
Sunil
|
|
|
|
Re: AbstractEditPart and IAdaptable [message #197396 is a reply to message #197204] |
Mon, 03 October 2005 15:30 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Please open a feature request.
"Krzysztof Ogrodnik" <ogrodnikk@axxia.com> wrote in message
news:dhis17$et0$1@news.eclipse.org...
> Hi,
> Can you tell me why the method getAdapter in AbstractEditPart returns null
> instead of delegating to to the standard eclipse adapter manager
> Platform.getAdapterManager().getAdapter()? Because of this null, extending
> the edit parts using dynamically registered adapters is rather difficult.
>
> public Object getAdapter(Class key)
> {
> if (IPropertySource.class == key) {
> if (getModel() instanceof IPropertySource)
> return getModel();
> if (getModel() instanceof IAdaptable)
> return ((IAdaptable)getModel()).getAdapter(key);
> }
> if (AccessibleEditPart.class == key)
> return getAccessibleEditPart();
> return null;
> }
>
> Kind regards,
>
> Krzysztof
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03197 seconds