Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Creating a new customized Outline-View
Creating a new customized Outline-View [message #550691] Wed, 04 August 2010 07:21 Go to next message
Jochen Huck is currently offline Jochen HuckFriend
Messages: 8
Registered: August 2010
Junior Member
Hi,

I want to create a new view that is very similar to the current Outline-View. The new Outline-View has to list some special contents of a CompilationUnit. I want the view to be updated if the current CompilationUnit in the JavaEditor is changed or exchanged by changing the current editor tab.
How can I do that? I searched through the JavaEditor code and recognized that a JavaOutlinePage is created by the JavaEditor. So I will have to subclass JavaEditor and rewrite some Methods that the Editor is able to create the new Outline-Page. How can I tell the Plugin to use the new JavaEditor?

I hope that I could explain what I want to do.
Thanks in advance.

Jochen
Re: Creating a new customized Outline-View [message #550727 is a reply to message #550691] Wed, 04 August 2010 07:38 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Jochen Huck wrote:
> Hi,
>
> I want to create a new view that is very similar to the current
> Outline-View. The new Outline-View has to list some special contents
> of a CompilationUnit. I want the view to be updated if the current
> CompilationUnit in the JavaEditor is changed or exchanged by changing
> the current editor tab.
> How can I do that? I searched through the JavaEditor code and
> recognized that a JavaOutlinePage is created by the JavaEditor. So I
> will have to subclass JavaEditor and rewrite some Methods that the
> Editor is able to create the new Outline-Page.
You don't need to subclass JavaEditor. You can update your view (input)
via part listener and listen for changes to the CU using an
org.eclipse.jdt.core.IElementChangedListener.

Dani
> How can I tell the Plugin to use the new JavaEditor?
>
> I hope that I could explain what I want to do.
> Thanks in advance.
>
> Jochen
Re: Creating a new customized Outline-View [message #550998 is a reply to message #550727] Wed, 04 August 2010 19:17 Go to previous messageGo to next message
Jochen Huck is currently offline Jochen HuckFriend
Messages: 8
Registered: August 2010
Junior Member
Thanks for your reply. I think this will solve the problem with updating the input for my view.
But I'd like to have another nice feature that the Outline-View offers. You can doubleclick on an element from the Outline-View and the JavaEditor automatically highlights the appropriate source code. It would also be nice to have this feature the other way around. Is something like that possible? Or will I have to create my own editor to do things like that?

Thanks again.

Jochen
Re: Creating a new customized Outline-View [message #551070 is a reply to message #550998] Thu, 05 August 2010 05:59 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Jochen Huck wrote:
> Thanks for your reply. I think this will solve the problem with
> updating the input for my view.
> But I'd like to have another nice feature that the Outline-View
> offers. You can doubleclick on an element from the Outline-View and
> the JavaEditor automatically highlights the appropriate source code.
> It would also be nice to have this feature the other way around. Is
> something like that possible? Or will I have to create my own editor
> to do things like that?
@see ITextEditor#setHighlightRange(int, int, boolean)
@see ITextEditor#showHighlightRangeOnly(boolean)

Dani
>
> Thanks again.
>
> Jochen
Re: Creating a new customized Outline-View [message #551344 is a reply to message #551070] Fri, 06 August 2010 05:52 Go to previous message
Jochen Huck is currently offline Jochen HuckFriend
Messages: 8
Registered: August 2010
Junior Member
Thanks again for your help.

For everyone who is interested:
I solved the problem of refreshing my views input after a change in the java editor. A very good link is: http://pookzilla.net/wp/2006/10/link-to-editor/
Previous Topic:need a good way for calculating composite's size with a text widget inside
Next Topic:Name clash error appears after migrating to Helios
Goto Forum:
  


Current Time: Tue Sep 24 07:40:17 GMT 2024

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

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

Back to the top