Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » refresh/update java editor programmatically before jumping to java element
refresh/update java editor programmatically before jumping to java element [message #1060389] Fri, 24 May 2013 12:27 Go to next message
deflow Mising name is currently offline deflow Mising name
Messages: 3
Registered: October 2009
Junior Member
hi all!

i'm struggling with a little issue, which i'm not able to fix Sad
may you can help me with this?

here we go:
the only thing i'm trying to do is to open a compilation unit in a java editor an jumping to a specific position (e.g. method xyz()). usually, the method xyz() is going to be created programmatically, just before the jump action.

this all works fine, except for one case:
if the compilation unit is aldready opened in an editor and i'm trying to jump to the "new generated" method xyz(), i'm ending up on a wrong position in editor.

With the following code i'm able to overcome this problem. however i can't imagine that's the way i'm supposed to do it...

IEditorPart javaEditor = JavaUI.openInEditor(element);	
[color=red]javaEditor.doSave(null);[/color]
JavaUI.revealInEditor(javaEditor, element);


is there a way to update or refresh the editor before i execute my jump action?

thx in advance

[Updated on: Fri, 24 May 2013 12:28]

Report message to a moderator

Re: refresh/update java editor programmatically before jumping to java element [message #1060448 is a reply to message #1060389] Fri, 24 May 2013 17:02 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 1007
Registered: July 2009
Senior Member
Showing the part concerning the editor is only half the story:
How do you create the method? Using a DOM rewriter? By modifying the buffer, the file?
Any working copies involved? Do you reconcile them after modification?
Re: refresh/update java editor programmatically before jumping to java element [message #1067331 is a reply to message #1060448] Mon, 08 July 2013 10:33 Go to previous message
ag hathal is currently offline ag hathal
Messages: 1
Registered: July 2013
Junior Member
Hi,

I am new for creating Java Editor.
Please Help or provide any metrial.
Also I am not able to create instance of ICompilationUnit and IJavaElement.
Thanks in advance.
Previous Topic:JSP Tag code complete
Next Topic:Plugin - save participant project save
Goto Forum:
  


Current Time: Mon Sep 22 04:36:35 GMT 2014

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

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