KickJava   Java API By Example, From Geeks To Geeks.

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


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 javax.servlet.http.HttpServletRequest JavaDoc;
11
12 import org.apache.struts.action.ActionMapping;
13
14 import com.raptus.owxv3.LoggingManager;
15 import com.raptus.owxv3.api.PicturesSelector;
16
17 /**
18  *
19  * <hr>
20  * <table width="100%" border="0">
21  * <tr>
22  * <td width="24%"><b>Filename</b></td><td width="76%">CmpPicsBean.java</td>
23  * </tr>
24  * <tr>
25  * <td width="24%"><b>Author</b></td><td width="76%">Guy Zürcher (gzuercher@raptus.com)</td>
26  * </tr>
27  * <tr>
28  * <td width="24%"><b>Date</b></td><td width="76%">28th of June 2001</td>
29  * </tr>
30  * </table>
31  * <hr>
32  * <table width="100%" border="0">
33  * <tr>
34  * <td width="24%"><b>Date / Author</b></td><td width="76%"><b>Changes</b></td>
35  * </tr>
36  * </table>
37  * <hr>
38  */

39 public class CmpPicsBean extends ComponentBean
40 {
41     /**
42      *
43      */

44     protected String JavaDoc selCategory = null;
45
46     /**
47      *
48      */

49     protected int picToLink = -1;
50
51     /**
52      *
53      */

54     protected PicturesSelector picSelector = null;
55
56
57
58
59
60     /**
61      *
62      */

63     protected String JavaDoc[] title = null;
64
65
66     /**
67      *
68      */

69     public String JavaDoc getSelCategory() { return selCategory; }
70     public void setSelCategory(String JavaDoc category) { this.selCategory = category; }
71
72     /**
73      *
74      */

75     public int getPicToLink() { return picToLink; }
76     public void setPicToLink(int picId) { this.picToLink = picId; }
77
78     /**
79      *
80      */

81     public PicturesSelector getPicsSelector() { return picSelector; }
82     public void setPicsSelector(PicturesSelector ps) { this.picSelector = ps; }
83
84     /**
85      *
86      */

87     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request)
88     {
89         super.reset(mapping, request);
90
91         selCategory = null;
92         picToLink = -1;
93     }
94
95     /**
96      *return true if the populate succeded false otherwise
97      */

98     public boolean populateViewFields()
99     {
100         if(selCategory != null)
101             picSelector.switchToCategory(selCategory);
102         else if(picToLink != -1 && title!=null)
103         {
104             boolean ret=picSelector.linkPicture(picToLink,title);
105             //if(ret) setComponentChanged(true);
106
picToLink=-1;
107             title=null;
108             return ret;
109         }
110         else
111             LoggingManager.log("Missing data for populating view fields!", this);
112         return true;
113     }
114
115
116
117
118
119     /**
120      *
121      */

122     public String JavaDoc[] getTitle() { return title; }
123     public void setTitle(String JavaDoc[] t) { this.title = t; }
124
125
126     /**
127      *
128      */

129
130     public Vector JavaDoc getLinkedPics(){
131         if(picSelector==null) return null;
132         return picSelector.getLinkedPics( getCurrLocale() );
133
134     }
135
136 }
137
138 // eof
139
Popular Tags