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

COVERAGE SUMMARY FOR SOURCE FILE [LoadCommentsParamsPanel.java]

nameclass, %method, %block, %line, %
LoadCommentsParamsPanel.java100% (1/1)100% (5/5)100% (132/132)100% (29/29)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class LoadCommentsParamsPanel100% (1/1)100% (5/5)100% (132/132)100% (29/29)
LoadCommentsParamsPanel (Board): void 100% (1/1)100% (94/94)100% (20/20)
accept (): void 100% (1/1)100% (17/17)100% (4/4)
getFromDate (): Date 100% (1/1)100% (3/3)100% (1/1)
getUntilDate (): Date 100% (1/1)100% (3/3)100% (1/1)
setDateFormat (String): void 100% (1/1)100% (15/15)100% (3/3)

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 java.text.SimpleDateFormat;
18import java.util.Date;
19 
20import javax.swing.JFormattedTextField;
21import javax.swing.JLabel;
22import javax.swing.text.DateFormatter;
23 
24import org.jdesktop.application.Action;
25 
26import net.sourceforge.hiveboard.Board;
27import net.sourceforge.hivegui.component.EmptyFormat;
28 
29import zappini.designgridlayout.DesignGridLayout;
30 
31public class LoadCommentsParamsPanel extends AbstractBoardPanel
32{
33        static private final String        NAME = "load-comments";
34        
35        public LoadCommentsParamsPanel(Board board)
36        {
37                super(NAME);
38                
39                _board = board;
40 
41                _lblFrom.setName(NAME + "-from-label");
42                _fromDate.setName(NAME + "-from");
43                _lblUntil.setName(NAME + "-until-label");
44                _untilDate.setName(NAME + "-until");
45 
46                _lblFrom.setLabelFor(_fromDate);
47                _lblUntil.setLabelFor(_untilDate);
48 
49                DesignGridLayout layout = new DesignGridLayout(this); 
50                setLayout(layout);
51 
52                layout.row().label(_lblFrom).add(_fromDate);
53                layout.row().label(_lblUntil).add(_untilDate);
54        }
55        
56        public void setDateFormat(String dateFormat)
57        {
58                _dateFormat = dateFormat;
59            _dateFormatter.setFormat(new EmptyFormat(new SimpleDateFormat(_dateFormat)));
60        }
61 
62        public Date        getFromDate()
63        {
64                return _from;
65        }
66 
67        public Date        getUntilDate()
68        {
69                return _until;
70        }
71 
72        @Action public void accept()
73        {
74                _from = (Date) _fromDate.getValue();
75                _until = (Date) _untilDate.getValue();
76                _parent.close(false);
77        }
78        
79        private Date                                                _from = null;
80        private Date                                                _until = null;
81        private final JLabel                                _lblFrom = new JLabel();
82        private final DateFormatter                        _dateFormatter = new DateFormatter();
83        private final JFormattedTextField        _fromDate = new JFormattedTextField(_dateFormatter);
84        private final JLabel                                _lblUntil = new JLabel();
85        private final JFormattedTextField        _untilDate = new JFormattedTextField(_dateFormatter);
86        private String                                                _dateFormat;
87}

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