Skip to main content


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 13:27 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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: Fri Apr 19 06:42:58 GMT 2024

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

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

Back to the top