Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » persistent property and open resource
persistent property and open resource [message #330227] Tue, 22 July 2008 00:27 Go to next message
Carl Hagenmaier is currently offline Carl HagenmaierFriend
Messages: 11
Registered: July 2009
Junior Member
I have a IObjectActionDelegate that
1. does some stuff
2. sets or removes a persistentProperty on the underlying resource
associated
with the object
3. touches the resource.

The purpose of the touch is to decorate the resource with the proper
decoration.

This all works properly if the resource is not open. But if the resource
is open, the touch does not result in the resource being decorated. I
have verified that the persistentProperty is set or removed whether the
resource is open or not.

Any hints?
Re: persistent property and open resource [message #330248 is a reply to message #330227] Wed, 23 July 2008 00:02 Go to previous message
Carl Hagenmaier is currently offline Carl HagenmaierFriend
Messages: 11
Registered: July 2009
Junior Member
I have verified that the decorator is not being called.

I created a new extension in my plugin.xml

<extension point="org.eclipse.ui.decorators">
<decorator
adaptable="true"
class="jtocsharp.TestDecorator"
icon="icons/sample.gif"
id="JtoCsharp.decorator2"
label="Resource Decorator 2"
lightweight="true"
location="TOP_RIGHT"
state="true">
<enablement>
<objectClass
name="org.eclipse.jdt.core.ICompilationUnit">
</objectClass>
</enablement>
</decorator>
</extension>

If the resource (in this case a .java file) is not open, the decorate
method of my decorator class TestDecorator is executed. If the resource
is open, the decorate method is not called. Thinking perhaps that opening
the file might change the objectClass (so that it is no longer an
IComplilationUnit), I changed the enablement to java.lang.Object. This
made no difference.

It must be that the something in the event processing that occurs as a
result of the "touch" is suppressing the decoration because the file is
open. There must be some (not obvious to me) reason why this behavior is
desired. In any case, I need a way around it.
Previous Topic:Window based preferences
Next Topic:not to dispose parent shell on close of child shell
Goto Forum:
  


Current Time: Wed Jul 17 18:32:07 GMT 2024

Powered by FUDForum. Page generated in 0.03256 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top