ViewPart title image [message #723299] |
Thu, 08 September 2011 05:22  |
Eclipse User |
|
|
|
I have a perspective with a few ViewPart objects of the same class (let's say IncidentView). However IncidentView objects in my case might internally of two types (let's say Accident or Fault) for which I am using different title image (displayed as an icon in the tab). If I run my Eclipse based workbench and create new IncidentVews of both types (Accident or Fault), all of them have the correct image. If I than quit the workbench and restart it only the IncidentView that was selected when I closed the workbench has the correct image, all the other IncidentViews have some default images. I debugged the application and found that Eclipse asks my IncidentView for a title image only if it is selected in the perspective (as a tab), for all the others it is using default images. Can I somehow force Eclipse to ask every instance of the IncidentView for its image?
|
|
|
Re: ViewPart title image [message #723312 is a reply to message #723299] |
Thu, 08 September 2011 06:00   |
Eclipse User |
|
|
|
Originally posted by:
On 2011-09-08 11:22, Janusz Dalecki wrote:
> I have a perspective with a few ViewPart objects of the same class
> (let's say IncidentView). However IncidentView objects in my case might
> internally of two types (let's say Accident or Fault) for which I am
> using different title image (displayed as an icon in the tab). If I run
> my Eclipse based workbench and create new IncidentVews of both types
> (Accident or Fault), all of them have the correct image. If I than quit
> the workbench and restart it only the IncidentView that was selected
> when I closed the workbench has the correct image, all the other
> IncidentViews have some default images. I debugged the application and
> found that Eclipse asks my IncidentView for a title image only if it is
> selected in the perspective (as a tab), for all the others it is using
> default images. Can I somehow force Eclipse to ask every instance of the
> IncidentView for its image?
Let my try to describe whether I understood your scenario correctly:
You are using a single view part definition to create several instances
of that view, which have individual images. Since you cannot set these
during plugin definition time within the the org.eclipse.ui.views
extension point, you are assigning the images during runtime
programmatically. Is this correct? If so, I doubt that you will have
success, because all views, that are still in the non-foreground tabs,
won't be created, thus the shown information is that based on the
extension point definition.
HTH & Greetings from Bremen,
Daniel Krügler
|
|
|
|
|
Re: ViewPart title image [message #723610 is a reply to message #723350] |
Thu, 08 September 2011 20:14  |
Eclipse User |
|
|
|
Unfortunately the sub-type of the view is decided after the view is created not before when I could decide which sub-type to create so after sub-type is chosen by user I would have to delete the current view (if the one created is not of the correct sub-type and create new one) it is possible but bit messy I guess.
Thanks for you help,
Regards,
Janusz
|
|
|
Powered by
FUDForum. Page generated in 0.03470 seconds