KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > planetamessenger > mos > ui > JProfileMutableTreeNode


1 /*
2     =========================================================================
3     Package ui - Implements user interface components
4
5     This module is developed and maintained by PlanetaMessenger.org.
6     Specs, New and updated versions can be found in
7     http://www.planetamessenger.org
8     If you want contact the Team please send a email to Project Manager
9     Leidson Campos Alves Ferreira at leidson@planetamessenger.org
10
11     Copyright (C) since 2001 by PlanetaMessenger.org
12
13     This program is free software; you can redistribute it and/or modify
14     it under the terms of the GNU General Public License as published by
15     the Free Software Foundation; either version 2 of the License, or
16     (at your option) any later version.
17
18     This program is distributed in the hope that it will be useful,
19     but WITHOUT ANY WARRANTY; without even the implied warranty of
20     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21     GNU General Public License for more details.
22
23     You should have received a copy of the GNU General Public License
24     along with this program; if not, write to the Free Software
25     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
27     =========================================================================
28 */

29 /**
30  *
31  * $Id: JProfileMutableTreeNode.java,v 1.6 2007/01/28 17:39:20 popolony2k Exp $
32  * $Author: popolony2k $
33  * $Name: $
34  * $Revision: 1.6 $
35  * $State: Exp $
36  *
37  */

38
39 package org.planetamessenger.mos.ui;
40
41
42
43 public class JProfileMutableTreeNode extends javax.swing.tree.DefaultMutableTreeNode JavaDoc {
44
45
46   /**
47    * Constructs a JProfileMutableTreeNode
48    * and initializes all class data.
49    * @param userObject The user object that
50    * will be attached in this class;
51    */

52   public JProfileMutableTreeNode( java.lang.Object JavaDoc userObject ) {
53   
54     super( userObject );
55   }
56
57   /**
58    * Set a new user object to this class.
59    * @param userObject The new user object
60    * that will replace the older user
61    * object;
62    */

63   public void setUserObject( java.lang.Object JavaDoc userObject ) {
64     
65     JProfileTreeItem item = ( JProfileTreeItem ) getUserObject();
66     
67     
68     if( JProfileTree.checkProfile( userObject.toString() ) )
69       return;
70
71     if( item.getItemType() == JProfileTreeItem.TYPE_PROFILE ) {
72       item.setText( userObject.toString() );
73     }
74     
75     super.setUserObject( item );
76   }
77 }
78
79 // JProfileMutableTreeNode class
80
Popular Tags