Community
Participate
Working Groups
Build Identifier: 20100218-1602 In the method "createInitialLayout" of my PerspectiveFactory class, I create a IPlaceholderFolderLayout using layout.createPlaceholderFolder, then I set some properties using IPlaceholderFolderLayout.setProperty But in my PresentationFactory's methods, I cannot get these properties. If I create a IFolderLayout (means using the "layout.createFolder") and set some properties, it works! I can get these properties in PresentationFactory's methods. But in my case, I hope to use IPlaceholderFolderLayout, how to fix this?? PS: Sorry for my poor english, hope that you can read this. Thanks. Reproducible: Always Steps to Reproduce: .
In org.eclipse.ui.internal.PlaceholderFolderLayout.setProperty(String, String) it only can set a property if placeholder.getRealContainer() is a PartStack. We don't support this on non-realized stacks. Maybe the properties have to be passed onto ContainerPlaceholder and buffered until org.eclipse.ui.internal.ContainerPlaceholder.setRealContainer(ILayoutContainer) is called? PW
What I want to do is : 1. In PerspectiveFactory class, I create a "place holder" named "LeftPlaceFolder", and set one property "holderId" with the value "LEFT": IPlaceholderFolderLayout holder = layout.createPlaceholderFolder("LeftPlaceFolder", IPageLayout.BOTTOM, 0.75f, editorAreaId); holder.setProperty("holderId", "LEFT"); 2. In other plugin, I contribute some views into this "place holder" via extensions : <extension point="org.eclipse.ui.perspectiveExtensions"> <perspectiveExtension targetID="*"> <view id="test.views.GeneralView" relationship="stack" relative="LeftPlaceFolder"> </view> </perspectiveExtension> </extension> 3. In the PresentationFactory class, I want to provider special presentation for these views and this "place holder": public StackPresentation createViewPresentation(Composite parent, IStackPresentationSite site) { if (site.getProperty("holderId") == "LEFT") { return new MyPresentation(parent, site); } else { return new WorkbenchPresentationFactory().createViewPresentation(parent, site); } } The problem is I cannot get value of the property that I set before.
If I use layout.createFolder, I can get the property value later, but if I user this, I cannot contibute views into the "folder". Maybe I'm wrong somewhere, can you help me? Thanks.
(In reply to comment #3) > If I use layout.createFolder, I can get the property value later, but if I user > this, I cannot contibute views into the "folder". What do you mean? perspectiveExtensions can contribute views to existing folders more easily than placeholder folders. > Maybe I'm wrong somewhere, can you help me? Thanks. Not getting properties from placeholder folders ... that's the bug I mentioned in comment #1 PW
(In reply to comment #4) > (In reply to comment #3) > > If I use layout.createFolder, I can get the property value later, but if I user > > this, I cannot contibute views into the "folder". > > What do you mean? perspectiveExtensions can contribute views to existing > folders more easily than placeholder folders. > Why I can not contribute views to existing folders? Is something wrong with following ? ----------------------------------- PerspectiveFactory class: ----------------------------------- public void createInitialLayout(IPageLayout layout) { //1. createFolder layout.createFolder("LeftFolder", IPageLayout.LEFT, 0.3f, IPageLayout.ID_EDITOR_AREA); //2. layout.createPlaceholderFolder //layout.createPlaceholderFolder("LeftFolder", IPageLayout.LEFT, 0.3f, IPageLayout.ID_EDITOR_AREA); } -------------------------------------------- plugin.xml: -------------------------------------------- <extension point="org.eclipse.ui.perspectiveExtensions"> <perspectiveExtension targetID="*"> <view id="test.view1" minimized="false" relationship="stack" relative="LeftFolder"> </view> </perspectiveExtension> </extension> If I use "createFolder", "view1" does not appear in the folder, it appeared at the right side of the editor area. If I use "createPlaceholderFolder", "view1" appear in the folder.
(In reply to comment #5) > > What do you mean? perspectiveExtensions can contribute views to existing > > folders more easily than placeholder folders. > > > > Why I can not contribute views to existing folders? Is something wrong with > following ? I meant stack on an existing folder with a view, sorry. Your scenario is a separate bug, bug 118693 PW
(In reply to comment #6) > I meant stack on an existing folder with a view, sorry. Your scenario is a > separate bug, bug 118693 > > PW Thank your quick answer! You are so kind ! Now I use following solution instead: 1. create a folder and add a first view into the folder by code. 2. contribute other views, stack on the first view Although I need to create a "hardcode" view first, but in the present circumstances it can be accepted.
The PresentationAPI has been deprecated with the Eclipse 4.x release and it has been replaced with the CSS engine. I therefore close this bugs as WONTFIX. In case your bug report is still valid for the Eclipse 4.4 release, please open a new bug report for it.