running editor programatically [message #198196] |
Wed, 07 March 2007 05:27  |
Eclipse User |
|
|
|
Originally posted by: raushansharma2004.yahoo.com
hi,
i want to know how to run an editor programmatically.
i have written editor in MyEditor class
i have created one toolbar button ,what i require is when this button
is pressed, the editor should be called.can someone give me its solution
|
|
|
|
Re: running editor programatically [message #198248 is a reply to message #198196] |
Wed, 07 March 2007 07:46  |
Eclipse User |
|
|
|
Hi Raushan,
Inside the run method of an Action that you associate with your toolbar
button, use the following:
IWorkbenchWindow iWorkbenchWindow =
PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage iWorkbenchPage = iWorkbenchWindow.getActivePage();
iWorkbenchPage.openEditor(myEditorInput, MyEditor.ID);
You will need to create a class that extends EditorInput.
Charlie
raushan wrote:
> hi, i want to know how to run an editor programmatically.
> i have written editor in MyEditor class
> i have created one toolbar button ,what i require is when this
> button is pressed, the editor should be called.can someone give me its
> solution
>
|
|
|
Powered by
FUDForum. Page generated in 0.09013 seconds