[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform] Lightweight decorator cannot keep up with a viewer content change
|
- From: Serge_Yuschenko@xxxxxxxx (Serge Yuschenko)
- Date: Mon, 5 Jul 2004 21:41:51 +0000 (UTC)
- Newsgroups: eclipse.platform
- Organization: http://news.eclipse.org
- User-agent: NewsPortal/0.25 (http://florian-amrhein.de/newsportal/)
I use a lightweight decorator in my plugin to indicate a connection point
status (DISCONNECTED/CONNECTED/BUSY) in the TreeViewer. BUSY is an
intermediate state between CONNECTED/DISCONNECTED. On every state change I
call viewer.update( connection, null ) method. In approximately 50% of the
cases the decorator works properly. I.e. decoration goes all the way from
DISCONNECTED to CONNECTED. In another half of the cases the icon gets
stuck on BUSY.
I use a generic eclipse label decorator:
viewer.setLabelProvider(
WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
This is an example of decorator for CONNECTED state. There are similar
descriptions for DISCONNECTED and BUSY.
<extension
point="org.eclipse.ui.decorators">
<decorator
lightweight="true"
adaptable="true"
label="connected"
icon="icons/connected.gif"
state="true"
location="BOTTOM_RIGHT"
id="com.xyz.decorator.connected">
<enablement>
<and>
<objectClass
name="com.xyz.ConnectionPoint">
</objectClass>
<objectState
name="connected"
value="true">
</objectState>
</and>
</enablement>
</decorator>
</extension>
The objectState is veryfied with an IActionFilter for an ConnectionPoint
object. I noticed when the decoration gets stuck on a BUSY state the
IActionFilter.testAttribute() is called only once that means the decorator
does not even try to update an icon on BUSY->CONNECTED state change.
I believe it is very hard to make any conclusion based merely on what I
said here unless it is some known issue. If someone is interested I can
provide a plugin demonstrating this behaviour.
Eclipse version 3.0.0, build 200406251208
Sincerely,
Serge