Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to set minimal view height ?
How to set minimal view height ? [message #448292] Thu, 20 April 2006 16:12 Go to next message
arnaud is currently offline arnaudFriend
Messages: 7
Registered: July 2009
Junior Member
Hi !

I can't find how to set a minimal height for a view added to my
perspective. This view is at the bottom of another view and contains a
CLabel with an image inside. The result is a too small view height which
shows only half of the image.

Is there a way to set the desired height for this view ?

TIA

--
Arnaud

Here are my classes :

1) the perspective
public class Perspective implements IPerspectiveFactory {

public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(true);
layout.setFixed(false);


layout.addStandaloneView(DocumentsPoolView.ID, true,
IPageLayout.LEFT, 0.40f, editorArea);

layout.addStandaloneView(TrashView.ID, false, IPageLayout.BOTTOM, 1.0f,
DocumentsPoolView.ID);
}

}

2) the view
public class TrashView extends ViewPart {

public static final String ID = "TrashView";

Image trash = new Image(null,
MyPlugin.class.getResourceAsStream("icons/trashcan_empty.png "));

CLabel label;


public void createPartControl(Composite parent) {
label = new CLabel(parent, SWT.CENTER);
label.setImage(trash);
}


public void setFocus() {
label.setFocus();

}


public void dispose() {
trash.dispose();
super.dispose();
}

}
Re: How to set minimal view height ? [message #448296 is a reply to message #448292] Thu, 20 April 2006 16:19 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

arnaud wrote:
> Hi !
>
> I can't find how to set a minimal height for a view added to my
> perspective. This view is at the bottom of another view and contains a
> CLabel with an image inside. The result is a too small view height which
> shows only half of the image.
>
> Is there a way to set the desired height for this view ?
>
> TIA
>
> --
> Arnaud
>
> Here are my classes :
>
> 1) the perspective
> public class Perspective implements IPerspectiveFactory {
>
> public void createInitialLayout(IPageLayout layout) {
> String editorArea = layout.getEditorArea();
> layout.setEditorAreaVisible(true);
> layout.setFixed(false);
>
>
> layout.addStandaloneView(DocumentsPoolView.ID, true,
> IPageLayout.LEFT, 0.40f, editorArea);
>
> layout.addStandaloneView(TrashView.ID, false, IPageLayout.BOTTOM,
> 1.0f, DocumentsPoolView.ID);
> }


Pick something other than 1.0f (which is disallowed in the javadocs, by
the way). 0.5f will have your view take up half the space.


View's aren't like shells. Your view size is determined by eclipse, not
by your view contents.

Later,
PW


Re: How to set minimal view height ? [message #448297 is a reply to message #448296] Thu, 20 April 2006 17:02 Go to previous message
arnaud is currently offline arnaudFriend
Messages: 7
Registered: July 2009
Junior Member
Paul Webster a écrit :
> arnaud wrote:
>
>> Hi !
>>
>> I can't find how to set a minimal height for a view added to my
>> perspective. This view is at the bottom of another view and contains a
>> CLabel with an image inside. The result is a too small view height
>> which shows only half of the image.
>>
>> Is there a way to set the desired height for this view ?
>>
>> TIA
>>
>> --
>> Arnaud
>>
>> Here are my classes :
>>
>> 1) the perspective
>> public class Perspective implements IPerspectiveFactory {
>>
>> public void createInitialLayout(IPageLayout layout) {
>> String editorArea = layout.getEditorArea();
>> layout.setEditorAreaVisible(true);
>> layout.setFixed(false);
>> layout.addStandaloneView(DocumentsPoolView.ID,
>> true, IPageLayout.LEFT, 0.40f, editorArea);
>> layout.addStandaloneView(TrashView.ID, false,
>> IPageLayout.BOTTOM, 1.0f, DocumentsPoolView.ID);
>> }
>
>
>
> Pick something other than 1.0f (which is disallowed in the javadocs, by
> the way). 0.5f will have your view take up half the space.
>
>
> View's aren't like shells. Your view size is determined by eclipse, not
> by your view contents.
>
> Later,
> PW
Thx, it works perfectly

--
Arnaud
Previous Topic:Accessing status line contribution items
Next Topic:Window -> Open Perspective & Show View
Goto Forum:
  


Current Time: Sun Nov 10 10:07:59 GMT 2024

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

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

Back to the top