File icons and problem marker decorators [message #637934] |
Tue, 09 November 2010 12:03 |
daisydale85 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 |
daisydale85 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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03470 seconds