Pergunta

I am developing RCP plug-in with GEF framework.
I've created basic graphical editor (GraphicalEditor and IEditorInput)

IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.openEditor(new TEditorInput("T"), TGraphicalEditor.ID,false);

When I run the application I get editor with a header that contains the tab with the name of the editor and control buttons to maximize and minimize the editor.

What I need is to display just the editor, without the header.

Can it be done?

enter image description here

Foi útil?

Solução

The idea with editors is that you can instantiate them multiply for different editor inputs. I am not aware of any way to restrict the number of open editors to just one (well, it appears you can in Eclipse 4.2 if that helps you)

For views, what you want can be done by setting the perspective to fixed and set showTitle of the org.eclipse.ui.perspectiveExtensions extension to false on the view. Maybe you can use a view instead of an editor and control the editor input yourself?

(For example, using an editor, the default Open action would instantiate a new editor, while you probably want to replace the contents in your only editor, right?)

Outras dicas

To my knowledge, it is not possible to just hide an editor's tab.

However, you can try two workarounds:

  • Have your GEF editor be displayed in an Eclipse view instead of an editor and open such a view as a standalone view. An example of how to open a GEF diagram in a view can be found in GEF's Directed Graph Example. An example of how to open a view as standalone can be found in one the Eclipse RCP official tutorials.

  • Extend the presentation factories extension point to control how workbench parts are displayed (which includes control over the part stack tab).

I suggest you try the first approach, as to me it seems easier to implement.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top