Examples of DataSetTableModel


Examples of org.apache.metamodel.data.DataSetTableModel

        CsvDataContext dc = new CsvDataContext(file, semicolonConfiguration);
        Table table = dc.getDefaultSchema().getTables()[0];
        Query query = new Query().from(table).select(table.getColumns()).setMaxRows(5);
        DataSet dataSet = dc.executeQuery(query);

        TableModel tableModel = new DataSetTableModel(dataSet);
        assertEquals(5, tableModel.getRowCount());
    }
View Full Code Here

Examples of org.apache.metamodel.data.DataSetTableModel

        + "Schema[name=sakila], Schema[name=world]]", Arrays.toString(schemas));

    Table table = dc.getSchemaByName("sakila").getTableByName("film");
    Query q = new Query().from(table).select(table.getColumns());
    DataSet data = dc.executeQuery(q);
    TableModel tableModel = new DataSetTableModel(data);
    assertEquals(13, tableModel.getColumnCount());
    assertEquals(1000, tableModel.getRowCount());
  }
View Full Code Here

Examples of org.apache.metamodel.data.DataSetTableModel

    FilterItem f1 = new FilterItem(q.getSelectClause().getItem(0), OperatorType.EQUALS_TO, 5);
    FilterItem f2 = new FilterItem(q.getSelectClause().getItem(0), OperatorType.EQUALS_TO, 8);
    q.where(new FilterItem(f1, f2));

    DataSet dataSet = dc.executeQuery(q);
    TableModel tableModel = new DataSetTableModel(dataSet);
    assertEquals(4, tableModel.getColumnCount());
    assertEquals(2, tableModel.getRowCount());
    assertEquals("LOLLOBRIGIDA", tableModel.getValueAt(0, 2));

    q.setMaxRows(1);
    dataSet = dc.executeQuery(q);
    tableModel = new DataSetTableModel(dataSet);
    assertEquals(4, tableModel.getColumnCount());
    assertEquals(1, tableModel.getRowCount());
    assertEquals("LOLLOBRIGIDA", tableModel.getValueAt(0, 2));
   
    q.setMaxRows(1);
    q.setFirstRow(2);
        dataSet = dc.executeQuery(q);
        tableModel = new DataSetTableModel(dataSet);
        assertEquals(4, tableModel.getColumnCount());
        assertEquals(1, tableModel.getRowCount());
        assertEquals("JOHANSSON", tableModel.getValueAt(0, 2));

    q.getWhereClause().removeItems();
    q.setMaxRows(25);
    q.setFirstRow(1);
    dataSet = dc.executeQuery(q);
    tableModel = new DataSetTableModel(dataSet);
    assertEquals(4, tableModel.getColumnCount());
    assertEquals(25, tableModel.getRowCount());
    assertEquals("GUINESS", tableModel.getValueAt(0, 2).toString());
  }
View Full Code Here

Examples of org.jboss.dashboard.displayer.table.DataSetTableModel

    protected String getSortIcon(TableColumn column, int columnIndex) {
        // Sorting in case of a Data Set Table Model.
        DataSetTable dst = (DataSetTable) tableHandler.getTable();
        if (isColumnSortable(column)) {
            DataSetTableModel dsModel = (DataSetTableModel) dst.getModel();
            String modelIndex = Integer.toString(dsModel.getColumnPosition(column.getPropertyId()));
            ComparatorByCriteria comparator = tableHandler.getTableComparator();
            int order = 0;
            if (comparator.existCriteria(modelIndex)) order = comparator.getSortCriteriaOrdering(modelIndex);
            switch(order) {
                case 1: return ICON_ORDER_DOWN;
View Full Code Here

Examples of org.jboss.dashboard.displayer.table.DataSetTableModel

    protected String getSortIcon(TableColumn column, int columnIndex) {
        // Sorting in case of a Data Set Table Model.
        DataSetTable dst = (DataSetTable) tableHandler.getTable();
        if (isColumnSortable(column)) {
            DataSetTableModel dsModel = (DataSetTableModel) dst.getModel();
            String modelIndex = Integer.toString(dsModel.getColumnPosition(column.getPropertyId()));
            ComparatorByCriteria comparator = tableHandler.getTableComparator();
            int order = 0;
            if (comparator.existCriteria(modelIndex)) order = comparator.getSortCriteriaOrdering(modelIndex);
            switch(order) {
                case 1: return ICON_ORDER_DOWN;
View Full Code Here

Examples of org.jboss.dashboard.displayer.table.DataSetTableModel

    protected String getSortIcon(TableColumn column, int columnIndex) {
        // Sorting in case of a Data Set Table Model.
        DataSetTable dst = (DataSetTable) tableHandler.getTable();
        if (isColumnSortable(column)) {
            DataSetTableModel dsModel = (DataSetTableModel) dst.getModel();
            String modelIndex = Integer.toString(dsModel.getColumnPosition(column.getPropertyId()));
            ComparatorByCriteria comparator = dsModel.getComparator();
            int order = 0;
            if (comparator.existCriteria(modelIndex)) order = comparator.getSortCriteriaOrdering(modelIndex);
            switch(order) {
                case 1: return ICON_ORDER_DOWN;
                case -1: return ICON_ORDER_UP;
View Full Code Here

Examples of org.jboss.dashboard.displayer.table.DataSetTableModel

    protected String getSortIcon(TableColumn column, int columnIndex) {
        // Sorting in case of a Data Set Table Model.
        DataSetTable dst = (DataSetTable) tableHandler.getTable();
        if (isColumnSortable(column)) {
            DataSetTableModel dsModel = (DataSetTableModel) dst.getModel();
            String modelIndex = Integer.toString(dsModel.getColumnPosition(column.getPropertyId()));
            ComparatorByCriteria comparator = tableHandler.getTableComparator();
            int order = 0;
            if (comparator.existCriteria(modelIndex)) order = comparator.getSortCriteriaOrdering(modelIndex);
            switch(order) {
                case 1: return ICON_ORDER_DOWN;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.