Package org.codehaus.jackson.map.ser

Examples of org.codehaus.jackson.map.ser.TestRootType$BaseType



  /********************************************************************************/
  public Object getChild( Object parentNode, int index )
  {
    BaseType baseType = (BaseType) parentNode;

    //logger.debug( "getChild()  parentNode: " + baseType.getTitle() + "  index: " + index + "  returns: " + baseType.getItem().get( index ).getTitle() );

    return baseType.getItem().get( index );
  }
View Full Code Here



  /********************************************************************************/
  public int getChildCount( Object parentNode )
  {
    BaseType baseType = (BaseType) parentNode;

    //logger.debug( "getChildCount()  parentNode: " + baseType.getTitle() );

    return baseType.getItem().size();
  }
View Full Code Here


  /********************************************************************************/
  public int getIndexOfChild( Object parentNode, Object childNode )
  {
    BaseType parent = (BaseType) parentNode;
    BaseType child = (BaseType) childNode;

    //logger.debug( "getIndexOfChild()  parent: " + parent.getTitle() + "   child: " + parent.getTitle() );

    return parent.getItem().indexOf( child );
  }
View Full Code Here

    {
      return false;
    }
    else
    {
      BaseType baseType = (BaseType) node;
      return (baseType.getItem().size() == 0);
    }
  }
View Full Code Here


  /********************************************************************************/
  public void valueForPathChanged( TreePath treePath, Object string )
  {
    BaseType baseType = (BaseType) treePath.getLastPathComponent();
    baseType.setTitle( (String) string );
  }
View Full Code Here


  /********************************************************************************/
  public void addNode( TreePath treePathToParent, ItemType itemType )
  {
    BaseType baseType = (BaseType) treePathToParent.getLastPathComponent();
    baseType.getItem().add( 0, itemType );

    this.fireModelChanged( treePathToParent );
  }
View Full Code Here


  /********************************************************************************/
  public void removeNode( TreePath pathToNodeForRemoval )
  {
    BaseType selectedNode = (BaseType) pathToNodeForRemoval.getLastPathComponent();
    BaseType parentNode = (BaseType) pathToNodeForRemoval.getParentPath().getLastPathComponent();

    parentNode.getItem().remove( selectedNode );

    this.fireModelChanged( pathToNodeForRemoval.getParentPath() );
  }
View Full Code Here

   * Adds a node to the currently selected node
   *
   *******************************************************************************/
  public void addNode()
  {
    BaseType selectedNode = this.getSelectedNode()

    if( selectedNode != null )
    {
      logger.finer( "adding node to: '" + selectedNode.getTitle() + "'" );

      ItemType newNode = new ItemType();
      newNode.setTitle( "New Item" );
      newNode.setType( TaskType.TASK );

View Full Code Here

  @Override
  public boolean importData( JComponent jComponent, Transferable transferable )
  {
    JTree jTree = (JTree) jComponent;   
    BaseType target = (BaseType) jTree.getSelectionPath().getLastPathComponent();   

    try
    {
      ItemType source = (ItemType) transferable.getTransferData( ITEM_TYPE_DATA_FLAVOR );
      target.getItem().add( source );
     
     
      //System.out.println( "BEFORE---this.parent.getItem().size()= " + this.parent.getItem().size() );
     
      this.parent.getItem().remove( source );     
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.map.ser.TestRootType$BaseType

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.