Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to open an editor programatically with arguments for constructor
How to open an editor programatically with arguments for constructor [message #1174741] Thu, 07 November 2013 09:32
Phil H is currently offline Phil H
Messages: 267
Registered: November 2012
Senior Member
I'm wondering how I can open an editor programaticaly with arguments for the editor constructor. I already had the following solution (which works), but here I wasn't able to call the constructr of my editor:

....
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart openEditor = IDE.openEditor(page, plcFile);
...


So I tried something like this, which doesn't work for me:

...
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
PlcEditor editor = new PlcEditor(emfResource);
page.openEditor(editor, "test");
...


Is there a appropriate way for open an editor with arguments for the constructor?

Cheers, Phil
Previous Topic:Class and Package diagrams for eclipse api
Next Topic:Eclipse won't download
Goto Forum:
  


Current Time: Wed Oct 01 20:18:14 GMT 2014

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

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