How to set minimal view height ? [message #448292] |
Thu, 20 April 2006 16:12 |
arnaud 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 |
|
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
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Re: How to set minimal view height ? [message #448297 is a reply to message #448296] |
Thu, 20 April 2006 17:02 |
arnaud 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
|
|
|
Powered by
FUDForum. Page generated in 0.03317 seconds