Search in sources :

Example 56 with ITableRow

use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.

the class InternalTableRowTest method testSetEnabled_NoChange.

@Test
public void testSetEnabled_NoChange() {
    TestTable table = new TestTable();
    ITableRow row = table.createRow();
    InternalTableRow ir = new InternalTableRow(table, row);
    assertTrue(ir.isEnabled());
    ir.setRowChanging(true);
    ir.setEnabled(true);
    assertFalse(ir.isRowPropertiesChanged());
    ir.setRowChanging(false);
}
Also used : ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) Test(org.junit.Test)

Example 57 with ITableRow

use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.

the class InternalTableRowTest method testValueChange.

@Test
public void testValueChange() {
    TestTable table = new TestTable();
    ITableRow row = table.createRow();
    InternalTableRow ir = new InternalTableRow(table, row);
    ir.setRowChanging(true);
    ir.cellChanged(ir.getCell(0), ICell.VALUE_BIT);
    Set<Integer> changedColumnIdx = ir.getUpdatedColumnIndexes(ICell.VALUE_BIT);
    assertEquals(1, changedColumnIdx.size());
    assertEquals(Integer.valueOf(0), changedColumnIdx.iterator().next());
    ir.setRowChanging(false);
}
Also used : ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) Test(org.junit.Test)

Example 58 with ITableRow

use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.

the class InternalTableRowTest method testSetEnabled.

@Test
public void testSetEnabled() {
    TestTable table = new TestTable();
    ITableRow row = table.createRow();
    InternalTableRow ir = new InternalTableRow(table, row);
    assertTrue(ir.isEnabled());
    ir.setRowChanging(true);
    ir.setEnabled(false);
    assertTrue(ir.isRowPropertiesChanged());
    ir.setRowChanging(false);
}
Also used : ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) Test(org.junit.Test)

Example 59 with ITableRow

use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.

the class InternalTableRowTest method testValueChange_NoChange.

@Test
public void testValueChange_NoChange() {
    TestTable table = new TestTable();
    ITableRow row = table.createRow();
    InternalTableRow ir = new InternalTableRow(table, row);
    ir.setRowChanging(true);
    ir.cellChanged(ir.getCell(0), ICell.VALUE_BIT);
    Set<Integer> changedColumnIdx = ir.getUpdatedColumnIndexes(ICell.TEXT_BIT);
    assertEquals(0, changedColumnIdx.size());
    ir.setRowChanging(false);
}
Also used : ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) Test(org.junit.Test)

Example 60 with ITableRow

use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.

the class InternalTableRowTest method testCreateInternalTableRow.

@Test
public void testCreateInternalTableRow() throws Exception {
    TestTable table = new TestTable();
    ITableRow row = table.createRow();
    row.getCellForUpdate(0).setValue("Test");
    row.getCellForUpdate(0).setText("TestText");
    row.setStatus(ITableRow.STATUS_INSERTED);
    InternalTableRow ir = new InternalTableRow(table, row);
    assertEquals(row.getStatus(), ir.getStatus());
    assertEquals(table, ir.getTable());
    assertEquals("Test", ir.getCellForUpdate(0).getValue());
    assertEquals("TestText", ir.getCellForUpdate(0).getText());
}
Also used : ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) Test(org.junit.Test)

Aggregations

ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)127 Test (org.junit.Test)77 ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)47 ArrayList (java.util.ArrayList)23 JSONObject (org.json.JSONObject)22 TableWith3Cols (org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWith3Cols)16 JSONArray (org.json.JSONArray)13 JsonEvent (org.eclipse.scout.rt.ui.html.json.JsonEvent)12 ITableRowFilter (org.eclipse.scout.rt.client.ui.basic.table.ITableRowFilter)11 AbstractTable (org.eclipse.scout.rt.client.ui.basic.table.AbstractTable)7 IProposalField (org.eclipse.scout.rt.client.ui.form.fields.smartfield.IProposalField)7 ListBoxTable (org.eclipse.scout.rt.ui.html.json.table.fixtures.ListBoxTable)6 IMixedSmartField (org.eclipse.scout.rt.client.ui.form.fields.smartfield.IMixedSmartField)5 Table (org.eclipse.scout.rt.ui.html.json.table.fixtures.Table)5 TableWithLongColumn (org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithLongColumn)5 DecimalFormat (java.text.DecimalFormat)4 List (java.util.List)4 Cell (org.eclipse.scout.rt.client.ui.basic.cell.Cell)4 ICell (org.eclipse.scout.rt.client.ui.basic.cell.ICell)4 IColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)4