KickJava   Java API By Example, From Geeks To Geeks.

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


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: JProfileTreeItem.java,v 1.8 2007/02/23 21:54:24 popolony2k Exp $
32  * $Author: popolony2k $
33  * $Name: $
34  * $Revision: 1.8 $
35  * $State: Exp $
36  *
37  */

38
39
40 package org.planetamessenger.mos.ui;
41
42 import org.planetamessenger.mos.engine.*;
43
44
45 public class JProfileTreeItem {
46   
47   static public final int TYPE_NONE = 0;
48   static public final int TYPE_PROFILE = 1;
49   static public final int TYPE_PLUGIN = 2;
50   static public final int TYPE_LOOKNFEEL = 4;
51
52   String JavaDoc strText;
53   JLookAndFeelInfo plafInfo;
54   int nPluginId;
55   int nProfileId;
56   int nItemType;
57    
58   
59
60   /**
61    * Constructs and initializes a JProfileTreeItem
62    * class data.
63    */

64   public JProfileTreeItem() {
65
66     strText = "";
67     nPluginId = -1;
68     nProfileId = -1;
69     nItemType = TYPE_NONE;
70     plafInfo = null;
71   }
72
73   /**
74    * Constructs and initializes all
75    * class data.
76    * @param strText The object text;
77    * @param nProfileId The ProfileId data;
78    * @param nPluginId The PluginId data;
79    * @param plafInfo The Look and feel info;
80    * @param nItemType The item type data;
81    */

82   public JProfileTreeItem( String JavaDoc strText, int nProfileId, int nPluginId, JLookAndFeelInfo plafInfo, int nItemType ) {
83     
84     this.strText = strText;
85     this.nProfileId = nProfileId;
86     this.nPluginId = nPluginId;
87     this.plafInfo = plafInfo;
88     this.nItemType = nItemType;
89   }
90
91   /**
92    * Set the item text.
93    * @param strText The new item text;
94    */

95   public void setText( String JavaDoc strText ) {
96     
97     this.strText = strText;
98   }
99
100   /**
101    * Returns the item text.
102    */

103   public String JavaDoc getText() {
104    
105     return strText;
106   }
107
108   /**
109    * Sets the PluginId of this object;
110    * @param nPluginId The new PluginId;
111    */

112   public void setPluginId( int nPluginId ) {
113     
114     this.nPluginId = nPluginId;
115   }
116
117   /**
118    * Returns the PluginId of this
119    * object;
120    */

121   public int getPluginId() {
122     
123     return nPluginId;
124   }
125
126   /**
127    * Set the profile id of this object.
128    * @param nProfileId The new profileid
129    * of this object;
130    */

131   public void setProfileId( int nProfileId ) {
132     
133     this.nProfileId = nProfileId;
134   }
135
136   /**
137    * Returns the profile id of this
138    * object;
139    */

140   public int getProfileId() {
141     
142     return nProfileId;
143   }
144
145   /**
146    * Set the object type.
147    * @param nItemType The new item type;
148    */

149   public void setItemType( int nItemType ) {
150     
151     this.nItemType = nItemType;
152   }
153
154   /**
155    * Gets the object item type.
156    */

157   public int getItemType() {
158     
159     return nItemType;
160   }
161   
162   /**
163    * Set the Look and Feel information object.
164    * @param plafInfo Yhe Look and feel info object;
165    */

166   public void setLookAndFeelInfo( JLookAndFeelInfo plafInfo ) {
167    
168     this.plafInfo = plafInfo;
169     
170     if( plafInfo == null )
171       strText = "";
172     else
173       strText = plafInfo.getName();
174   }
175   
176   /**
177    * Return the Look and Feel info object.
178    */

179   public JLookAndFeelInfo getLookAndFeelInfo() {
180     
181     return plafInfo;
182   }
183
184   /**
185    * Overloads the toString method to
186    * show the new String representation
187    * of this class.
188    */

189   public String JavaDoc toString() {
190     
191     return strText;
192   }
193 }
194
195 // JProfileTreeItem class
196
Popular Tags