Home » Eclipse Projects » Eclipse Platform » How to override the initial input of the CommonNavigator
How to override the initial input of the CommonNavigator [message #331350] |
Wed, 03 September 2008 03:07 |
yau Messages: 14 Registered: July 2009 |
Junior Member |
|
|
Hi,
My project have 2 views, one is the resource navigator, another is a custom
common navigator used to show mail account and it's folders in tree
structure just like Outlook Express or other mail clients. The later view I
called "Mails navigator".
Because the above 2 common navigators use 2 different input, one is
IWorkspaceRoot, another is an IMailRepository(an Interface defined in my
model package), so, I make an subclass from CommonNavigator to override the
initial input and return an IMailRepository object. I use this class as the
contentProvider of navigatorContent extension of the "Mails navigator" view,
and use the CommonNavigator class for the "Resource Navigator" view just
like standard way. But the CommonNavigator API document said: "This class is
not intended to be subclassed by clients. ". So, I think, the subclass is
not the right way for resolve this issue. This is my first question: How to
override the initial input of the CommonNavigator?
The second question. When I make the subclass, done as above, and run the
application. Everything are look likes OK, expect for one thing: When I move
the mouse on to the tab title of the "Mails Navigator" view, a tooltip with
an error message was shew: "Error: no label provider for
cn.com.dwservice.mail.impl_fs.MailRepositoryImpl@14fcd9a". I known,
"MailRepositoryImpl" just the class of the result value returned by
MailNavigator.getInitialInput(). But I dont known why it said "no label
provider", I have been specified the labelProvider, and at the runtime, the
navigator treeview shows the treeNode's label correcttly. Why?
Thanks,
----
Yau K.J.
|
|
|
Re: How to override the initial input of the CommonNavigator [message #331351 is a reply to message #331350] |
Wed, 03 September 2008 08:07 |
Francis Upton IV Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
Yau K.J. wrote:
> Hi,
>
> My project have 2 views, one is the resource navigator, another is a custom
> common navigator used to show mail account and it's folders in tree
> structure just like Outlook Express or other mail clients. The later view I
> called "Mails navigator".
>
> Because the above 2 common navigators use 2 different input, one is
> IWorkspaceRoot, another is an IMailRepository(an Interface defined in my
> model package), so, I make an subclass from CommonNavigator to override the
> initial input and return an IMailRepository object. I use this class as the
> contentProvider of navigatorContent extension of the "Mails navigator" view,
> and use the CommonNavigator class for the "Resource Navigator" view just
> like standard way. But the CommonNavigator API document said: "This class is
> not intended to be subclassed by clients. ". So, I think, the subclass is
> not the right way for resolve this issue. This is my first question: How to
> override the initial input of the CommonNavigator?
The way you did it is the only way you can at the moment. This bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=145233
addresses the issue. Look for it to be fixed in 3.5M2 or M3.
>
>
> The second question. When I make the subclass, done as above, and run the
> application. Everything are look likes OK, expect for one thing: When I move
> the mouse on to the tab title of the "Mails Navigator" view, a tooltip with
> an error message was shew: "Error: no label provider for
> cn.com.dwservice.mail.impl_fs.MailRepositoryImpl@14fcd9a". I known,
> "MailRepositoryImpl" just the class of the result value returned by
> MailNavigator.getInitialInput(). But I dont known why it said "no label
> provider", I have been specified the labelProvider, and at the runtime, the
> navigator treeview shows the treeNode's label correcttly. Why?
Are you using working sets? If so, it's likely that it's this problem:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=239465
If you are not using working sets, please file a bug against
Eclipse/Platform UI.
http://wiki.eclipse.org/Platform_UI/FAQ#How_do_I_report_a_bu g.3F
>
> Thanks,
>
> ----
> Yau K.J.
>
>
--
*new* Common Navigator Framework section in:
3.4RC4 Platform Plugin Developer Guide (Programmer's Guide)
http://help.eclipse.org/ganymede/topic/org.eclipse.platform. doc.isv/guide/cnf.htm
http://dev.eclipse.org/blogs/francis
http://wiki.eclipse.org/Common_Navigator_Framework
http://wiki.eclipse.org/Common_Navigator_Framework_Use_Cases
You have brains in your head.
You have feet in your shoes.
- Dr Seuss, Oh the Places You'll Go
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
| |
Goto Forum:
Current Time: Sun Nov 17 21:23:48 GMT 2024
Powered by FUDForum. Page generated in 0.03078 seconds
|