Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Open a java-source file from a plugin?
Open a java-source file from a plugin? [message #756306] Fri, 11 November 2011 21:21 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 6
Registered: November 2011
Junior Member
Hi,

is there are way for opening a java source file in the default editor associated with it?

For instance, I have project called FOO and a source file bar.java, can I somehow cause that this source file from this projekt is openend? (like the user clicks on a link in my plugin view and the source files opens itself)
Instead of clicking by hand on the project and double click the file open it programmatically.

Is there an existing or preferred way for accomplishing that?
Re: Open a java-source file from a plugin? [message #756531 is a reply to message #756306] Mon, 14 November 2011 08:45 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 11.11.2011 22:21, souljumper wrote:
> Hi,
>
> is there are way for opening a java source file in the default editor
> associated with it?
>
> For instance, I have project called FOO and a source file bar.java,
> can I somehow cause that this source file from this projekt is
> openend? (like the user clicks on a link in my plugin view and the
> source files opens itself)
> Instead of clicking by hand on the project and double click the file
> open it programmatically.
>
> Is there an existing or preferred way for accomplishing that?
See org.eclipse.jdt.ui.JavaUI.openInEditor(IJavaElement, boolean, boolean).

Dani
Previous Topic:Enable/disable commands on the basis of a view's content
Next Topic:Multiple classes with main() in single package
Goto Forum:
  


Current Time: Sat Jun 12 12:04:12 GMT 2021

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

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

Back to the top