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

COVERAGE SUMMARY FOR SOURCE FILE [NotificationListPanel.java]

nameclass, %method, %block, %line, %
NotificationListPanel.java100% (2/2)100% (4/4)100% (77/77)100% (16/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class NotificationListPanel100% (1/1)100% (2/2)100% (66/66)100% (13/13)
NotificationListPanel (Channel, BeanTable): void 100% (1/1)100% (63/63)100% (12/12)
access$000 (NotificationListPanel): DataListModel 100% (1/1)100% (3/3)100% (1/1)
     
class NotificationListPanel$1100% (1/1)100% (2/2)100% (11/11)100% (3/3)
NotificationListPanel$1 (NotificationListPanel): void 100% (1/1)100% (6/6)100% (1/1)
push (Object): void 100% (1/1)100% (5/5)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.view;
16 
17import java.awt.BorderLayout;
18 
19import javax.swing.JPanel;
20import javax.swing.JScrollPane;
21import javax.swing.ListSelectionModel;
22 
23import net.sourceforge.hiveboard.Event;
24import net.sourceforge.hiveboard.docking.Views;
25import net.sourceforge.hiveboard.event.EventsPriorities;
26import net.sourceforge.hiveevents.Channel;
27import net.sourceforge.hiveevents.PersistentConsumer;
28import net.sourceforge.hivegui.table.BeanTable;
29import net.sourceforge.hivegui.table.DataListModel;
30 
31public class NotificationListPanel extends JPanel
32{
33        public NotificationListPanel(        Channel<Object>                clearNotificationsChannel,
34                                                                        BeanTable<Event>        tblNotifications)
35        {
36                setLayout(new BorderLayout());
37                _tblNotifications = tblNotifications;
38                _tblNotifications.setName(Views.NOTIFICATIONS_LIST.id() + "-table");
39                _model = _tblNotifications.getDataListModel();
40                _tblNotifications.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
41                JScrollPane scroller = new JScrollPane(_tblNotifications);
42                scroller.setName(Views.NOTIFICATIONS_LIST.id() + "-scroller");
43            add(scroller, BorderLayout.CENTER);
44 
45            int priority = EventsPriorities.NOTIFICATIONS_LIST_CLEARED;
46                clearNotificationsChannel.registerPushConsumer(
47                                                        priority, new PersistentConsumer<Object>()
48                {
49                        public void        push(Object event)
50                        {
51                                _model.clear();
52                        }
53                });
54        }
55 
56        final private BeanTable<Event>                _tblNotifications;
57        final private DataListModel<Event>        _model;
58}

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