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

COVERAGE SUMMARY FOR SOURCE FILE [AbstractCommandHolder.java]

nameclass, %method, %block, %line, %
AbstractCommandHolder.java100% (1/1)75%  (6/8)85%  (45/53)80%  (12/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractCommandHolder100% (1/1)75%  (6/8)85%  (45/53)80%  (12/15)
getObjectBuilder (): ObjectBuilder 0%   (0/1)0%   (0/3)0%   (0/1)
getService (): WhiteBoardUserService 0%   (0/1)0%   (0/3)0%   (0/1)
showDialog (String, Object []): boolean 100% (1/1)90%  (19/21)75%  (3/4)
AbstractCommandHolder (): void 100% (1/1)100% (3/3)100% (1/1)
setContextHolder (ApplicationContextHolder): void 100% (1/1)100% (9/9)100% (3/3)
setObjectBuilder (ObjectBuilder): void 100% (1/1)100% (4/4)100% (2/2)
setService (WhiteBoardUserService): void 100% (1/1)100% (4/4)100% (2/2)
showMessage (String, Object []): UserChoice 100% (1/1)100% (6/6)100% (1/1)

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.command;
16 
17import org.jdesktop.application.ApplicationContext;
18 
19import net.sourceforge.hiveboard.WhiteBoardUserService;
20import net.sourceforge.hivegui.application.ApplicationContextHolder;
21import net.sourceforge.hivegui.application.HiveGuiApplicationMain;
22import net.sourceforge.hivegui.dialog.DialogPanel;
23import net.sourceforge.hivegui.message.UserChoice;
24import net.sourceforge.hiveutils.service.ObjectBuilder;
25 
26/**
27 * Abstract class for most GUI commands in HiveBoard. This class allows for
28 * setter-injection of most objects that are needed by actual commands.
29 *
30 * @author Jean-Francois Poilpret
31 */
32public abstract class AbstractCommandHolder extends GuiContextHandler
33{
34        protected UserChoice        showMessage(String id, Object... args)
35        {
36                return _application.showMessage(id, args);
37        }
38        
39        protected boolean        showDialog(String panelName, Object... args)
40        {
41                if (args.length > 0 && args[0] == null)
42                {
43                        return false;
44                }
45                DialogPanel panel = (DialogPanel) _builder.create(panelName, args);
46                return _application.showDialog(panel);
47        }
48        
49        public void                setContextHolder(ApplicationContextHolder holder)
50        {
51                _context = holder.getContext();
52                _application = holder.getApplication();
53        }
54        
55        public void                setService(WhiteBoardUserService service)
56        {
57                _service = service;
58        }
59        public WhiteBoardUserService        getService()
60        {
61                return _service;
62        }
63        
64        public void                setObjectBuilder(ObjectBuilder builder)
65        {
66                _builder = builder;
67        }
68        public ObjectBuilder        getObjectBuilder()
69        {
70                return _builder;
71        }
72        
73        protected ApplicationContext                _context;
74        protected HiveGuiApplicationMain        _application;
75        protected WhiteBoardUserService                _service;
76        protected ObjectBuilder                                _builder;
77}

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