Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Icons of Outline-view (Are gone when I deploy )
Icons of Outline-view [message #781283] Fri, 20 January 2012 22:25 Go to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
I have a plugin where I've created a customized Outline-view, with different icons/bmp's voor each type of entry in the Outline.

When I run the plugin when I'm developing it, then the Outline-view is shown with the icons (see attached "Outline with icons.jpg").
However, when I make a Jar of the plugin, and drop it in the dropins-directory of a clean installed Eclipse (Helios), run Eclipse, the icons are not shown (instead a red square appears, see the "Outline with lost icons.jpg" attached). The icon's are included in the bin (when making the Jar)

Does anybody know what I do wrong ?
Re: Icons of Outline-view [message #782077 is a reply to message #781283] Mon, 23 January 2012 05:17 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4430
Registered: July 2009
Senior Member

Check the mechanism you're using to load those images. Are you sure it still works when everything's in a .jar?

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Icons of Outline-view [message #782250 is a reply to message #782077] Mon, 23 January 2012 12:12 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Nitin Dahyabhai wrote on Mon, 23 January 2012 00:17
Check the mechanism you're using to load those images.


Nitin, thanks for you reply.
The mechanism to load the images is :
private final Image fSubProgramIdIcon= createImage("programid.bmp");

Nitin Dahyabhai wrote on Mon, 23 January 2012 00:17
Are you sure it still works when everything's in a .jar?


It DOESN'T work when it's in a jar. When developing I see the icons in the Outline-view. When deployed, via a .jar, the icons are NOT shown in the Outline-view !! (Instead a small red square is shown).
Re: Icons of Outline-view [message #782270 is a reply to message #782077] Mon, 23 January 2012 12:41 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Nitin Dahyabhai wrote on Mon, 23 January 2012 00:17
Check the mechanism you're using to load those images. Are you sure it still works when everything's in a .jar?


My previous post was not complete. Below is the mechanism how the image is loaded. It works when developing the plugin. When deployed via a .jar the icons are not shown (instead a small red square is shown) and no messagebox is coming.

private static URL fgIconBaseURL= HPNSEditorPlugin.getDefault().getBundle().getEntry("/icons/");
private final Image fSectionIcon= createImage("section.gif");

public static Image createImage(String icon) {
try {
ImageDescriptor id= ImageDescriptor.createFromURL(new URL(fgIconBaseURL, icon));
return id.createImage();
} catch (MalformedURLException e) {
SUPFunctions prvFunctions = new SUPFunctions();
prvFunctions.MSGBOX ("no icon 1");
}
return null;
}


Re: Icons of Outline-view [message #782815 is a reply to message #782270] Tue, 24 January 2012 14:05 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 23.01.2012 13:41, Kitesurfer Mising name wrote:
> Nitin Dahyabhai wrote on Mon, 23 January 2012 00:17
>> Check the mechanism you're using to load those images. Are you sure
>> it still works when everything's in a .jar?
>
>
> My previous post was not complete. Below is the mechanism how the
> image is loaded. It works when developing the plugin. When deployed
> via a .jar the icons are not shown (instead a small red square is
> shown) and no messagebox is coming.
>
> private static URL fgIconBaseURL=
> HPNSEditorPlugin.getDefault().getBundle().getEntry("/icons/");
> private final Image fSectionIcon= createImage("section.gif");
>
> public static Image createImage(String icon) {
> try {
> ImageDescriptor id= ImageDescriptor.createFromURL(new
> URL(fgIconBaseURL, icon));
> return id.createImage();
> } catch (MalformedURLException e) {
> SUPFunctions prvFunctions = new SUPFunctions();
> prvFunctions.MSGBOX ("no icon 1");
> } return null;
> }
>
If you use the Eclipse/bundle mechanism to load the images, then they
have to be at the same location as in the source and not inside 'bin'.
If your build.properties is correct then the 'Deployable Plug-ins and
fragments' export wizard should do this correctly.

Dani
>
>
Re: Icons of Outline-view [message #782975 is a reply to message #782815] Tue, 24 January 2012 21:14 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Thanks for you reply Dani.

My build.properties look like this :
source.recipeeditor.jar = src/
output.recipeeditor.jar = bin/
bin.includes = plugin.xml,\
recipeeditor.jar,\
icons/
src.includes = icons/

Is this the line what you mean ?

Suppose I would place all my icons manually somewhere inside the directory on C where I installed Eclipse, where would I have to put them to get it working ?
Re: Icons of Outline-view [message #783318 is a reply to message #782815] Wed, 25 January 2012 13:47 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Hi Dani,

I found what is the cause. When developing a plugin the name of the icon in the sourcecode, in my case "section.gif", and the name of the icon in the icon-folder of the project, in my case "SECTION.gif", are case-insensitive.

When deploying the plugin via a .tar file suddenly it becomes case-sensitive !! ... when I change the sourcecode to "SECTION.gif" it all works, also when deployed.

This might be a "bug" in Eclipse.

So far for this problem. The other one, regarding the Outline-view, is that when I have a an Outline-view with a lot of items ... I scroll to the below part of the Outline-view ... click on the last item of the Outline-view (resulting that the editor goes to the end of my sourcecode) ... I alter something in the sourcecode ... then Outline-view suddenly "jumps" to the top !!
What I'd want is that the Outline of my extension(plugin) works just like the Outline of java. With java the Outline is positioned on the same item as where I am in the sourcecode.
Do you, or anyone, know how to do this ?

Thanks.
Hans
Re: Icons of Outline-view [message #787338 is a reply to message #783318] Tue, 31 January 2012 13:21 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 25.01.2012 14:47, Kitesurfer Mising name wrote:
> Hi Dani,
>
> I found what is the cause. When developing a plugin the name of the
> icon in the sourcecode, in my case "section.gif", and the name of the
> icon in the icon-folder of the project, in my case "SECTION.gif", are
> case-insensitive.
>
> When deploying the plugin via a .tar file suddenly it becomes
> case-sensitive !! ... when I change the sourcecode to "SECTION.gif" it
> all works, also when deployed.
>
> This might be a "bug" in Eclipse.
>
> So far for this problem. The other one, regarding the Outline-view, is
> that when I have a an Outline-view with a lot of items ... I scroll to
> the below part of the Outline-view ... click on the last item of the
> Outline-view (resulting that the editor goes to the end of my
> sourcecode) ... I alter something in the sourcecode ... then
> Outline-view suddenly "jumps" to the top !! What I'd want is that the
> Outline of my extension(plugin) works just like the Outline of java.
> With java the Outline is positioned on the same item as where I am in
> the sourcecode.
> Do you, or anyone, know how to do this ?
I guess you populate the Outline page with new input when the source
changes. If you only add and remove the children then the selection
should stay unless of course you change (e.g. rename) the selected element.

Dani
>
> Thanks.
> Hans
Previous Topic:Opening a non-UTF-8 encoded text file?
Next Topic:Opening *any* file(CSV, SQL, unknown script file) in Eclipse?
Goto Forum:
  


Current Time: Thu Mar 28 19:37:39 GMT 2024

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

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

Back to the top