KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > patterns > listdata > www > ListDataSpecificPageTag


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: ListDataSpecificPageTag.java,v 1.2 2007/02/20 04:18:18 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21  
22 package org.opensubsystems.patterns.listdata.www;
23
24 import org.opensubsystems.patterns.listdata.data.ListOptions;
25
26
27 /**
28  * Custom tag to generate hyperlink that can invoke instance of
29  * ListBrowserServlet and display a specific page. This class implements
30  * functionality similar to methods in listdata.js but only based on the data
31  * available at the time when the page is generated. If the page dynamically
32  * changes some of the list data pattern variables for example based on users'
33  * action, you should use methods in the listdata.js instead. Keep this
34  * functionality synchronized with the one provided by the JavaScript file.
35  *
36  * @version $Id: ListDataSpecificPageTag.java,v 1.2 2007/02/20 04:18:18 bastafidli Exp $
37  * @author Miro Halas
38  * @code.reviewer Miro Halas
39  * @code.reviewed Initial revision
40  */

41 public class ListDataSpecificPageTag extends ListDataActionTag
42 {
43    // Attributes ///////////////////////////////////////////////////////////////
44

45    /**
46     * Generated serial version UID
47     */

48    private static final long serialVersionUID = 8074790768715184160L;
49    
50    /**
51     * Page to go to. Required.
52     */

53    protected String JavaDoc m_strPage;
54
55    // Constructors /////////////////////////////////////////////////////////////
56

57    /**
58     * Constructor for custom tag.
59     */

60    public ListDataSpecificPageTag()
61    {
62       super();
63    }
64    
65    // Accessors ////////////////////////////////////////////////////////////////
66

67    /**
68     * {@inheritDoc}
69     */

70    public String JavaDoc getCommand()
71    {
72       return ListBrowserServlet.ACTION_GO_TO_PAGE_NAME;
73    }
74
75    /**
76     * {@inheritDoc}
77     */

78    public void setCommand(
79       String JavaDoc strCommand
80    )
81    {
82       throw new UnsupportedOperationException JavaDoc("");
83    }
84
85    /**
86     * Get the page to display.
87     */

88    public String JavaDoc getPage()
89    {
90       return m_strPage;
91    }
92
93    /**
94     * Set the page to display.
95     *
96     * @param strPage - page to display
97     */

98    public void setPage(
99       String JavaDoc strPage
100    )
101    {
102       m_strPage = strPage;
103    }
104    
105    /**
106     * Set the page to display.
107     *
108     * @param iPage - page to display
109     */

110    public void setPage(
111       int iPage
112    )
113    {
114       m_strPage = Integer.toString(iPage);
115    }
116    
117    // Overwritten methods //////////////////////////////////////////////////////
118

119    /**
120     * {@inheritDoc}
121     */

122    protected String JavaDoc getActualPage(
123       ListOptions listoptions
124    )
125    {
126       return m_strPage;
127    }
128 }
129
Popular Tags