Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Celleditor alignment in Table
Celleditor alignment in Table [message #423742] Sat, 21 February 2004 02:34 Go to next message
Mitch Christensen is currently offline Mitch Christensen
Messages: 39
Registered: July 2009
Member
We have righ-justified a table column in order to accept numeric data (so
the decimal points align). Unfortunately, when the cell is activated for
editing, the cell editor is always left-justified. This results in
strange looking behavior. The cell contents shift left during editing,
and shift right again when you hit return.

Obviously, what I'd like is to have the cell-editor inherit the alignment
of the underlying cell.

I thought that I heard recently that this problem had been fixed in M7,
but I can't find any reference to this bug in Bugzilla, or anyplace else
for that matter.

Can someone comment?

Thanks,
-Mitch
Re: Celleditor alignment in Table [message #423761 is a reply to message #423742] Sat, 21 February 2004 12:49 Go to previous messageGo to next message
Eclipse User
Originally posted by: only1onely.hotmail.com

I want to know how to righ-justified a table column.

Please
Re: Celleditor alignment in Table [message #734458 is a reply to message #423742] Fri, 07 October 2011 20:49 Go to previous message
Peter Moogk is currently offline Peter Moogk
Messages: 1
Registered: October 2011
Junior Member
I ran into the same problem and didn't find any answers in the forums. I did discover a solution that I will post here for someone else that runs into this issue. The TextCellEditor uses a Text field to edit the value. Setting the orientation of this Text field to SWT.RIGHT_TO_LEFT will cause the values to be displayed from right to left. Here is a snippet of code that I used to resolve this problem. Thanks.

  class RightAlignTextEditor extends TextCellEditor
  {
    public RightAlignTextEditor( Composite comp )
    {
      super( comp );  
    }
    
    @Override
    public Control getControl()
    {
      Text text = (Text)super.getControl();
      
      text.setOrientation( SWT.RIGHT_TO_LEFT );
      return text;
    }
  }

Previous Topic:Scrolling problem with flat look and Windows XP Theme
Next Topic:SWT GTK 64 bit and UBUNTU 11.04 NPE
Goto Forum:
  


Current Time: Tue Sep 16 15:49:04 GMT 2014

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

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