| Summary: | [Perspectives] Allow to specify orientation of a fastview in plugin.xml | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Yves <techyves> |
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P5 | CC: | ankit.200490, charafcs, lafeuil, sxenos, thomas.darimont |
| Version: | 3.1 | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | stalebug | ||
|
Description
Yves
Our product needs this -- could this be done soon? Is there any workaround possible? workaround (ugly ugly! so ugly we cant use it for our release) drop a cleverly constructed workbench.xml in the .metadata/.plugins/org.eclipse.ui.workbench for the workspace that contains: <?xml version="1.0" encoding="UTF-8"?> <workbench version="2.0"> <window x="0" y="0" width="1024" height="768"> <fastViewData fastViewLocation="1024"> <orientation view="com.streambase.sb.ide.views.PropertiesView" position="256"/> </fastViewData> <fastViews> <view id="com.streambase.sb.ide.views.PropertiesView" ratio="0.6"/> </fastViews> </window> </workbench> Where position=256 means horizontal, position=512 means vertical. Eddie, there are no immediate plans to address this one. If you'd like to investigate a patch, that would greatly increase the likelihood of it going into 3.2. The place to start would be PerspectiveExtensionReader.processView (in the org.eclipse.ui.workbench plug-in). The entrypoint, PerspectiveExtensionReader.extendLayout, is called during perspective creation from Perspective.loadPredefinedPersp. Reassigning bugs in component areas that are changing ownership. There are currently no plans to work on this feature. PW Changes requested on bug 193523 Hi,
In your setFocus() method of your fast view just do this:
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
if( page != null )
{
IViewReference[] viewReferences = page.getViewReferences();
for( IViewReference ivr : viewReferences )
{
if( ivr.getId().equalsIgnoreCase(YOUR_VIEW_ID ) )
{
( (WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow() ).getFastViewBar().setOrientation(
ivr, SWT.HORIZONTAL );
}
}
}
(In reply to ankit chauhan from comment #7) > Hi, > > In your setFocus() method of your fast view just do this: Just a note that setFocus() is only called when the tab is clicked, not necessarily when the view is activated, and more generally this won't work in 4.x (Juno onwards) at all as the fastview implementation changed. PW Hi Paul. There's another solution for this but I don't know whether this will work in eclipse 4.x or not. Here's the solution: After create a view(fast) just set the
state to minimize(so no need to declare in setFocus()):-
/**
* @param state - one of the IWorkbenchPage STATE_* values: STATE_MAXIMIZED, *STATE_MINIMIZED, STATE_RESTORED
* @unpublished
*/
public void setViewState( int state )
{
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
int currentState = page.getPartState( page.getReference( this ) );
if( currentState != state )
{
page.activate( this );
page.setPartState( page.getReference( this ), state );
}
}
so when you pass '0' in setViewState it will make the default orientation to horizontal.
Hope this will work :)
So the code from my last two comment in combination will temporarily allow you to put default orientation to horizontal() without using setFocus() method. Hope there will be a permanent solution. :) This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the stalebug whiteboard tag. |