Coverage details for ui.panel.UserSearchPanel

LineHitsSource
1 /*******************************************************************************
2  * InternetCafe is a software solution that helps the management of Cybercafes
3  * according with the ITALIAN DECREE LAW ON ANTI-TERROR MEASURES, 27 JULY 2005.
4  * Copyright (C) 2006 Guido Angelo Ingenito
5  
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *******************************************************************************/
20 package ui.panel;
21  
22 import java.awt.BorderLayout;
23 import java.awt.FlowLayout;
24 import java.awt.event.ActionEvent;
25 import java.awt.event.ActionListener;
26  
27 import javax.swing.JButton;
28 import javax.swing.JPanel;
29 import javax.swing.JTextField;
30 import javax.swing.border.TitledBorder;
31  
32 import org.apache.log4j.Logger;
33  
34 import ui.Messages;
350 
36 @SuppressWarnings("serial") //$NON-NLS-1$
370public class UserSearchPanel extends JPanel {
380 
390    private static final transient Logger logger = Logger
400            .getLogger(UserSearchPanel.class.getName());
41  
42  
43     private String[] data;
44  
45     private JPanel contentPanel;
46  
47     private JPanel buttonPanel;
48  
490    private JTextField searchTextField;
500 
510    public UserSearchPanel() {
520        initialize();
530    }
540 
550    protected void initialize() {
560        this.setLayout(new BorderLayout());
570        this.add(getContentPanel(), BorderLayout.CENTER);
580    }
59  
60     /**
61      * @return Returns the data.
620     */
63     protected String[] getData() {
640        return data;
65     }
66  
67     /**
68      * @param data
69      * The data to set.
700     */
710    protected void setData(String[] data) {
720        this.data = data;
730    }
74  
75     /**
76      * @return Returns the buttonPanel.
770     */
780    protected JPanel getButtonPanel() {
790        if (buttonPanel == null) {
800            buttonPanel = new JPanel();
810            buttonPanel.setLayout(new FlowLayout());
820            JButton searchButton = new JButton(Messages.getString("button.search")); //$NON-NLS-1$
830            buttonPanel.add(searchButton);
84  
850            searchButton.addActionListener(new ActionListener() {
86                 public void actionPerformed(ActionEvent arg0) {
87                     logger.debug("actionPerformed saveButton"); //$NON-NLS-1$
88                 }
890            });
90         }
910        return buttonPanel;
92     }
93  
94     /**
95      * @return Returns the contentPanel.
960     */
970    protected JPanel getContentPanel() {
980        if (contentPanel == null) {
990            contentPanel = new JPanel();
1000            TitledBorder titledBorder = new TitledBorder(Messages.getString("panel.usersearchpanel.searchuser")); //$NON-NLS-1$
1010            contentPanel.setBorder(titledBorder);
1020            contentPanel.setLayout(new BorderLayout());
1030            contentPanel.add(getSearchTextField(), BorderLayout.CENTER);
1040            contentPanel.add(getButtonPanel(), BorderLayout.SOUTH);
105         }
1060        return contentPanel;
107     }
108  
109     /**
110      * @return Returns the searchTextField.
1110     */
1120    protected JTextField getSearchTextField() {
1130        if (searchTextField == null) {
1140            searchTextField = new JTextField();
115         }
1160        return searchTextField;
117     }
118  
119 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.