Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Way to right-align StatusLine items?
Way to right-align StatusLine items? [message #319463] Tue, 21 August 2007 19:56 Go to next message
Eclipse UserFriend
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,
Re: Way to right-align StatusLine items? [message #319479 is a reply to message #319463] Wed, 22 August 2007 10:41 Go to previous message
Eclipse UserFriend
Originally posted by: victormus.gmail.com

StatusLineLayoutData does not have horizontalAlignment and
grabExcessHorizontalSpace. This makes rigght-alignment difficult for
statusline.

There is a bug talking about this:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=73513

Wondering if this has been fixed in recent releases?

Thanks,
Previous Topic:Open a view relative to the java editor
Next Topic:Why would a Marker's "Go To" not focus on line # in the editor?
Goto Forum:
  


Current Time: Sat Nov 08 01:00:43 EST 2025

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

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

Back to the top