Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Updating The Outline View
Updating The Outline View [message #44787] Fri, 30 May 2003 10:42 Go to next message
Eclipse UserFriend
Originally posted by: Danny.Collins.libertymutual.com

Hello,

I am working on a plugin that alters the source file for a java class.
Inserting methods, reorganizing methods and fields, etc. I am having
trouble getting the Outline View to sync up with the actual source.
Especially when reordering the methods.


Thank you,
Danny
Re: Updating The Outline View [message #46586 is a reply to message #44787] Mon, 02 June 2003 07:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Danny.Collins.libertymutual.com

Danny Collins wrote:

> Hello,

> I am working on a plugin that alters the source file for a java class.
> Inserting methods, reorganizing methods and fields, etc. I am having
> trouble getting the Outline View to sync up with the actual source.
> Especially when reordering the methods.


> Thank you,
> Danny


Maybe it would help if I actually asked a question ;)

What I am looking for is a way to programatically update the outline
associated with the Java Editor. Anyone out there have any experience with
this? I already searched throught the archives and couldn't come up with
anything.

TIA
Danny
Re: Updating The Outline View [message #46632 is a reply to message #46586] Mon, 02 June 2003 08:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adam_kiezun.ch.ibm.spam.protection.com

the outline works on working copies
if you modify java files, then you will need to reconcile the working copy with the file
try calling IWorkingCopy::reconcile()

a.
eclipse.org
Re: Updating The Outline View [message #47008 is a reply to message #46632] Mon, 02 June 2003 21:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Danny.Collins.libertymutual.com

Adam Kiezun wrote:

> the outline works on working copies
> if you modify java files, then you will need to reconcile the working copy
with the file
> try calling IWorkingCopy::reconcile()

> a.
> eclipse.org


I tried that didn't seem to work, but I may not have the 'correct' working
copy,

Here is a snippet, the editor is gotten because I am an editor context
menu item.

ICompilationUnit icu =

JavaUI.getWorkingCopyManager().getWorkingCopy(editor.getEdit orInput());

// manipulate the compilation unit

icu.reconcile(true,null);

// this doesn't seem to update the outline view, but the outline still
works, so if I move a method from the top to the bottom of the source, the
outline stays the same but it will go to the correct place in the source
if double clicked.

Thansk for the help!
Danny
Re: Updating The Outline View [message #47283 is a reply to message #47008] Tue, 03 June 2003 08:53 Go to previous messageGo to next message
Eclipse UserFriend
That looks ok. Can you try to only add a method and see if this works.
Could be that a move does not generate a delta (what would be a bug)

Note that the outliner updates in a background thread, so there should
be no need to call reconcile to update the viewer.

Danny Collins wrote:
> Adam Kiezun wrote:
>
>
>>the outline works on working copies
>>if you modify java files, then you will need to reconcile the working copy
>
> with the file
>
>>try calling IWorkingCopy::reconcile()
>
>
>>a.
>>eclipse.org
>
>
>
> I tried that didn't seem to work, but I may not have the 'correct' working
> copy,
>
> Here is a snippet, the editor is gotten because I am an editor context
> menu item.
>
> ICompilationUnit icu =
>
> JavaUI.getWorkingCopyManager().getWorkingCopy(editor.getEdit orInput());
>
> // manipulate the compilation unit
>
> icu.reconcile(true,null);
>
> // this doesn't seem to update the outline view, but the outline still
> works, so if I move a method from the top to the bottom of the source, the
> outline stays the same but it will go to the correct place in the source
> if double clicked.
>
> Thansk for the help!
> Danny
>
>
>
Re: Updating The Outline View [message #49536 is a reply to message #47283] Wed, 04 June 2003 21:38 Go to previous message
Eclipse UserFriend
Originally posted by: danny.collins.libertymutual.com

OK, tried that, added a new method. It showed up in the Outline view, but
when I reorganized the rest of the source the outline view didn't change.
Although I am using eclispe 2.0 not 2.1 .

The only thing that seems to catch the outline up to the current source is
closing and reopening the file.

TIA.
Martin Aeschlimann wrote:

> That looks ok. Can you try to only add a method and see if this works.
> Could be that a move does not generate a delta (what would be a bug)

> Note that the outliner updates in a background thread, so there should
> be no need to call reconcile to update the viewer.

> Danny Collins wrote:
> > Adam Kiezun wrote:
> >
> >
> >>the outline works on working copies
> >>if you modify java files, then you will need to reconcile the working copy
> >
> > with the file
> >
> >>try calling IWorkingCopy::reconcile()
> >
> >
> >>a.
> >>eclipse.org
> >
> >
> >
> > I tried that didn't seem to work, but I may not have the 'correct' working
> > copy,
> >
> > Here is a snippet, the editor is gotten because I am an editor context
> > menu item.
> >
> > ICompilationUnit icu =
> >
> > JavaUI.getWorkingCopyManager().getWorkingCopy(editor.getEdit orInput());
> >
> > // manipulate the compilation unit
> >
> > icu.reconcile(true,null);
> >
> > // this doesn't seem to update the outline view, but the outline still
> > works, so if I move a method from the top to the bottom of the source, the
> > outline stays the same but it will go to the correct place in the source
> > if double clicked.
> >
> > Thansk for the help!
> > Danny
> >
> >
> >
Previous Topic:code assistant / imports / documentation
Next Topic:Source not found when debugging with attached source in 2.1?
Goto Forum:
  


Current Time: Wed Jul 16 01:08:02 EDT 2025

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

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

Back to the top