Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » StackPresentation is not coupled with PartId
StackPresentation is not coupled with PartId [message #140964] Tue, 21 July 2009 22:36 Go to next message
Jordan Bonnet is currently offline Jordan BonnetFriend
Messages: 15
Registered: July 2009
Junior Member
Hi,

After reading the following article :

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .rap.help/help/html/advanced/look-and-feel.html


in the org.eclipse.rap.ui.branding extension, I tried to couple the id of
a StackPresentation with the id of a Part in the plugin.xml. For some
reasons, the implementation of my StackPresentation (via the
ConfigurableStack adaptor) is never used. It is actually always the
DefautlStackPresentation that is called for my three standalone views.

Is the partId attribute of the plugin.xml supposed to be the id of a View
(registered in the org.eclipse.ui.views extension)? If not, what is the
partId supposed to be?

Thank you in advance.
Jordan
Re: StackPresentation is not coupled with PartId [message #141218 is a reply to message #140964] Wed, 22 July 2009 14:34 Go to previous messageGo to next message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Hi Jordan,
the DefaultStackPresentation will be used if no custom implementation
was found. You have to couple a LayoutPart id which you have defined in
your perspective to a StackPresentation Id. As I said in the other
thread, we provide a example implementation for this API. In that
implementation we couple LayoutPart Ids from org.eclipse.rap.demo to
the StackPresentation id from org.eclipse.rap.design.example. Please
take a look at this coupling, you can find it in the branding of the
example implementation.

I recommend to use defaultStackPresentation for the coulping if you
want to use just one StackPresentation. The
LayoutPart/StackPresentation coupling is only for using different
StackPresentations for different LayoutParts (Mix different
StackPresentation wihtin one Page).

I hope this will help a little bit ;)

Regards Holger



On 2009-07-22 00:36:36 +0200, jordan.bonnet@gmail.com (Jordan Bonnet) said:

> Hi,
>
> After reading the following article :
>
> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .rap.help/help/html/advanced/look-and-feel.html


in
>
> the org.eclipse.rap.ui.branding extension, I tried to couple the id of
> a StackPresentation with the id of a Part in the plugin.xml. For some
> reasons, the implementation of my StackPresentation (via the
> ConfigurableStack adaptor) is never used. It is actually always the
> DefautlStackPresentation that is called for my three standalone views.
> Is the partId attribute of the plugin.xml supposed to be the id of a
> View (registered in the org.eclipse.ui.views extension)? If not, what
> is the partId supposed to be?
>
> Thank you in advance.
> Jordan


--
-----------------------------------------

http://eclipsesource.com

http://twitter.com/eclipsesource
Re: StackPresentation is not coupled with PartId [message #141335 is a reply to message #141218] Thu, 23 July 2009 09:04 Go to previous messageGo to next message
Jordan Bonnet is currently offline Jordan BonnetFriend
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 Go to previous messageGo to next message
Holger Staudacher is currently offline Holger StaudacherFriend
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 Go to previous message
Jordan Bonnet is currently offline Jordan BonnetFriend
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
Previous Topic:Listener Dilemma
Next Topic:Business Theme to new RAP Project
Goto Forum:
  


Current Time: Fri Apr 26 08:14:11 GMT 2024

Powered by FUDForum. Page generated in 0.03105 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top