Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » editor in perspective layout
editor in perspective layout [message #465267] Tue, 27 March 2007 16:49 Go to next message
Eclipse UserFriend
Originally posted by: hansm.science.uva.nlDELETE

I feel completely in the dark about the following problem.

In the extension tab I created an editor as extension to org.eclipse.ui.editors
and filled in its id, class, etc. (As I understand, I can even create several
different editors).
Now in the IPerspectiveFactory subclass from an example is the code:

public void createInitialLayout (final IPageLayout layout) {
final String editorArea = layout.getEditorArea();
....

How do I connect the specific editor as defined to the layout returned in the
call layout.getEditorArea() in createInitialLayout? An editor does show up in my
code, but I am fairly certain it is not the one I programmed.

I searched through the documentation on editors, but could not find an example
how to do this.

Hans van der Meer
Re: editor in perspective layout [message #465322 is a reply to message #465267] Wed, 28 March 2007 13:11 Go to previous message
Hugo A. Garcia is currently offline Hugo A. GarciaFriend
Messages: 258
Registered: July 2009
Senior Member
dr. Hans van der Meer wrote:
> I feel completely in the dark about the following problem.
>
> In the extension tab I created an editor as extension to org.eclipse.ui.editors
> and filled in its id, class, etc. (As I understand, I can even create several
> different editors).
> Now in the IPerspectiveFactory subclass from an example is the code:
>
> public void createInitialLayout (final IPageLayout layout) {
> final String editorArea = layout.getEditorArea();
> ....

The perspective only declares the layout of the views and editors in the
perspective. If it is a view then the view will be activated but editor
needs to instantiated upon receiving IEditorInput.


>
> How do I connect the specific editor as defined to the layout returned in the
> call layout.getEditorArea() in createInitialLayout? An editor does show up in my
> code, but I am fairly certain it is not the one I programmed.
>
> I searched through the documentation on editors, but could not find an example
> how to do this.
>
> Hans van der Meer

There are many ways to open an editor and that depends on how your user
will open the editor. For example, if you have a CommonNavigator that
displays your workspace then upon double clicking on a file type
associated to the editor, the editor will be instantiated.

One quick way to test and open your editor is to crate a MenuItem
associated with and IAction (call it Open Editor or something like that)
that opens the editor using:

IWorkbenchPage.openEditor(IEditorInput input, String editorId);

Remember to correctly set the state of you input before calling the
above method.

-H
Previous Topic:Testing Plug-Ins
Next Topic:Build update site for multiple platforms
Goto Forum:
  


Current Time: Tue Oct 08 23:45:09 GMT 2024

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

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

Back to the top