Search in sources :

Example 6 with Cell

use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.

the class AbstractProposalColumn2 method updateDisplayText.

@Override
public void updateDisplayText(ITableRow row, LOOKUP_TYPE value) {
    Cell cell = row.getCellForUpdate(this);
    updateDisplayText(row, cell, (String) value);
}
Also used : Cell(org.eclipse.scout.rt.client.ui.basic.cell.Cell)

Example 7 with Cell

use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.

the class AbstractSmartColumn2 method applyLookupResult.

protected void applyLookupResult(ITableRow tableRow, List<? extends ILookupRow<?>> result) {
    // disable row changed trigger on row
    try {
        tableRow.setRowChanging(true);
        // 
        Cell cell = tableRow.getCellForUpdate(this);
        String separator = getResultRowSeparator();
        List<String> texts = CollectionUtility.emptyArrayList();
        List<String> tooltipTexts = CollectionUtility.emptyArrayList();
        for (ILookupRow<?> row : result) {
            texts.add(row.getText());
            tooltipTexts.add(row.getTooltipText());
        }
        cell.setText(StringUtility.join(separator, texts));
        cell.setTooltipText(StringUtility.join(separator, tooltipTexts));
    } finally {
        tableRow.setRowPropertiesChanged(false);
        tableRow.setRowChanging(false);
    }
}
Also used : Cell(org.eclipse.scout.rt.client.ui.basic.cell.Cell)

Example 8 with Cell

use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.

the class TableRow method setCell.

@Override
public void setCell(int columnIndex, ICell cell) {
    if (cell != null) {
        getCellForUpdate(columnIndex);
        m_cells.set(columnIndex, new Cell(null, cell));
    }
}
Also used : Cell(org.eclipse.scout.rt.client.ui.basic.cell.Cell) ICell(org.eclipse.scout.rt.client.ui.basic.cell.ICell)

Example 9 with Cell

use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.

the class AbstractBigIntegerColumnTest method testFormattingInDecorateCellInternal.

@Test
public void testFormattingInDecorateCellInternal() {
    ITableRow row = Mockito.mock(ITableRow.class);
    Cell cell = new Cell();
    BigInteger testValue = BigInteger.valueOf(-123456789);
    cell.setValue(testValue);
    DecimalFormat df = BEANS.get(NumberFormatProvider.class).getNumberInstance(Locale.CANADA_FRENCH);
    setFormat(df);
    updateDisplayText(row, cell);
    assertEquals("cell text not formatted as expected", df.format(testValue), cell.getText());
}
Also used : DecimalFormat(java.text.DecimalFormat) NumberFormatProvider(org.eclipse.scout.rt.platform.util.NumberFormatProvider) BigInteger(java.math.BigInteger) ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) Cell(org.eclipse.scout.rt.client.ui.basic.cell.Cell) Test(org.junit.Test)

Example 10 with Cell

use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.

the class AbstractPage method initPage.

/*
   * Runtime
   */
@Override
public void initPage() {
    setInitializing(true);
    try {
        Cell cell = getCellForUpdate();
        if (cell.getText() == null && getConfiguredTitle() != null) {
            cell.setText(getConfiguredTitle());
        }
        if (cell.getIconId() == null && getConfiguredIconId() != null) {
            cell.setIconId(getConfiguredIconId());
        }
        interceptInitPage();
        // early permission check is done on initialization
        if (!doCalculateVisibleLate()) {
            calculateVisibleInternal();
        }
        fireAfterPageInit();
    } finally {
        setInitializing(false);
    }
}
Also used : Cell(org.eclipse.scout.rt.client.ui.basic.cell.Cell)

Aggregations

Cell (org.eclipse.scout.rt.client.ui.basic.cell.Cell)27 Test (org.junit.Test)10 ICell (org.eclipse.scout.rt.client.ui.basic.cell.ICell)9 HeaderCell (org.eclipse.scout.rt.client.ui.basic.table.HeaderCell)5 IHeaderCell (org.eclipse.scout.rt.client.ui.basic.table.IHeaderCell)5 DecimalFormat (java.text.DecimalFormat)4 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)4 IValidateContentDescriptor (org.eclipse.scout.rt.client.ui.form.fields.IValidateContentDescriptor)4 Locale (java.util.Locale)3 ProcessingException (org.eclipse.scout.rt.platform.exception.ProcessingException)2 BigDecimal (java.math.BigDecimal)1 BigInteger (java.math.BigInteger)1 NonMandatoryTestColumn (org.eclipse.scout.rt.client.ui.basic.table.ColumnMandatoryTest.MandatoryTestTable.NonMandatoryTestColumn)1 ITableRowCustomValueContributor (org.eclipse.scout.rt.client.ui.basic.table.ITableRowCustomValueContributor)1 InternalTableRow (org.eclipse.scout.rt.client.ui.basic.table.internal.InternalTableRow)1 IValueField (org.eclipse.scout.rt.client.ui.form.fields.IValueField)1 ValidationFailedStatus (org.eclipse.scout.rt.client.ui.form.fields.ValidationFailedStatus)1 NumberFormatProvider (org.eclipse.scout.rt.platform.util.NumberFormatProvider)1