|
|
|
|
|
Re: Help required on setting editor icon from code [message #636905 is a reply to message #636123] |
Wed, 03 November 2010 10:04 |
daisydale85 Messages: 38 Registered: August 2010 |
Member |
|
|
Hi David,
I was able to change the icons in "Script Explorer" using "org.eclipse.dltk.ui.modelLabelProvider". But it was not getting reflected in Project Explorer as well as in Package Explorer. Hence I tried using "org.eclipse.ui.decorators" by giving it as given below.
<extension point="org.eclipse.ui.decorators">
<decorator
id="sample.ui.editor.DemoDecorator"
label="Sample Decorator"
state="true"
class= "sample.ui.editor.DemoDecorator"
adaptable="true">
<enablement>
<and>
<objectClass name="org.eclipse.core.resources.IFile"/>
<objectState
name="projectNature"
value="sample.core.nature">
</objectState>
</and>
</enablement>
</decorator>
</extension>
This is working though I am not sure whether this is the right method to do. Can we make the changes in ProjectExplorer and PackageExplorer using "org.eclipse.dltk.ui.modelLabelProvider" itself? This was how I gave the extension point.
<extension
point="org.eclipse.dltk.ui.modelLabelProvider">
<modelLabelProvider
class="sample.ui.editor.CELabelProvider"
id="sample.ui.SampleLabelProvider"
language="sample.core.nature">
</modelLabelProvider>
</extension>
Is there anything wrong in this?
Also, one more issue.. I am using setTitleImage as you suggested for changing the title image. But here, I am getting one issue. If I am closing eclipse without closing all my files, next time, when I open, correct title image will be set only for the file which has focus. For rest of the opened files, it will be displaying the default image. I know that this is because we are setting the title image from editor. Only when the files get focus, their title image will get updated. Is there any way to solve this?
Thanks in advance,
Daisy.
|
|
|
Re: Help required on setting editor icon from code [message #637112 is a reply to message #636905] |
Thu, 04 November 2010 09:02 |
David Largeteau Messages: 35 Registered: July 2009 Location: Bordeaux - France |
Member |
|
|
daisydale85@yahoo.com a écrit :
> Hi David,
>
> I was able to change the icons in "Script Explorer" using
> "org.eclipse.dltk.ui.modelLabelProvider". But it was not getting
> reflected in Project Explorer as well as in Package Explorer. Hence I
> tried using "org.eclipse.ui.decorators" by giving it as given below.
>
> <extension point="org.eclipse.ui.decorators"> <decorator
> id="sample.ui.editor.DemoDecorator" label="Sample Decorator"
> state="true" class=
> "sample.ui.editor.DemoDecorator" adaptable="true">
> <enablement>
> <and>
> <objectClass name="org.eclipse.core.resources.IFile"/>
> <objectState
> name="projectNature"
> value="sample.core.nature">
> </objectState>
> </and>
> </enablement> </decorator> </extension>
>
> This is working though I am not sure whether this is the right method to
> do. Can we make the changes in ProjectExplorer and PackageExplorer using
> "org.eclipse.dltk.ui.modelLabelProvider" itself? This was how I gave the
> extension point.
> <extension
> point="org.eclipse.dltk.ui.modelLabelProvider">
> <modelLabelProvider
> class="sample.ui.editor.CELabelProvider"
> id="sample.ui.SampleLabelProvider"
> language="sample.core.nature">
> </modelLabelProvider>
> </extension>
>
> Is there anything wrong in this?
>
> Also, one more issue.. I am using setTitleImage as you suggested for
> changing the title image. But here, I am getting one issue. If I am
> closing eclipse without closing all my files, next time, when I open,
> correct title image will be set only for the file which has focus. For
> rest of the opened files, it will be displaying the default image. I
> know that this is because we are setting the title image from editor.
> Only when the files get focus, their title image will get updated. Is
> there any way to solve this?
>
> Thanks in advance,
> Daisy.
Hi Daisy,
I just noticed that I have the same problems :-(
I will see what I can do to solve them.
David
|
|
|
|
Re: Help required on setting editor icon from code [message #640190 is a reply to message #637158] |
Fri, 19 November 2010 13:23 |
David Largeteau Messages: 35 Registered: July 2009 Location: Bordeaux - France |
Member |
|
|
daisydale85@yahoo.com a écrit :
> Hi David,
>
> I was able to update the icons in PackageExplorer view and
> ProjectExplorer view using "org.eclipse.ui.decorators" and it is working
> though I am not sure whether it is a good method.
>
> Following items are also there in my wishlist
> 1) See how title image can be set from some other place other than editor.
> 2) Remove icon set for the editor's name given in "Open With" option (I
> want the entry similar to that of the "Default Editor" option, i.e,
> without icon.)
> 3) Remove icon of my custom editor associated with the file extension in
> "Window"->"Preferences"->"General"->"Editors"->"File Associations"
>
> Will keep posted if there is any progress..
>
> Thanks, Daisy.
Hi Daisy,
I have solved my problems by adding as many org.eclipse.ui.editors
extension points as different extension I want to manage, and put the
right image in the extension point definition.
Probably not required for you, but I also :
- have modified my script editor class to be an abstract class (I don't
want it to be used directly).
- have added editor classes that extend the abstract editor class above.
In these classes, I have put a method returning specific editor image
(called from abstract editor), and other specific stuff.
That's work fine, both with unopened editor (tabbed), and in package
explorer (and in navigator view).
David
|
|
|
|
Powered by
FUDForum. Page generated in 0.05420 seconds