load the editor programatically [message #305070] |
Thu, 22 June 2006 13:27 |
Eclipse User |
|
|
|
Originally posted by: kollepara2004.yahoo.com
I need example to load the editor programatically for a given extension.
Please help me on this
Regards
Rk
|
|
|
Re: load the editor programatically [message #305074 is a reply to message #305070] |
Thu, 22 June 2006 13:46 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
RK,
Code like this should do the trick:
// Select the new file resource in the current view.
//
IWorkbenchWindow workbenchWindow =
workbench.getActiveWorkbenchWindow();
IWorkbenchPage page = workbenchWindow.getActivePage();
// Open an editor on the new file.
//
try
{
page.openEditor
(new FileEditorInput(modelFile),
workbench.getEditorRegistry().getDefaultEditor(modelFile.get FullPath().toString()).getId());
}
catch (PartInitException exception)
{
MessageDialog.openError(workbenchWindow.getShell(),
LibraryEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label "),
exception.getMessage());
return false;
}
rk wrote:
> I need example to load the editor programatically for a given extension.
> Please help me on this
> Regards
> Rk
>
|
|
|
Powered by
FUDForum. Page generated in 0.01321 seconds