Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » File icons and problem marker decorators(Decorator location "REPLACE" not working.)
icon5.gif  File icons and problem marker decorators [message #637934] Tue, 09 November 2010 12:03 Go to next message
daisydale85 is currently offline daisydale85Friend
Messages: 38
Registered: August 2010
Member
Hi,

I am developing a custom editor which is used to handle more than 1 file extensions. Eventhough the editor that handles the file extensions are same, there is a requirement of showing diff. icons for files based on their extensions in script/project/package explorer views. Based on the advices from some experts (see http://www.eclipse.org/forums/index.php?t=msg&th=199386& amp; amp;start=0&S=a8ff79a2f8105ed0dbdea51450e1191a ), I extended "org.eclipse.dltk.ui.modelLabelProvider" and its getImage function. But further testing revealed that this works well in Script Explorer view only. Hence, I tried extending "org.eclipse.ui.decorators". Here, I extended "decorateImage" function which based on the file's extension returned the correspoding image. Though this is not the right solution, I decided to proceed with this method. So far, it was working well.
Next, I wanted the problem markers to be displayed when the parser detects errors in the file. Since I extended "org.eclipse.ui.decorators", the base decorators stopped working. Error markers are no longer getting displayed over the file icons.
So this is the summary of my issues/requirements.
1) Display diff. icons depending upon the file extensions. Is there any other method other than extending "org.eclipse.ui.decorators"?
2) Retain base decorators even after extending "org.eclipse.ui.decorators". Which the default class that handles decorations if we are not extending "org.eclipse.ui.decorators"?

Sorry for being a bit descrptive, but I cant explain my issues in a better way. Any help will be highly appreciated.

Thanks in advance,
Daisy.

[Updated on: Wed, 10 November 2010 07:53]

Report message to a moderator

Re: File icons and problem marker decorators [message #638143 is a reply to message #637934] Wed, 10 November 2010 08:00 Go to previous messageGo to next message
daisydale85 is currently offline daisydale85Friend
Messages: 38
Registered: August 2010
Member
Hi,

Now I am able to show problem decorators and also the icons by giving "org.eclipse.ui.decorators" extension point as below.

<extension
         point="org.eclipse.ui.decorators">
   <decorator
            adaptable="true"
            location="BOTTOM_RIGHT"
            lightweight="true"
            label="Sample Decorator"
            state="true"
            class="org.eclipse.dltk.ui.DeclarativeLightweightLabelDecorator:/icons/sample.png"
            id="sample.decorators.sampledecorator">
         <enablement>
            <and>
            	<objectClass name="org.eclipse.core.resources.IFile"/>
             <objectState
                   name="extension"
                   value="myext">
             </objectState>
            </and>
         </enablement>
      </decorator>
 </extension>]

Previously, I implemented ILabelDecorator class. But this way, it works..
Now the problem is with display. Error decorator is not clearly shown over the icon. Only a part of the error marker is being seen. Actually, in the extension, instead of giving "BOTTOM_RIGHT" as location, I would like to use the option "REPLACE", but looks like there is some issue with that option. Or is it because I am missing some important point? When I use "REPLACE" option, it is showing the editor icon and is not replacing with the icon specified. Also, when location is given any value other than "REPLACE", I could notice a considerable delay in updating the icon. I am able to see the default icon and then they get changed to the icon given in the decorator.

Thanks,
Daisy.

[Updated on: Wed, 10 November 2010 08:30]

Report message to a moderator

Re: File icons and problem marker decorators [message #638733 is a reply to message #637934] Fri, 12 November 2010 11:57 Go to previous messageGo to next message
daisydale85 is currently offline daisydale85Friend
Messages: 38
Registered: August 2010
Member
Any idea on this issue?
Re: File icons and problem marker decorators [message #639119 is a reply to message #638733] Mon, 15 November 2010 11:21 Go to previous message
daisydale85 is currently offline daisydale85Friend
Messages: 38
Registered: August 2010
Member
REPLACE worked when I implemented "ILightweightLabelDecorator" and set "IDecoration.ENABLE_REPLACE" property to true in the decorationcontext of the decorator, but the problem markers disappeared Sad . Is there any way to retain all decorators of the image while only changing the base image?

Thanks,
Daisy.
Previous Topic:Extending code folding
Next Topic:Debugging engine for debug Tcl with DLTK
Goto Forum:
  


Current Time: Fri Mar 29 08:50:07 GMT 2024

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

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

Back to the top