KickJava   Java API By Example, From Geeks To Geeks.

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


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.api.LinksSelector;
15 /**
16  *
17  * <hr>
18  * <table width="100%" border="0">
19  * <tr>
20  * <td width="24%"><b>Filename</b></td><td width="76%">CmpLinksBean.java</td>
21  * </tr>
22  * <tr>
23  * <td width="24%"><b>Author</b></td><td width="76%">Guy Zürcher (gzuercher@raptus.com)</td>
24  * </tr>
25  * <tr>
26  * <td width="24%"><b>Date</b></td><td width="76%">28th of June 2001</td>
27  * </tr>
28  * </table>
29  * <hr>
30  * <table width="100%" border="0">
31  * <tr>
32  * <td width="24%"><b>Date / Author</b></td><td width="76%"><b>Changes</b></td>
33  * </tr>
34  * </table>
35  * <hr>
36  */

37 public class CmpLinksBean extends ComponentBean
38 {
39     /**
40      *
41      */

42     protected String JavaDoc urlToAdd = null;
43
44
45     /**
46      *
47      */

48     protected String JavaDoc[] title = null;
49
50
51     /**
52      *
53      */

54     protected LinksSelector linksSelector = null;
55
56
57     /**
58      *
59      */

60     public String JavaDoc getUrlToAdd() { return urlToAdd; }
61     public void setUrlToAdd(String JavaDoc url) { this.urlToAdd = url; }
62
63     /**
64      *
65      */

66     public String JavaDoc[] getTitle() { return title; }
67     public void setTitle(String JavaDoc[] t) { this.title = t; }
68
69
70     /**
71      *
72      */

73     public LinksSelector getLinksSelector() { return linksSelector; }
74     public void setLinksSelector(LinksSelector ls) { this.linksSelector = ls; }
75
76
77
78
79
80     /**
81      *
82      */

83
84     public Vector JavaDoc getLinkList(){
85         if(linksSelector==null) return null;
86         return linksSelector.getLinkList( getCurrLocale() );
87     }
88
89
90
91     /**
92      *
93      */

94     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request)
95     {
96         super.reset(mapping, request);
97     }
98
99     /**
100      *
101      */

102     public int populateViewFields()
103     {
104         if(urlToAdd != null && title!=null)
105         {
106             int ret=linksSelector.addLink(urlToAdd,title);
107             //if(ret) setComponentChanged(true);
108
urlToAdd = null;
109             title=null;
110             return ret;
111         }
112         return 1;
113     }
114
115 }
116
117 // eof
118
Popular Tags