Package org.gwtoolbox.widget.client.data

Examples of org.gwtoolbox.widget.client.data.Record$FieldChangeEvent


        final DataGrid grid = new DataGrid(columns);
        grid.setEditInPlace(true);
        grid.setSize("100%", "250px");
        grid.setSelectionModel(new SingleRowSelectionModel());

        Record record = new MapRecord()
                .setValue("firstName", "Uri")
                .setValue("lastName", "Boness")
                .setIntValue("age", 33)
                .setValue("gender", Gender.MALE)
                .setValue("birthTime", new Time(5))
View Full Code Here


    }

    public void getAll(SortSpec sortSpec, final AsyncCallback<List<Record>> callback) {
        final ArrayList<Record> records = new ArrayList<Record>(people.size());
        for (Person person : people) {
            Record record = personToRecord(person);
            records.add(record);
        }
        if (sortSpec != null) {
            Collections.sort(records, new SortSpecComparator<Record>(sortSpec));
        }
View Full Code Here

        int start = pageIndex * pageSize;
        int lastPage = list.size() / pageSize;
        int end = (lastPage == pageIndex) ? list.size() : start + pageSize;
        for (int i = start; i < end; i++) {
            Person person = list.get(i);
            Record record = personToRecord(person);
            records.add(record);
        }
        final Page<Record> page = new Page<Record>(pageIndex, pageSize, list.size(), records);
        callback.onSuccess(page);
//        new Timer() {
View Full Code Here

            public void selectionCleared() {
                notifySelectionCleared();
            }

            public void rowSelected(int row) {
                Record record = (Record) SingleRecordSelectionModel.this.table.getUserData(row, 0);
                notifyRecordSelected(record);
            }
        });
    }
View Full Code Here

    public void selectRecord(Record record) {
        for (int row = 0; row < table.getRowCount(); row++) {
            if (table.isToolRow(row)) {
                continue;
            }
            Record rowRecord = (Record) table.getUserData(row, 0);
            if (rowRecord.equals(record)) {
                selectionModel.selectRow(row);
                return;
            }
        }
    }
View Full Code Here

            }
        }
    }

    public boolean isRecordSelected(Record record) {
        Record selectedRecord = getSelectedRecord();
        return selectedRecord == null ? false : selectedRecord.equals(record);
    }
View Full Code Here

    private static native int getRowIndex(com.google.gwt.dom.client.Element row) /*-{
        return row.rowIndex;
    }-*/;

    private void setRocordInRow(final TableRowElement rowElement, Record record) {
        Record removed = recordByRow.put(rowElement, record);
        if (removed != null) {
            ChangeListener<Record> listener = listenerByRecord.get(removed);
            removed.removeChangeListener(listener);
        }

        ChangeListener<Record> listener = new ChangeListener<Record>() {
            public void onChange(Record record) {
                setRocordInRow(rowElement, record);
View Full Code Here

            columns[i].getCellRenderer().render(rowCellContent.<Element>cast(), record, value, columns[i].getType());
        }
    }

    private void clearRecordInRow(TableRowElement rowElement) {
        Record removed = recordByRow.remove(rowElement);
        if (removed != null) {
            ChangeListener<Record> listener = listenerByRecord.get(removed);
            removed.removeChangeListener(listener);
        }
    }
View Full Code Here

*/
public abstract class SingleRecordSelectionListener implements SingleRowSelectionModel.Listener {

    public final void rowSelected(int row, SingleRowSelection selection) {
        DataGrid grid = selection.getTable();
        Record record = grid.getRecordInRow(row);
        recordSelected(record);
    }
View Full Code Here

                selectedRecords.clear();
                notifySelectionCleared();
            }

            public void rowSelected(int row, MultiRowSelection model) {
                Record record = (Record) MultiRecordSelectionModel.this.table.getUserData(row, 0);
                selectedRecords.add(record);
                notifyRecordSelected(record);
            }

            public void rowUnselected(int row, MultiRowSelection model) {
                Record record = (Record) MultiRecordSelectionModel.this.table.getUserData(row, 0);
                selectedRecords.remove(record);
                notifyRecordUnselected(record);
            }

        });
View Full Code Here

TOP

Related Classes of org.gwtoolbox.widget.client.data.Record$FieldChangeEvent

Copyright © 2018 www.massapicom. 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.