KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > raptus > owxv3 > api > components > CmpCategoryBean


1 /*
2  * eAdmin/OWX
3  * Copyright (C) 1996-2003 OWX-Project Team <owx-team@gmx.net>
4  */

5
6 package com.raptus.owxv3.api.components;
7
8 import java.util.Vector JavaDoc;
9
10 import com.raptus.owxv3.api.CategorySelector;
11
12 /**
13  *
14  * <hr>
15  * <table width="100%" border="0">
16  * <tr>
17  * <td width="24%"><b>Filename</b></td><td width="76%">CmpCategoryBean.java</td>
18  * </tr>
19  * <tr>
20  * <td width="24%"><b>Author</b></td><td width="76%">REEA</td>
21  * </tr>
22  * <tr>
23  * <td width="24%"><b>Date</b></td><td width="76%">10th of December 2001</td>
24  * </tr>
25  * </table>
26  * <hr>
27  * <table width="100%" border="0">
28  * <tr>
29  * <td width="24%"><b>Date / Author</b></td><td width="76%"><b>Changes</b></td>
30  * </tr>
31  * </table>
32  * <hr>
33  */

34 public class CmpCategoryBean extends ComponentBean
35 {
36    /**
37      *The category selector object, this is used to display the category
38      * tree and to hold the linked categories to the currently edited item
39      */

40     protected CategorySelector catSelector = null;
41
42
43     /**
44      *Getter method of catSelector
45      */

46     public CategorySelector getCategorySelector() { return catSelector; }
47
48
49     /**
50      *Setter method of catSelector
51      */

52     public void setCategorySelector(CategorySelector cs){ this.catSelector = cs; }
53
54
55
56     /**
57      *This method maps to CategorySelector.getCategories(currentlocale)
58      * @return Vector of PairOfObjects with (GResCategory,String)
59      */

60
61     public Vector JavaDoc getCategories()
62     {
63         if(catSelector==null) return null;
64         return catSelector.getCategories(getCurrLocale());
65     }
66
67
68     /**
69      *This method maps to CategorySelector.getGresCategories(currentlocale)
70      * @return Vector of GResCategory
71      */

72
73     public Vector JavaDoc getGResCategories()
74     {
75
76         if(catSelector==null) return null;
77         return catSelector.getGResCategories();
78     }
79
80     /**
81      *This method maps to CategorySelector.getGresCategories(currentlocale)
82      * @return Vector of String category_names
83      */

84     public Vector JavaDoc getCategoryNames()
85     {
86         if(catSelector==null) return null;
87         return catSelector.getCategoryNames(getCurrLocale());
88
89     }
90
91     /**
92      *This method maps to CategorySelector.getFolderStatus()
93      * @return Vector of String that describe the state of a folder
94      */

95
96     public Vector JavaDoc getFolderStatus()
97     {
98         if(catSelector==null) return null;
99         return catSelector.getFolderStatus();
100     }
101
102     /**
103      *This method maps to CategorySelector.togelFolder(x)
104      * @param x the id of the category(folder) that should be toggled
105      */

106
107
108     public void togleFolder(String JavaDoc s)
109     {
110         if(catSelector==null) return;
111         catSelector.togleFolder(s);
112     }
113
114     /**
115      *This method maps to CategorySelector.getLinkedCategories()
116      * @return Vector of linked categories IDs i.e. the categories in wich this item is contained
117      */

118     public Vector JavaDoc getLinkedCategories()
119     {
120         if(catSelector==null) return null;
121         return catSelector.getLinkedCategories();
122     }
123
124
125     /**
126      *This method maps to CategorySelector.linkItemToCategory(catid)
127      * @param catid indetifies the Category to wich we add this item
128      * @return true if the item was added succesfully to category, false if the category is full
129      */

130     public boolean linkItemToCategory(int catid)
131     {
132         if(catSelector==null) return true;
133         return catSelector.linkItemToCategory(catid);
134     }
135
136
137     /**
138      *This method maps to CategorySelector.unlinkItemToCategory(catid)
139      * @param catid indetifies the Category from wich we remove this item
140      */

141     public void unlinkItemFromCategory(int catid)
142     {
143         if(catSelector==null) return;
144         catSelector.unlinkItemFromCategory(catid);
145     }
146
147     /**
148      *This method maps to CategorySelector.getTree(id,currentlocale)
149      * @return Vector of Strings with the name of each parent category of the category with id 'id'
150      */

151     public Vector JavaDoc getTree(int id)
152     {
153         if(catSelector==null) return null;
154         return catSelector.getTree(id,getCurrLocale());
155     }
156     
157     /**
158      *This method maps to CategorySelector.getTree(id,currentlocale)
159      * @return String with the name of the category with id 'id'
160      */

161     public String JavaDoc getCategoryName(int id)
162     {
163         if(catSelector==null) return null;
164         return catSelector.getCategoryName(id,getCurrLocale());
165     }
166     
167
168
169 }
170
171 // eof
172
Popular Tags