[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: persistent property and open resource

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.