Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem with perspective layout
Problem with perspective layout [message #76975] Thu, 06 March 2008 10:58 Go to next message
Eclipse UserFriend
Originally posted by: diman.karagiozov.gmail.com

Hello All,

I am trying to add two views in a perspective, using the following code
fragment:

public class Perspective implements IPerspectiveFactory {

public void createInitialLayout( final IPageLayout layout ) {
layout.setEditorAreaVisible( false );
layout.setFixed( true );

layout.addView( CategoriesView.class.getName(), IPageLayout.LEFT, 1.0f,
layout.getEditorArea() );

final IFolderLayout main = layout.createFolder( "right",
IPageLayout.RIGHT, 0.5f, CategoriesView.class.getName() );
main.addView( TreeView.class.getName() );
main.addView( FlatTreeView.class.getName() );
main.addView( TextEditView.class.getName() );
}
}

If I understand the layout and ratios correclty, the first view is added
relative to the editor area (which is hidden) and takes all of the
available space. Then the second view (actually a folder of views) is
added on the right side of the first view with ration 0.5.
So, I suppose that the first view and the folder will take 50% each of the
available space.
However, the folder gets too much space and the "left" view always gets
some kind of minimal width.

What's wrong with my code?

greetings
Diman
RE: Problem with perspective layout [message #77150 is a reply to message #76975] Thu, 06 March 2008 18:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fappel.innoopract.com

Hi,

I didn't have time to look exactly, but your first ratio value is out of
the allowed range regarding to the java doc.

Ciao
Frank

-----Ursprüngliche Nachricht-----
Von: Diman Karagiozov [mailto:diman.karagiozov@gmail.com]
Bereitgestellt: Donnerstag, 6. März 2008 11:59
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Problem with perspective layout
Betreff: Problem with perspective layout


Hello All,

I am trying to add two views in a perspective, using the following code
fragment:

public class Perspective implements IPerspectiveFactory {

public void createInitialLayout( final IPageLayout layout ) {
layout.setEditorAreaVisible( false );
layout.setFixed( true );

layout.addView( CategoriesView.class.getName(),
IPageLayout.LEFT, 1.0f,
layout.getEditorArea() );

final IFolderLayout main = layout.createFolder( "right",
IPageLayout.RIGHT, 0.5f, CategoriesView.class.getName() );
main.addView( TreeView.class.getName() );
main.addView( FlatTreeView.class.getName() );
main.addView( TextEditView.class.getName() );
}
}

If I understand the layout and ratios correclty, the first view is added
relative to the editor area (which is hidden) and takes all of the
available space. Then the second view (actually a folder of views) is
added on the right side of the first view with ration 0.5.
So, I suppose that the first view and the folder will take 50% each of
the available space.
However, the folder gets too much space and the "left" view always gets
some kind of minimal width.

What's wrong with my code?

greetings
Diman
Re: Problem with perspective layout [message #77316 is a reply to message #77150] Fri, 07 March 2008 09:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: diman.karagiozov.gmail.com

I have tried different ratios but without success.
The last attempt I've made is the following:

public void createInitialLayout( final IPageLayout layout ) {
layout.setEditorAreaVisible( false );
layout.setFixed( true );

final IFolderLayout left = layout.createFolder( "left",
IPageLayout.LEFT, 0.30f, layout.getEditorArea() );
left.addView( CategoriesView.class.getName() );

final IFolderLayout right = layout.createFolder( "right",
IPageLayout.RIGHT, 0.65f, layout.getEditorArea() );
right.addView( TreeView.class.getName() );
right.addView( FlatTreeView.class.getName() );
right.addView( TextEditView.class.getName() );
}

The ratios are in the range 0.05 and 0.95 but the result is not as I
expect: the first view should take around 1/3 of the available width.

Is it possible that some of the views' content is to small or too wide?
I have tested with empty folders (IFolderLayout) but the result was the
same...

thanks a lot for your help.
Diman
RE: Problem with perspective layout [message #77382 is a reply to message #77316] Fri, 07 March 2008 15:22 Go to previous message
Eclipse UserFriend
Originally posted by: fappel.innoopract.com

Hi,

I tried a little bit with the RAP Mail Demo (templates) to reproduce
your problem, but adding the snippet into the demo (changing the view
ids of course) it worked well. I played a little with the second float,
but it didn't seem to have any influence on the result:


layout.setEditorAreaVisible( false );
layout.setFixed( true );

final IFolderLayout left = layout.createFolder( "left",
IPageLayout.LEFT, 0.33f, layout.getEditorArea() );
left.addView( NavigationView.ID );

final IFolderLayout right = layout.createFolder( "right",
IPageLayout.RIGHT, 0.3f, layout.getEditorArea() );
right.addView( View.ID );


Maybe you have a look at the article
http://www.eclipse.org/articles/using-perspectives/Perspecti veArticle.ht
ml to find more information about how to use perspectives.


Ciao
Frank


-----Ursprüngliche Nachricht-----
Von: Diman Karagiozov [mailto:diman.karagiozov@gmail.com]
Bereitgestellt: Freitag, 7. März 2008 10:02
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Problem with perspective layout
Betreff: Re: Problem with perspective layout


I have tried different ratios but without success.
The last attempt I've made is the following:

public void createInitialLayout( final IPageLayout layout ) {
layout.setEditorAreaVisible( false );
layout.setFixed( true );

final IFolderLayout left = layout.createFolder( "left",
IPageLayout.LEFT, 0.30f, layout.getEditorArea() );
left.addView( CategoriesView.class.getName() );

final IFolderLayout right = layout.createFolder(
"right", IPageLayout.RIGHT, 0.65f, layout.getEditorArea() );
right.addView( TreeView.class.getName() );
right.addView( FlatTreeView.class.getName() );
right.addView( TextEditView.class.getName() );
}

The ratios are in the range 0.05 and 0.95 but the result is not as I
expect: the first view should take around 1/3 of the available width.

Is it possible that some of the views' content is to small or too wide?
I have tested with empty folders (IFolderLayout) but the result was the
same...

thanks a lot for your help.
Diman
Previous Topic:UICallback - Server- side refresh
Next Topic:CellLayout
Goto Forum:
  


Current Time: Sat May 04 03:14:44 GMT 2024

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

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

Back to the top