Line | Hits | Source |
---|---|---|
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; | |
35 | 0 | |
36 | @SuppressWarnings("serial") //$NON-NLS-1$ | |
37 | 0 | public class UserSearchPanel extends JPanel { |
38 | 0 | |
39 | 0 | private static final transient Logger logger = Logger |
40 | 0 | .getLogger(UserSearchPanel.class.getName()); |
41 | ||
42 | ||
43 | private String[] data; | |
44 | ||
45 | private JPanel contentPanel; | |
46 | ||
47 | private JPanel buttonPanel; | |
48 | ||
49 | 0 | private JTextField searchTextField; |
50 | 0 | |
51 | 0 | public UserSearchPanel() { |
52 | 0 | initialize(); |
53 | 0 | } |
54 | 0 | |
55 | 0 | protected void initialize() { |
56 | 0 | this.setLayout(new BorderLayout()); |
57 | 0 | this.add(getContentPanel(), BorderLayout.CENTER); |
58 | 0 | } |
59 | ||
60 | /** | |
61 | * @return Returns the data. | |
62 | 0 | */ |
63 | protected String[] getData() { | |
64 | 0 | return data; |
65 | } | |
66 | ||
67 | /** | |
68 | * @param data | |
69 | * The data to set. | |
70 | 0 | */ |
71 | 0 | protected void setData(String[] data) { |
72 | 0 | this.data = data; |
73 | 0 | } |
74 | ||
75 | /** | |
76 | * @return Returns the buttonPanel. | |
77 | 0 | */ |
78 | 0 | protected JPanel getButtonPanel() { |
79 | 0 | if (buttonPanel == null) { |
80 | 0 | buttonPanel = new JPanel(); |
81 | 0 | buttonPanel.setLayout(new FlowLayout()); |
82 | 0 | JButton searchButton = new JButton(Messages.getString("button.search")); //$NON-NLS-1$ |
83 | 0 | buttonPanel.add(searchButton); |
84 | ||
85 | 0 | searchButton.addActionListener(new ActionListener() { |
86 | public void actionPerformed(ActionEvent arg0) { | |
87 | logger.debug("actionPerformed saveButton"); //$NON-NLS-1$ | |
88 | } | |
89 | 0 | }); |
90 | } | |
91 | 0 | return buttonPanel; |
92 | } | |
93 | ||
94 | /** | |
95 | * @return Returns the contentPanel. | |
96 | 0 | */ |
97 | 0 | protected JPanel getContentPanel() { |
98 | 0 | if (contentPanel == null) { |
99 | 0 | contentPanel = new JPanel(); |
100 | 0 | TitledBorder titledBorder = new TitledBorder(Messages.getString("panel.usersearchpanel.searchuser")); //$NON-NLS-1$ |
101 | 0 | contentPanel.setBorder(titledBorder); |
102 | 0 | contentPanel.setLayout(new BorderLayout()); |
103 | 0 | contentPanel.add(getSearchTextField(), BorderLayout.CENTER); |
104 | 0 | contentPanel.add(getButtonPanel(), BorderLayout.SOUTH); |
105 | } | |
106 | 0 | return contentPanel; |
107 | } | |
108 | ||
109 | /** | |
110 | * @return Returns the searchTextField. | |
111 | 0 | */ |
112 | 0 | protected JTextField getSearchTextField() { |
113 | 0 | if (searchTextField == null) { |
114 | 0 | searchTextField = new JTextField(); |
115 | } | |
116 | 0 | return searchTextField; |
117 | } | |
118 | ||
119 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |