Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Editable Amount Column in Table
Editable Amount Column in Table [message #1480565] Thu, 20 November 2014 09:33
Erich Steiger is currently offline Erich SteigerFriend
Messages: 14
Registered: September 2013
Junior Member

I have made a new custom column for Tables which displays the value and the currency in one single field. This works fine. Then I tried to make the column editable. The AbstractMoneyField is a sequence box which contains a BigDecimal Field and a Currency Smart Field to select the currency. When I start editing the field, only one Text Field is displayed instead of the sequence box. Does anybody has any idea?

This is a small code sample of what I have already:
public class AbstractMoneyColumn extends AbstractColumn<IMoney> {
  @Override
  protected IFormField prepareEditInternal(ITableRow row) throws ProcessingException {
    AbstractMoneyField f = new AbstractMoneyField () {};
    mapEditorFieldProperties(f);
    return f;
  }

  @Override
  protected void execDecorateCell(Cell cell, ITableRow row) throws ProcessingException {
    DecimalFormat fmt = new DecimalFormat("0.00");
    fmt.setGroupingSize(3);
    fmt.setGroupingUsed(true);
    fmt.setParseBigDecimal(true);
    cell.setText(fmt.format(getValue(row).getAmount()) + "  " + getValue(row).getCurrency());
    super.execDecorateCell(cell, row);
  }

  @Override
  protected final int getConfiguredHorizontalAlignment() {
    return 1;
  }

}



See also: Amount and currency field.

Edit: URL

[Updated on: Thu, 20 November 2014 11:38] by Moderator

Report message to a moderator

Previous Topic:SWT UI: unsaved changes confirmation box called too late
Next Topic:Who are you?
Goto Forum:
  


Current Time: Fri Sep 20 07:53:55 GMT 2024

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

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

Back to the top