| Way to right-align StatusLine items? [message #319463] |
Tue, 21 August 2007 19:56  |
Eclipse User |
|
|
|
Originally posted by: victormus.yahoo.com
Hi,
I have four labels on statusline with fixed widthHint and heightHint.
Somehow, if I remove two of these labels using GridData.exclude, two
remaining labels are left-aligned with spaces for removed labels on the
right side.
I am wondering if there is a way to right-align remaining labels?
Code:
public void fill( Composite arg0 )
{
Composite composite = new Composite( arg0, SWT.NONE );
GridLayout layout = new GridLayout( 4, false );
composite.setLayout( layout );
Label label1 = new Label( composite, SWT.NONE );
label1.setText( "Test1" );
Label label2 = new Label( composite, SWT.NONE );
label2.setText( "Test2" );
GridData data = new GridData();
data.horizontalAlignment = SWT.FILL;
data.exclude = true;
label2.setLayoutData( data );
label2.setVisible( false );
Label label4 = new Label( composite, SWT.NONE );
label4.setText( "Test4" );
GridData data4 = new GridData();
data4.horizontalAlignment = SWT.FILL;
data4.exclude = true;
label4.setLayoutData( data4 );
label4.setVisible( false );
Label label3 = new Label( composite, SWT.NONE );
label3.setText( "Test3" );
StatusLineLayoutData statusLineLayoutData = new
StatusLineLayoutData();
statusLineLayoutData.widthHint = 100;
statusLineLayoutData.heightHint =10;
composite.setLayoutData( statusLineLayoutData );
}
thanks,
|
|
|
|
Powered by
FUDForum. Page generated in 0.03091 seconds