Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Hook custom tree outline to package explorer
Hook custom tree outline to package explorer [message #252439] Fri, 04 April 2008 12:28 Go to next message
Gerrit  is currently offline Gerrit Friend
Messages: 30
Registered: July 2009
Member
Hello, I'd like to make a custom tree outline for XML files appear in the
package explorer for each file, just like the Java outline does for Java
files.

So far, I've used the "org.eclipse.ui.navigator.navigatorContent"
extension point, providing an ITreeContentProvider and an ILabelProvider.
The tree appears, but it doesn't reflect any changes in the file, not even
when I refresh the view.


I have the feeling that these providers are not enough, and am searching
for the minimal set of classes that implement the desired functionality in
JDT. However, as the project is rather big, I'm somewhat lost. Can someone
give me a good starting point?


Generally, I'd guess that the concept of reusing a TreeViewer based
ContentOutlinePage in the package explorer (and have these explorer views
interact with each respective file as outlines would) might be a huge
value-add for many projects. Is there a standard way to achieve this, or
maybe a detailed tutorial?


Thanks in advance!
Gerrit
Re: Hook custom tree outline to package explorer [message #252450 is a reply to message #252439] Mon, 07 April 2008 08:02 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Gerrit wrote:
> Hello, I'd like to make a custom tree outline for XML files appear in
> the package explorer for each file, just like the Java outline does
> for Java files.
I assume you are talking about the Project Explorer (aka Common
Navigator) and not the Package Explorer which can't be extended like this.

Dani
>
> So far, I've used the "org.eclipse.ui.navigator.navigatorContent"
> extension point, providing an ITreeContentProvider and an
> ILabelProvider. The tree appears, but it doesn't reflect any changes
> in the file, not even when I refresh the view.
>
>
> I have the feeling that these providers are not enough, and am
> searching for the minimal set of classes that implement the desired
> functionality in JDT. However, as the project is rather big, I'm
> somewhat lost. Can someone give me a good starting point?
>
>
> Generally, I'd guess that the concept of reusing a TreeViewer based
> ContentOutlinePage in the package explorer (and have these explorer
> views interact with each respective file as outlines would) might be a
> huge value-add for many projects. Is there a standard way to achieve
> this, or maybe a detailed tutorial?
>
>
> Thanks in advance!
> Gerrit
>
>
Re: Hook custom tree outline to package explorer [message #252460 is a reply to message #252450] Mon, 07 April 2008 08:40 Go to previous messageGo to next message
Gerrit  is currently offline Gerrit Friend
Messages: 30
Registered: July 2009
Member
>> Hello, I'd like to make a custom tree outline for XML files appear in
>> the package explorer for each file, just like the Java outline does
>> for Java files.
> I assume you are talking about the Project Explorer (aka Common
> Navigator) and not the Package Explorer which can't be extended like this.

Yes, sorry. It's probably the Project Explorer, I was confusing the two.
Can I extend the Project Explorer / Common Navigator in the described
fashion?


>> So far, I've used the "org.eclipse.ui.navigator.navigatorContent"
>> extension point, providing an ITreeContentProvider and an
>> ILabelProvider. The tree appears, but it doesn't reflect any changes
>> in the file, not even when I refresh the view.

Even in the Project Explorer, Java elements are updated in the tree, as
soon as they are changed in a Java editor, and on saving the file even
from a normal text editor. How is this done, i.e. which extension points
have to be used?


Thanks for your help!
Gerrit
Re: Hook custom tree outline to package explorer [message #252464 is a reply to message #252460] Mon, 07 April 2008 14:08 Go to previous message
Gerrit  is currently offline Gerrit Friend
Messages: 30
Registered: July 2009
Member
>> I assume you are talking about the Project Explorer (aka Common
>> Navigator) and not the Package Explorer which can't be extended like this.

Thanks to your introduction to the name "Common Navigator", I was now able
to find these blog postings to the org.eclipse.ui.examples.navigator
example, which is pretty much the minimal setup I was looking for:

http://richclientplatform.blogspot.com/2007/06/common-naviga tor-framework.html


> So far, I've used the "org.eclipse.ui.navigator.navigatorContent"
> extension point, providing an ITreeContentProvider and an
> ILabelProvider. The tree appears, but it doesn't reflect any changes
> in the file, not even when I refresh the view.

The solution found in the sample code is to add an IResourceChangeListener
to the Workspace in the constructor of the ITreeContentProvider. No
extension point mechanisms are used for this.

Many thanks!
Gerrit
Previous Topic:How to switch off "deep" error decorations in PE?
Next Topic:How to looking into project's Java code
Goto Forum:
  


Current Time: Sun Sep 01 12:17:43 GMT 2024

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

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

Back to the top