Search in sources :

Example 6 with BaseUiColumn

use of org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BaseUiColumn in project drools-wb by kiegroup.

the class GridWidgetColumnFactoryImplTest method columnResizingListenerSetup_ActionInsertFactColumn.

@Test
public void columnResizingListenerSetup_ActionInsertFactColumn() {
    final ActionInsertFactCol52 column = new ActionInsertFactCol52();
    column.setFactType("MyFact");
    column.setFactField("MyField");
    column.setHeader("MyColumn");
    when(oracle.getFieldType("MyFact", "MyField")).thenReturn(DataType.TYPE_STRING);
    final GridColumn<?> uiColumn = factory.convertColumn(column, access, gridWidget);
    assertTrue(uiColumn instanceof BaseUiColumn);
    assertEquals((int) uiColumn.getWidth(), column.getWidth());
    uiColumn.setWidth(200.0);
    assertEquals(200, column.getWidth());
}
Also used : ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) BaseUiColumn(org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BaseUiColumn) Test(org.junit.Test)

Example 7 with BaseUiColumn

use of org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BaseUiColumn in project drools-wb by kiegroup.

the class GridWidgetColumnFactoryImplTest method columnResizingListenerSetup_AttributeColumn.

@Test
public void columnResizingListenerSetup_AttributeColumn() {
    final AttributeCol52 column = new AttributeCol52();
    column.setAttribute(RuleAttributeWidget.SALIENCE_ATTR);
    final GridColumn<?> uiColumn = factory.convertColumn(column, access, gridWidget);
    assertTrue(uiColumn instanceof BaseUiColumn);
    assertEquals((int) uiColumn.getWidth(), column.getWidth());
    uiColumn.setWidth(200.0);
    assertEquals(200, column.getWidth());
}
Also used : AttributeCol52(org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52) BaseUiColumn(org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BaseUiColumn) Test(org.junit.Test)

Example 8 with BaseUiColumn

use of org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BaseUiColumn in project drools-wb by kiegroup.

the class GridWidgetColumnFactoryImplTest method columnResizingListenerSetup_RowNumberColumn.

@Test
public void columnResizingListenerSetup_RowNumberColumn() {
    final BaseColumn column = new RowNumberCol52();
    final GridColumn<?> uiColumn = factory.convertColumn(column, access, gridWidget);
    assertFalse(uiColumn instanceof BaseUiColumn);
    assertEquals((int) uiColumn.getWidth(), column.getWidth());
    assertEquals(50.0, column.getWidth(), 0.0);
}
Also used : BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) BaseUiColumn(org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BaseUiColumn) RowNumberCol52(org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52) Test(org.junit.Test)

Aggregations

BaseUiColumn (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.BaseUiColumn)8 Test (org.junit.Test)7 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)3 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)2 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)1 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)1 AttributeCol52 (org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52)1 CompositeColumn (org.drools.workbench.models.guided.dtable.shared.model.CompositeColumn)1 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)1 DescriptionCol52 (org.drools.workbench.models.guided.dtable.shared.model.DescriptionCol52)1 MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)1 RowNumberCol52 (org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52)1 BaseColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.BaseColumnConverter)1