Home » Eclipse Projects » Remote Application Platform (RAP) » StackPresentation is not coupled with PartId
| |
Re: StackPresentation is not coupled with PartId [message #141335 is a reply to message #141218] |
Thu, 23 July 2009 09:04 |
Jordan Bonnet Messages: 15 Registered: July 2009 |
Junior Member |
|
|
Hi! Thank you it helped me a lot. I'm going to illustrate with some pieces
of code the mistake I was making, so that no one gets confused in the
future:
My code before (No coupling between StackPresentation id and Part id) :
--------------
public class Perspective implements IPerspectiveFactory
{
public void createInitialLayout(IPageLayout layout)
{
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
layout.addStandaloneView(TopView.ID, false, IPageLayout.TOP, 0.2f,
editorArea);
layout.addStandaloneView(BottomView.ID, false, IPageLayout.BOTTOM,
0.8f, editorArea);
layout.getViewLayout(NavigationView.ID).setCloseable(false);
layout.getViewLayout(NavigationView.ID).setMoveable(false);
layout.getViewLayout(BottomView.ID).setCloseable(false);
layout.getViewLayout(BottomView.ID).setMoveable(false);
}
}
My code now (Coupling between StackPresentation id and Part id is working)
:
-----------
public class Perspective implements IPerspectiveFactory
{
public void createInitialLayout(IPageLayout layout)
{
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
IFolderLayout topFolder = layout.createFolder("topViewLayout",
IPageLayout.TOP, 0.2f, editorArea);
topFolder.addView(TopView.ID);
IFolderLayout bottomFolder = layout.createFolder("bottomViewLayout",
IPageLayout.BOTTOM, 0.8f, editorArea);
bottomFolder.addView(BottomView.ID);
layout.getViewLayout(NavigationView.ID).setCloseable(false);
layout.getViewLayout(NavigationView.ID).setMoveable(false);
layout.getViewLayout(BottomView.ID).setCloseable(false);
layout.getViewLayout(BottomView.ID).setCloseable(false);
}
}
Since I'm using Standalone Views, I did not see the point of creating a
IFolderLayout to stack one unique Standalone View. But I realize that it
is necessary to create a IFolderLayout if you want to couple a
StackPresentation id with a Partid (in this example the Partids are:
"topViewLayout" and "bottomViewLayout"), since the Partid used for the
coupling is actually the name given to this IFolderLayout (before that I
thought it was the id of the View itself). The coupling is done in the
branding extension point (cf. the article "RAP Look and Feel").
I hope this helps.
Thank you again Holger,
Jordan
|
|
|
Re: StackPresentation is not coupled with PartId [message #141342 is a reply to message #141335] |
Thu, 23 July 2009 09:29 |
Holger Staudacher Messages: 166 Registered: July 2009 |
Senior Member |
|
|
Hi Jordan,
nice to here it's working now and thanks for providing the snippets,
this is great for other users of the API. If you have completed your
StackPresentation it would be nice to see it. So maybe you can provide
a Screenshot to us ;)
Regards Holger
On 2009-07-23 11:04:01 +0200, jordan.bonnet@gmail.com (Jordan Bonnet) said:
> Hi! Thank you it helped me a lot. I'm going to illustrate with some
> pieces of code the mistake I was making, so that no one gets confused
> in the future:
>
>
> My code before (No coupling between StackPresentation id and Part id) :
> --------------
>
>
> public class Perspective implements IPerspectiveFactory {
> public void createInitialLayout(IPageLayout layout)
> {
> String editorArea = layout.getEditorArea();
> layout.setEditorAreaVisible(false);
>
> layout.addStandaloneView(TopView.ID, false, IPageLayout.TOP, 0.2f,
> editorArea);
> layout.addStandaloneView(BottomView.ID, false, IPageLayout.BOTTOM,
> 0.8f, editorArea);
>
> layout.getViewLayout(NavigationView.ID).setCloseable(false);
> layout.getViewLayout(NavigationView.ID).setMoveable(false);
> layout.getViewLayout(BottomView.ID).setCloseable(false);
> layout.getViewLayout(BottomView.ID).setMoveable(false);
>
> }
> }
>
>
> My code now (Coupling between StackPresentation id and Part id is working) :
> -----------
>
>
> public class Perspective implements IPerspectiveFactory {
> public void createInitialLayout(IPageLayout layout)
> {
> String editorArea = layout.getEditorArea();
> layout.setEditorAreaVisible(false);
>
> IFolderLayout topFolder = layout.createFolder("topViewLayout",
> IPageLayout.TOP, 0.2f, editorArea);
> topFolder.addView(TopView.ID);
>
> IFolderLayout bottomFolder =
> layout.createFolder("bottomViewLayout", IPageLayout.BOTTOM, 0.8f,
> editorArea);
> bottomFolder.addView(BottomView.ID);
>
> layout.getViewLayout(NavigationView.ID).setCloseable(false);
> layout.getViewLayout(NavigationView.ID).setMoveable(false);
> layout.getViewLayout(BottomView.ID).setCloseable(false);
> layout.getViewLayout(BottomView.ID).setCloseable(false);
> }
> }
>
>
> Since I'm using Standalone Views, I did not see the point of creating a
> IFolderLayout to stack one unique Standalone View. But I realize that
> it is necessary to create a IFolderLayout if you want to couple a
> StackPresentation id with a Partid (in this example the Partids are:
> "topViewLayout" and "bottomViewLayout"), since the Partid used for the
> coupling is actually the name given to this IFolderLayout (before that
> I thought it was the id of the View itself). The coupling is done in
> the branding extension point (cf. the article "RAP Look and Feel").
>
> I hope this helps.
>
> Thank you again Holger,
> Jordan
--
-----------------------------------------
http://eclipsesource.com
http://twitter.com/eclipsesource
|
|
|
Re: StackPresentation is not coupled with PartId [message #141352 is a reply to message #141342] |
Thu, 23 July 2009 12:03 |
Jordan Bonnet Messages: 15 Registered: July 2009 |
Junior Member |
|
|
Hi Holger,
You're welcome for the snippets, it is totally normal. I will definitely
post a screenshot (if I find out how to post an image on the NewsPortal
lol) once it is done, and I will explain how I managed to get that result.
For the moment, I still have to find out how to get rid of these three
pixels that separate my two views.
Best regards,
Jordan
> Hi Jordan,
> nice to here it's working now and thanks for providing the snippets,
> this is great for other users of the API. If you have completed your
> StackPresentation it would be nice to see it. So maybe you can provide
> a Screenshot to us ;)
> Regards Holger
> On 2009-07-23 11:04:01 +0200, jordan.bonnet@gmail.com (Jordan Bonnet) said:
>> Hi! Thank you it helped me a lot. I'm going to illustrate with some
>> pieces of code the mistake I was making, so that no one gets confused
>> in the future:
>>
>>
>> My code before (No coupling between StackPresentation id and Part id) :
>> --------------
>>
>>
>> public class Perspective implements IPerspectiveFactory {
>> public void createInitialLayout(IPageLayout layout)
>> {
>> String editorArea = layout.getEditorArea();
>> layout.setEditorAreaVisible(false);
>>
>> layout.addStandaloneView(TopView.ID, false, IPageLayout.TOP, 0.2f,
>> editorArea);
>> layout.addStandaloneView(BottomView.ID, false, IPageLayout.BOTTOM,
>> 0.8f, editorArea);
>>
>> layout.getViewLayout(NavigationView.ID).setCloseable(false);
>> layout.getViewLayout(NavigationView.ID).setMoveable(false);
>> layout.getViewLayout(BottomView.ID).setCloseable(false);
>> layout.getViewLayout(BottomView.ID).setMoveable(false);
>>
>> }
>> }
>>
>>
>> My code now (Coupling between StackPresentation id and Part id is working) :
>> -----------
>>
>>
>> public class Perspective implements IPerspectiveFactory {
>> public void createInitialLayout(IPageLayout layout)
>> {
>> String editorArea = layout.getEditorArea();
>> layout.setEditorAreaVisible(false);
>>
>> IFolderLayout topFolder = layout.createFolder("topViewLayout",
>> IPageLayout.TOP, 0.2f, editorArea);
>> topFolder.addView(TopView.ID);
>>
>> IFolderLayout bottomFolder =
>> layout.createFolder("bottomViewLayout", IPageLayout.BOTTOM, 0.8f,
>> editorArea);
>> bottomFolder.addView(BottomView.ID);
>>
>> layout.getViewLayout(NavigationView.ID).setCloseable(false);
>> layout.getViewLayout(NavigationView.ID).setMoveable(false);
>> layout.getViewLayout(BottomView.ID).setCloseable(false);
>> layout.getViewLayout(BottomView.ID).setCloseable(false);
>> }
>> }
>>
>>
>> Since I'm using Standalone Views, I did not see the point of creating a
>> IFolderLayout to stack one unique Standalone View. But I realize that
>> it is necessary to create a IFolderLayout if you want to couple a
>> StackPresentation id with a Partid (in this example the Partids are:
>> "topViewLayout" and "bottomViewLayout"), since the Partid used for the
>> coupling is actually the name given to this IFolderLayout (before that
>> I thought it was the id of the View itself). The coupling is done in
>> the branding extension point (cf. the article "RAP Look and Feel").
>>
>> I hope this helps.
>>
>> Thank you again Holger,
>> Jordan
|
|
|
Goto Forum:
Current Time: Fri Apr 26 08:14:11 GMT 2024
Powered by FUDForum. Page generated in 0.03105 seconds
|