001/* 002 * $Id: DefaultMutableTreeTableNode.java 3780 2010-09-09 16:17:41Z kschaefe $ 003 * 004 * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, 005 * Santa Clara, California 95054, U.S.A. All rights reserved. 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * You should have received a copy of the GNU Lesser General Public 018 * License along with this library; if not, write to the Free Software 019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 020 */ 021package org.jdesktop.swingx.treetable; 022 023/** 024 * A default implementation of an {@code AbstractMutableTreeTableNode} that 025 * returns {@code getUserObject().toString()} for all value queries. This 026 * implementation is designed mainly for testing. It is NOT recommended to use 027 * this implementation. Any user that needs to create {@code TreeTableNode}s 028 * should consider directly extending {@code AbstractMutableTreeTableNode} or 029 * directly implementing the interface. 030 * 031 * @author Karl Schaefer 032 */ 033public class DefaultMutableTreeTableNode extends AbstractMutableTreeTableNode { 034 035 /** 036 * 037 */ 038 public DefaultMutableTreeTableNode() { 039 super(); 040 } 041 042 /** 043 * @param userObject 044 */ 045 public DefaultMutableTreeTableNode(Object userObject) { 046 super(userObject); 047 } 048 049 /** 050 * @param userObject 051 * @param allowsChildren 052 */ 053 public DefaultMutableTreeTableNode(Object userObject, boolean allowsChildren) { 054 super(userObject, allowsChildren); 055 } 056 057 /** 058 * {@inheritDoc} 059 */ 060 @Override 061 public Object getValueAt(int column) { 062 return getUserObject(); 063 } 064 065 /** 066 * {@inheritDoc} 067 */ 068 @Override 069 public int getColumnCount() { 070 return 1; 071 } 072 073 /** 074 * {@inheritDoc} 075 */ 076 @Override 077 public boolean isEditable(int column) { 078 return true; 079 } 080 081 /** 082 * {@inheritDoc} 083 */ 084 @Override 085 public void setValueAt(Object aValue, int column) { 086 setUserObject(aValue); 087 } 088}