Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
yau is currently offline yauFriend
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 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IVFriend
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


Re: How to override the initial input of the CommonNavigator [message #331377 is a reply to message #331351] Thu, 04 September 2008 02:55 Go to previous message
yau is currently offline yauFriend
Messages: 14
Registered: July 2009
Junior Member
Hi Francis Upton,

Thank you very much!

I am not using worksets. The fact is the second problem is my fault. I just
traced into the
org.eclipse.ui.internal.navigator.NavigatorContentServiceLab elProvider.getStyledText(),
then I found, I have not returned the text for the IMailRepository object
in my label provider's getStyledText() method, this cause the
NavigatorContentServiceLabelProvider return the error message.

Haha, my problem was resolved, Thank you again!

----
Yau K.J.
Previous Topic:Unable to find plug-in: org.eclipse.equinox.launcher.motif.solaris.sparc_1.0.100.HEAD
Next Topic:Update manager from command line
Goto Forum:
  


Current Time: Fri Jul 19 12:19:47 GMT 2024

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

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

Back to the top