Search in sources :

Example 1 with CellProvider

use of org.jdesktop.swingx.ux.CellProvider in project GsonFormat by zzz40500.

the class FiledTreeTableModel method getValueAt.

/**
     * 返回在单元格中显示的Object
     */
@Override
public Object getValueAt(Object node, int column) {
    Object value = "";
    if (node instanceof DefaultMutableTreeTableNode) {
        DefaultMutableTreeTableNode mutableNode = (DefaultMutableTreeTableNode) node;
        Object o = mutableNode.getUserObject();
        if (o != null && o instanceof CellProvider) {
            CellProvider cellProvider = (CellProvider) o;
            value = cellProvider.getCellTitle(column);
        }
    }
    return value;
}
Also used : CellProvider(org.jdesktop.swingx.ux.CellProvider) DefaultMutableTreeTableNode(org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode)

Example 2 with CellProvider

use of org.jdesktop.swingx.ux.CellProvider in project GsonFormat by zzz40500.

the class FiledTreeTableModel method setValueAt.

@Override
public void setValueAt(Object value, Object node, int column) {
    super.setValueAt(value, node, column);
    if (node instanceof DefaultMutableTreeTableNode) {
        DefaultMutableTreeTableNode mutableNode = (DefaultMutableTreeTableNode) node;
        Object o = mutableNode.getUserObject();
        if (o != null && o instanceof CellProvider) {
            CellProvider cellProvider = (CellProvider) o;
            cellProvider.setValueAt(column, value.toString());
        }
    }
}
Also used : CellProvider(org.jdesktop.swingx.ux.CellProvider) DefaultMutableTreeTableNode(org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode)

Aggregations

DefaultMutableTreeTableNode (org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode)2 CellProvider (org.jdesktop.swingx.ux.CellProvider)2