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

COVERAGE SUMMARY FOR SOURCE FILE [HiveBoardViewContentFactory.java]

nameclass, %method, %block, %line, %
HiveBoardViewContentFactory.java100% (1/1)100% (2/2)100% (53/53)100% (16/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class HiveBoardViewContentFactory100% (1/1)100% (2/2)100% (53/53)100% (16/16)
HiveBoardViewContentFactory (ApplicationContextHolder, ObjectBuilder): void 100% (1/1)100% (10/10)100% (4/4)
createContent (String): JComponent 100% (1/1)100% (43/43)100% (12/12)

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.docking;
16 
17import javax.swing.JComponent;
18 
19import org.jdesktop.application.ApplicationContext;
20 
21import net.sourceforge.hiveboard.view.DrawingAreaPanel;
22import net.sourceforge.hivegui.application.ApplicationContextHolder;
23import net.sourceforge.hivegui.docking.EmptyableViewport;
24import net.sourceforge.hivegui.docking.ViewContentFactory;
25import net.sourceforge.hiveutils.service.ObjectBuilder;
26 
27public class HiveBoardViewContentFactory implements ViewContentFactory
28{
29        public HiveBoardViewContentFactory(        ApplicationContextHolder        holder,
30                                                                                ObjectBuilder                                builder)
31        {
32                _context = holder.getContext();
33                _builder = builder;
34        }
35        
36        public JComponent createContent(String id)
37        {
38                Views kind = Views.getView(id);
39                JComponent content = null;
40                if (kind != null)
41                {
42                        content = (JComponent) _builder.create(kind.id());
43                        content.setName(kind.id());
44                }
45                else if (EmptyableViewport.EMPTY_VIEW_ID.equals(id))
46                {
47                        content = new DrawingAreaPanel();
48                        content.setName(EmptyableViewport.EMPTY_VIEW_ID);
49                }
50                if (content != null)
51                {
52                        _context.getResourceMap(content.getClass()).injectComponents(content);
53                }
54                return content;
55        }
56 
57        protected final ObjectBuilder                _builder;
58        protected final ApplicationContext        _context;
59}

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