|
Re: ViewPart title image [message #723312 is a reply to message #723299] |
Thu, 08 September 2011 10: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 #723350 is a reply to message #723334] |
Thu, 08 September 2011 11:30 |
Eclipse User |
|
|
|
Originally posted by:
On 2011-09-08 13:12, Janusz Dalecki wrote:
> Hi Daniel,
> Yep, your description of my problem is better than mine. Thanks for that.
> So you don't think that I can force Eclipse to ask my non-foreground tab
> (not created yet view) to create it and then ask it for the title image?
Not really, unless you are willing to dig deep into the presentation API
of Eclipse (and I haven't done that before).
> Can you think of any other ways in which I can fix my problem?
Have you considered to make these views different extensions? You could
provide a single view part definition that contains all the
implementation you currently have inside your view (but don't register
this class via the view extension point), then derive all those with
different images from this view part and register these via the
org.eclipse.ui.views extension point.
HTH & Greetings from Bremen,
Daniel Krügler
|
|
|
|
Powered by
FUDForum. Page generated in 0.03493 seconds