Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » load the editor programatically
load the editor programatically [message #305070] Thu, 22 June 2006 09:27 Go to next message
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 09:46 Go to previous message
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
>
Previous Topic:Capabilities Preferences Removed?
Next Topic:Workspace is closed error
Goto Forum:
  


Current Time: Wed Jul 23 08:03:31 EDT 2014

Powered by FUDForum. Page generated in 0.03084 seconds