Bug 125443 - [Perspectives] IPagelayout.addPlaceholder(...) does not work seem to as expected
Summary: [Perspectives] IPagelayout.addPlaceholder(...) does not work seem to as expected
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-27 02:54 EST by Sanjay Chaudhuri CLA
Modified: 2019-09-06 16:17 EDT (History)
3 users (show)

See Also:


Attachments
SnapShot Using IFolder.addPlaceholder (27.19 KB, image/gif)
2006-01-27 02:57 EST, Sanjay Chaudhuri CLA
no flags Details
SnapShot Using IPlageLayout.addPlaceholder (30.90 KB, image/gif)
2006-01-27 02:57 EST, Sanjay Chaudhuri CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sanjay Chaudhuri CLA 2006-01-27 02:54:13 EST
Used the Eclipse RCP Template proto, to show the issues. 

Perspective.java has been modified to show the various cases.

Case 1:
Using IFolder.addPlaceholder, things works out as expected.

package rcpmail;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class Perspective implements IPerspectiveFactory {
  public void createInitialLayout(IPageLayout layout) {    
    layout.addStandaloneView(NavigationView.ID,  false, IPageLayout.LEFT, 0.25f, IPageLayout.ID_EDITOR_AREA);
    
    IFolderLayout folder = layout.createFolder("messages", IPageLayout.TOP, 0.5f, IPageLayout.ID_EDITOR_AREA);
    folder.addPlaceholder(View.ID + ":*");
    
    layout.setEditorAreaVisible( true);
  }
}

Plese refer to snap-shots Fig.1


Case 2:
I wanted a invisible VIEW area, till the VIEWs are displayed, so replaced 'folder' with 'layout'

package rcpmail;

import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class Perspective implements IPerspectiveFactory {
  public void createInitialLayout(IPageLayout layout) {
    layout.addStandaloneView(NavigationView.ID,  false, IPageLayout.LEFT, 0.25f, IPageLayout.ID_EDITOR_AREA);
      
    layout.addPlaceholder( View.ID + ":*", IPageLayout.TOP, 0.5f, IPageLayout.ID_EDITOR_AREA);
      
    layout.setEditorAreaVisible( true);
  }
}

As shown in Fig.2 the views are no more in their expected position.

I am using 
Version: 3.2.0
Build id: I20051102-1600

Thanks

Sanjay
Comment 1 Sanjay Chaudhuri CLA 2006-01-27 02:57:00 EST
Created attachment 33690 [details]
SnapShot Using IFolder.addPlaceholder
Comment 2 Sanjay Chaudhuri CLA 2006-01-27 02:57:36 EST
Created attachment 33691 [details]
SnapShot Using IPlageLayout.addPlaceholder
Comment 3 Sanjay Chaudhuri CLA 2006-01-27 03:33:20 EST
Sorry, there is a typo:

IFolder.addPlaceholder, to be read as IFolderLayout.addPlaceholder
Comment 4 Nick Edgar CLA 2006-01-31 17:21:00 EST
Try modifying case 1 to use createPlaceholderFolder instead of createFolder.
The second case should work similarly though.
Comment 5 Sanjay Chaudhuri CLA 2006-02-15 02:39:34 EST
Thanks for the solution. Sorry, for being a bit late on the feedback, as was not checking for a while.

I didnot understand, why someone would need to use:
IPlaceholderFolderLayout.createPlaceholderFolder(...).addPlaceholder(viewId)

when there is a similar method: 
IPageLayout.addPlaceholder(String viewId, int relationship, float ratio, String refId), intutively is supposed to do the same thing


Comment 6 Nick Edgar CLA 2006-02-15 17:30:02 EST
You're right, they should be equivalent, which is why this is still open.
But does using a placeholder folder work for you?
Comment 7 Sanjay Chaudhuri CLA 2006-02-18 03:54:11 EST
Yes, eveything worked as I was expecting it to. Thanks a lot indeed on the solution.

Comment 8 Sanjay Chaudhuri CLA 2006-02-24 14:37:38 EST
Can you please let me know, how do I handle the following situation :

PLUGIN A has perspective P with more than one placeholders defined as before:
IFolderLayout topLeftFolder = ILayout.createPlaceholderFolder(...)
IFolderLayout topRightFolder = ILayout.createPlaceholderFolder(...)
IFolderLayout bottomFolder = ILayout.createPlaceholderFolder(...)

I have PLUGIN B, which has VIEW V that needs to be gets displayed in 'topRightFolder'. Using org.eclipse.ui.perspectiveExtensions extension point, the problem is it gets displayed, when the application starts. Having the VISIBLE=FALSE, leaves a visible empty space. 

I am looking forward to a solution, just like it had been on one single plugin, where createPlaceholderFolder(...) just created an invisible empty slot, for the view to get positioned when it is invoked using showView(...)

Thanks

Sanjay
Comment 9 Paul Webster CLA 2006-09-28 15:17:30 EDT
Is this still a problem in 3.3?

PW
Comment 10 Denis Roy CLA 2007-06-22 09:33:18 EDT
Changes requested on bug 193523
Comment 11 Eclipse Webmaster CLA 2019-09-06 16:17:59 EDT
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.