001 package com.sptci.rwt.webui.tree;
002
003 import com.sptci.echo2.Configuration;
004 import com.sptci.rwt.MetaData;
005
006 /**
007 * An abstract {@link echopointng.tree.TreeNode} that represents {@link
008 * com.sptci.rwt.MetaData} objects.
009 *
010 * <p>© Copyright 2007 <a href='http://sptci.com/' target='_new'>Sans Pareil Technologies, Inc.</a></p>
011 * @author Rakesh Vidyadharan 2007-09-28
012 * @version $Id: ContainerNode.java 4123 2008-05-25 21:49:01Z rakesh $
013 */
014 public abstract class ContainerNode<S extends MetaData> extends AbstractNode<S>
015 {
016 /** The {@link com.sptci.rwt.MetaData} object associated with this node. */
017 protected final S metadata;
018
019 /**
020 * Create a new tree node using the specified metadata object. The
021 * object represents a table in the database.
022 *
023 * @param metadata The model object for this node.
024 */
025 public ContainerNode( final S metadata )
026 {
027 super();
028 setAllowsChildren( true );
029 setUserObject( toString() );
030 this.metadata = metadata;
031 }
032
033 /**
034 * Return the display title for this node. Over-ridden to return the
035 * localised title for this node.
036 *
037 * @return The display title for this node.
038 */
039 @Override
040 public String toString()
041 {
042 return Configuration.getString( this, "title" );
043 }
044 }