| Summary: | [PresentationAPI] Values set by IPlaceholderFolderLayout.setProperty not found in PresentationFactory | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Julian <youhoo2000> |
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> |
| Status: | RESOLVED WONTFIX | QA Contact: | Paul Webster <pwebster> |
| Severity: | normal | ||
| Priority: | P3 | CC: | youhoo2000 |
| Version: | 3.5.2 | Keywords: | helpwanted |
| Target Milestone: | 4.4 M7 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Julian
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. |