IFolderLayout default folder tab not displayed [message #780986] |
Thu, 19 January 2012 07:55 |
Kai Erlemann Messages: 2 Registered: January 2012 |
Junior Member |
|
|
I am currently fighting with a rather annoying behaviour when using a perspective with an IFolderLayout in an RCP application. Imagine a perspective with a large number of tabs (about 20). As the titles of most tabs are quite long, they do not all fit into the window at the same time.
We disabled the trimming of tab titles with a VIEW_MINIMUM_CHARACTERS=100 setting in our plugin_customization.ini file. We expect the first folder of the perspective to be default-selected and visible when the perspective is opened. Unfortunately, the folder is selected, but not visible!
To recreate this behaviour, you can use the following steps (tested on Eclipse 3.7 on Windows 7):
create a simple RCP plugin project with UI contributions enabled and select the "RCP application with a view" template from the "New Plug-in Project" Wizard
create a second view called "View2" and add it to the view extension of your plugin.xml
open your Perspective class and replace it with the following content:
package mypackage;
import org.eclipse.ui.*;
public class Perspective implements IPerspectiveFactory {
public void createInitialLayout(IPageLayout layout) {
IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, 0.95f, layout.getEditorArea());
right.addView(View.ID);
right.addView(View2.ID);
layout.setEditorAreaVisible(false);
}
}
Now start your application. You should see two tabs, the first should appear as selected. But when the window size is decreased until one of the tabs disappears, it is the first tab that disappears, not the second tab as would be expected!
When the first tab is clicked before resizing the window, the first tab stays visible while the second one disappears. This is the behaviour that we would expect.
The bug does only appear when the perspective is opened for the first time, not when a saved window state is reloaded.
Does anyone know how to ensure that the first folder tab of an IFolderLayout is always displayed when a perspective is opened?
|
|
|
Powered by
FUDForum. Page generated in 0.02691 seconds