KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > tutorial > modules > actions > portlets > ExampleBrowserItem


1 /*
2  * Copyright 2000-2001,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.jetspeed.tutorial.modules.actions.portlets;
17
18 import java.io.Serializable JavaDoc;
19 /**
20  * Use this class to store extended info for your browser object
21  *
22  * @author <a HREF="mailto:taylor@apache.org">David Sean Taylor</a>
23  * @version $Id: ExampleBrowserItem.java,v 1.1 2004/04/08 17:03:54 taylor Exp $
24  */

25 public class ExampleBrowserItem implements Serializable JavaDoc
26 {
27     boolean expanded = false;
28     int checked = -1;
29     int index = -1;
30     int type = -3;
31     int level = 0;
32     ExampleBrowserItem parent = null;
33     int oldChecked = -1;
34         
35
36     public ExampleBrowserItem()
37     {
38     }
39
40     public void init(int type,
41                      int index,
42                      int level,
43                      boolean expanded,
44                      ExampleBrowserItem parent,
45                      int checked)
46     {
47         this.index = index;
48         this.expanded = expanded;
49         this.type = type;
50         this.level = level;
51         this.parent = parent;
52         this.checked= checked;
53         this.oldChecked = checked;
54     }
55
56     public boolean isExpanded()
57     {
58         return this.expanded;
59     }
60
61     public boolean isChecked()
62     {
63         return (this.checked > -1);
64     }
65
66     public boolean isOldChecked()
67     {
68         return (this.oldChecked > -1);
69     }
70
71     public void toggleExpanded()
72     {
73         this.expanded = !this.expanded;
74     }
75
76     public void setExpanded(boolean expanded)
77     {
78         this.expanded = expanded;
79     }
80
81     public boolean getExpanded()
82     {
83         return this.expanded;
84     }
85
86     public int getIndex()
87     {
88         return this.index;
89     }
90
91     public int getType()
92     {
93         return this.type;
94     }
95
96     public void setChecked(int checked)
97     {
98         this.checked = checked;
99     }
100
101     public void setOldChecked(int oldChecked)
102     {
103         this.oldChecked = oldChecked;
104     }
105
106     public int getLevel()
107     {
108         return this.level;
109     }
110
111     public ExampleBrowserItem getParent()
112     {
113         return this.parent;
114     }
115
116     public void setLevel(int level)
117     {
118         this.level = level;
119     }
120 }
121
122
123
Popular Tags