Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » fragment.e4xmi perspective does not show specified icon
fragment.e4xmi perspective does not show specified icon [message #1091563] Wed, 21 August 2013 17:05 Go to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi,

I am using eclipse 4.2 as RCP and defined a perspective in a fragment.e4xmi. All works well except
the defined icon is not shown but the default icon.

Is there any restriction of size or icon type?
I am using a 16px by 16px png file.

Any other idea how to get this right?

thanks in advance, Martin
Re: fragment.e4xmi perspective does not show specified icon [message #1245536 is a reply to message #1091563] Thu, 13 February 2014 23:57 Go to previous messageGo to next message
Ed Yarve is currently offline Ed YarveFriend
Messages: 2
Registered: June 2010
Junior Member
Hi Martin,

I am experiencing similar problem in Eclipse 4.3.1. The icon in my defined perspective always shows as a default icon. The same plug-in in Eclipse 3.7 shows the customized icon correctly.

I tried to reproduce this problem in a simple plug-in, but it works correctly.

Can you please let me know, if you were able to find a solution for this problem?

Thank you,
Ed
Re: fragment.e4xmi perspective does not show specified icon [message #1250305 is a reply to message #1245536] Wed, 19 February 2014 05:25 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi Ed,

no I did not find a solution. Its still displaying the default icon.

Would be interested if you can find some thing.

Martin

schrieb Ed Yarve, Am 14.02.2014 14:51:
> Hi Martin,
>
> I am experiencing similar problem in Eclipse 4.3.1. The icon in my defined perspective always shows
> as a default icon. The same plug-in in Eclipse 3.7 shows the customized icon correctly.
>
> I tried to reproduce this problem in a simple plug-in, but it works correctly.
>
> Can you please let me know, if you were able to find a solution for this problem?
>
> Thank you,
> Ed
>
Re: fragment.e4xmi perspective does not show specified icon [message #1251197 is a reply to message #1250305] Thu, 20 February 2014 01:41 Go to previous messageGo to next message
Ed Yarve is currently offline Ed YarveFriend
Messages: 2
Registered: June 2010
Junior Member
Thank you for the answer.

I decided to debug the internal Eclipse code which initializes the PerspectiveDescriptor from plug-in registry. I found that image is never populated in the descriptor. The initialization of the image is done while requesting the image by PerspectiveDescriptor.getImageDescriptor() method, when it called for the first time. This method uses IConfigurationElement.getNamespaceIdentifier() to find a plug-in to retrieve the icon from. In my case the returned identifier was not correct. If my plug-in was named "com.xyz.bugs.icon.myplugin", the returned identifier was only "com.xyz.bugs".

The following extension will show the default icon, instead of icons/sample.gif.

   <extension
         id="com.xyz.bugs.perspectives"
         name="xyz"
         point="org.eclipse.ui.perspectives">
      <perspective
            class="com.xyz.bugs.icon.PerspectiveFactory"
            icon="icons/sample.gif"
            id="com.xyz.bugs.icon.MyPerspective"
            name="xyz perspective">
      </perspective>
   </extension>


If the extension id would be "com.xyz.bugs.icon.perspectives" it would actually work fine, as it looks like Eclipse removes the last component "perspectives" and treats the rest as a plugin to retrieve the icon from. I did not find this in documentation, so i think it is a bug.

Another way to solve the issue is to remove id from the extension:

   <extension
         name="xyz"
         point="org.eclipse.ui.perspectives">
      <perspective
            class="com.xyz.bugs.icon.PerspectiveFactory"
            icon="icons/sample.gif"
            id="com.xyz.bugs.icon.MyPerspective"
            name="xyz perspective">
      </perspective>
   </extension>

I was also able to reproduce this on a sample plug-in, so I can actually file a bug.
Re: fragment.e4xmi perspective does not show specified icon [message #1263137 is a reply to message #1251197] Tue, 04 March 2014 08:08 Go to previous message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi Ed,

thanks for your investigations! I will try it in coming days and looking forward to fix this bug.

But for now I will try your workarounds, Martin

schrieb Ed Yarve, Am 20.02.2014 02:41:
> Thank you for the answer.
>
> I decided to debug the internal Eclipse code which initializes the PerspectiveDescriptor from
> plug-in registry. I found that image is never populated in the descriptor. The initialization of the
> image is done while requesting the image by PerspectiveDescriptor.getImageDescriptor() method, when
> it called for the first time. This method uses IConfigurationElement.getNamespaceIdentifier() to
> find a plug-in to retrieve the icon from. In my case the returned identifier was not correct. If my
> plug-in was named "com.xyz.bugs.icon.myplugin", the returned identifier was only "com.xyz.bugs".
>
> The following extension will show the default icon, instead of icons/sample.gif.
>
>
> <extension
> id="com.xyz.bugs.perspectives"
> name="xyz"
> point="org.eclipse.ui.perspectives">
> <perspective
> class="com.xyz.bugs.icon.PerspectiveFactory"
> icon="icons/sample.gif"
> id="com.xyz.bugs.icon.MyPerspective"
> name="xyz perspective">
> </perspective>
> </extension>
>
>
> If the extension id would be "com.xyz.bugs.icon.perspectives" it would actually work fine, as it
> looks like Eclipse removes the last component "perspectives" and treats the rest as a plugin to
> retrieve the icon from. I did not find this in documentation, so i think it is a bug.
>
> Another way to solve the issue is to remove id from the extension:
>
>
> <extension
> name="xyz"
> point="org.eclipse.ui.perspectives">
> <perspective
> class="com.xyz.bugs.icon.PerspectiveFactory"
> icon="icons/sample.gif"
> id="com.xyz.bugs.icon.MyPerspective"
> name="xyz perspective">
> </perspective>
> </extension>
>
> I was also able to reproduce this on a sample plug-in, so I can actually file a bug.
>
Previous Topic:How to interactively waiting for background jobs? [solved]
Next Topic:(eclipse rcp 3.x) No view-elements displayed when launching via .product
Goto Forum:
  


Current Time: Tue Apr 16 04:37:55 GMT 2024

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

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

Back to the top