Search in sources :

Example 1 with ErrorData

use of net.sourceforge.processdash.ui.lib.binding.ErrorData in project processdash by dtuma.

the class BoundDefectData method updateDefects.

public void updateDefects() {
    ErrorData error = form.getErrorDataForAttr("defects");
    if (error != null) {
        this.errorData = error;
        setDefectData(Collections.EMPTY_LIST);
    } else {
        Object newValue = form.get("defects");
        this.errorData = null;
        if (newValue instanceof List)
            setDefectData((List) newValue);
        else
            setDefectData(Collections.EMPTY_LIST);
    }
}
Also used : List(java.util.List) ErrorData(net.sourceforge.processdash.ui.lib.binding.ErrorData)

Example 2 with ErrorData

use of net.sourceforge.processdash.ui.lib.binding.ErrorData in project processdash by dtuma.

the class BoundDefectTable method resyncTable.

private void resyncTable() {
    selectAll.setSelected(true);
    TableColumnModel tcm = new DefaultTableColumnModel();
    for (int col = 0; col < data.getColumnCount(); col++) if (data.hasData(col))
        tcm.addColumn(tableColumns[col]);
    table.setColumnModel(tcm);
    ErrorData error = data.getErrorData();
    if (error != null) {
        messageLabel.setText(error.getError());
        messageLabel.setForeground(map.getErrorColor(error));
        cardLayout.first(this);
    } else {
        messageLabel.setText(null);
        cardLayout.last(this);
    }
}
Also used : DefaultTableColumnModel(javax.swing.table.DefaultTableColumnModel) TableColumnModel(javax.swing.table.TableColumnModel) DefaultTableColumnModel(javax.swing.table.DefaultTableColumnModel) ErrorData(net.sourceforge.processdash.ui.lib.binding.ErrorData)

Aggregations

ErrorData (net.sourceforge.processdash.ui.lib.binding.ErrorData)2 List (java.util.List)1 DefaultTableColumnModel (javax.swing.table.DefaultTableColumnModel)1 TableColumnModel (javax.swing.table.TableColumnModel)1