EMMA Coverage Report (generated Wed Feb 13 07:49:24 ICT 2008)
[all classes][net.sourceforge.hiveboard.dialog]

COVERAGE SUMMARY FOR SOURCE FILE [LoginPanel.java]

nameclass, %method, %block, %line, %
LoginPanel.java100% (2/2)100% (7/7)100% (142/142)100% (29/29)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class LoginPanel100% (1/1)100% (5/5)100% (123/123)100% (26/26)
LoginPanel (String, String): void 100% (1/1)100% (104/104)100% (21/21)
accept (): void 100% (1/1)100% (5/5)100% (2/2)
access$000 (LoginPanel): JTextField 100% (1/1)100% (3/3)100% (1/1)
getPassword (): String 100% (1/1)100% (7/7)100% (1/1)
getUserName (): String 100% (1/1)100% (4/4)100% (1/1)
     
class LoginPanel$1100% (1/1)100% (2/2)100% (19/19)100% (3/3)
LoginPanel$1 (LoginPanel): void 100% (1/1)100% (6/6)100% (1/1)
contentUpdated (): void 100% (1/1)100% (13/13)100% (2/2)

1//  Copyright 2004-2007 Jean-Francois Poilpret
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package net.sourceforge.hiveboard.dialog;
16 
17import javax.swing.JLabel;
18import javax.swing.JPasswordField;
19import javax.swing.JTextField;
20 
21import org.jdesktop.application.Action;
22 
23import net.sourceforge.hivegui.component.TextListener;
24import net.sourceforge.hivegui.dialog.AbstractDialogPanel;
25 
26import zappini.designgridlayout.DesignGridLayout;
27 
28public class LoginPanel extends AbstractDialogPanel
29{
30        static private final String        NAME = "login";
31        
32        public LoginPanel(String login, String password)
33        {
34                super(NAME);
35 
36                _lblUser.setName(NAME + "-user-label");
37                _txfUser.setName(NAME + "-user");
38                _lblPassword.setName(NAME + "-password-label");
39                _pwfPassword.setName(NAME + "-password");
40 
41                _lblUser.setLabelFor(_txfUser);
42                _lblPassword.setLabelFor(_pwfPassword);
43                
44                DesignGridLayout layout = new DesignGridLayout(this);
45            setLayout(layout);
46 
47            layout.row().label(_lblUser).add(_txfUser);
48            layout.row().label(_lblPassword).add(_pwfPassword);
49 
50                _txfUser.setText(login);
51                _pwfPassword.setText(password);
52                
53                TextListener listener = new TextListener()
54                {
55                        @Override protected void contentUpdated()
56                        {
57                                setAcceptEnabled(_txfUser.getText().length() != 0);
58                        }
59                };
60                _txfUser.getDocument().addDocumentListener(listener);
61//                _pwfPassword.getDocument().addDocumentListener(listener);
62                setAcceptEnabled(_txfUser.getText().length() != 0);
63    }
64        
65        @Action(enabledProperty = "acceptEnabled")
66        public void accept()
67        {
68                _parent.close(false);
69        }
70 
71        public String        getUserName()
72        {
73                return _txfUser.getText();
74        }
75        
76        public String        getPassword()
77        {
78                return new String(_pwfPassword.getPassword());
79        }
80 
81        final private JLabel                        _lblUser = new JLabel();
82        final private JTextField                _txfUser = new JTextField();
83        final private JLabel                        _lblPassword = new JLabel();
84        final private JPasswordField        _pwfPassword = new JPasswordField();
85}

[all classes][net.sourceforge.hiveboard.dialog]
EMMA 2.0.5312 (C) Vladimir Roubtsov