Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Dynamically open a view and an editor
Dynamically open a view and an editor [message #326180] Mon, 10 March 2008 14:57 Go to next message
Eclipse UserFriend
Originally posted by: naddeo.marco.educ.di.unito.it

Hi,

I need to open, dynamically from my Java code, a view that I have defined
in my plug-in. Could someone please show me the way or API that I can call
to accomplish that?

Besides, I need to open, also dynamically from my Java code, a Java file
(a compilation unit) in the editor, precisely in the point of a certain
method (I use in my plug-in the ASTParser and then I have the pointer to
the ASTNode, of MethodDeclaration type, corresponding to the method on
which I want to open the editor). Could you help me?


Thanks
MN
Re: Dynamically open a view and an editor [message #326183 is a reply to message #326180] Mon, 10 March 2008 16:45 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

For showing the view, there's org.eclipse.ui.IWorkbenchPage.showView(String)

For showing an normal editor, there's
org.eclipse.ui.IWorkbenchPage.openEditor(IEditorInput, String) or many
openEditor(*) methods on org.eclipse.ui.ide.IDE You can use openEditor
with an IFile to open the editor, but then you would have to use some
API on that editor to set the cursor to the correct position.

PW




--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:Outline View
Next Topic:StructuredTextEditor hide some contents
Goto Forum:
  


Current Time: Thu Jun 27 20:42:53 GMT 2024

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

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

Back to the top