Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to launch source editor within my own code?
How to launch source editor within my own code? [message #463712] Sun, 13 November 2005 13:56 Go to next message
Eclipse UserFriend
Originally posted by: pac.cc.gatech.edu

Hi,

I am trying to create a plugin for Eclipse that will call an external
program that displays the difference between two different versions of a
program and then be able to select one of the differences and actually
open the file in a text window.

How can I create a standard source editor window for editing the Java
source files given the file? I can create an editor which runs when I
open a new Java file from the menu, but I can't work out how do the same
from my own code.

Thanks for any help.

Pete
Re: How to launch source editor within my own code? [message #463721 is a reply to message #463712] Mon, 14 November 2005 03:35 Go to previous message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
see IWorkbenchPage#openEditor

example for java editor :

final IWorkbenchWindow window = PlatformUI
.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();
IEditorInput input = new FileEditorInput(iFile);
page.openEditor(input, "org.eclipse.jdt.ui.CompilationUnitEditor", true);

Pete Calvert wrote:

> Hi,
>
> I am trying to create a plugin for Eclipse that will call an external
> program that displays the difference between two different versions of a
> program and then be able to select one of the differences and actually
> open the file in a text window.
>
> How can I create a standard source editor window for editing the Java
> source files given the file? I can create an editor which runs when I
> open a new Java file from the menu, but I can't work out how do the same
> from my own code.
>
> Thanks for any help.
>
> Pete
Previous Topic:SWT advanced graphics with Cairo
Next Topic:Canvas & redraw
Goto Forum:
  


Current Time: Fri Apr 26 22:05:36 GMT 2024

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

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

Back to the top