EMMA Coverage Report (generated Tue Feb 12 22:23:49 ICT 2008)
[all classes][net.sourceforge.hivegui.docking]

COVERAGE SUMMARY FOR SOURCE FILE [HiveGuiDockableFactory.java]

nameclass, %method, %block, %line, %
HiveGuiDockableFactory.java0%   (0/1)0%   (0/4)0%   (0/42)0%   (0/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class HiveGuiDockableFactory0%   (0/1)0%   (0/4)0%   (0/42)0%   (0/12)
HiveGuiDockableFactory (ViewContentFactory, ViewFactory): void 0%   (0/1)0%   (0/9)0%   (0/4)
createDockable (String): Dockable 0%   (0/1)0%   (0/11)0%   (0/2)
getDockable (String): Dockable 0%   (0/1)0%   (0/11)0%   (0/3)
getEmptyView (): Dockable 0%   (0/1)0%   (0/11)0%   (0/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.hivegui.docking;
16 
17import javax.swing.JComponent;
18 
19import org.flexdock.docking.Dockable;
20import org.flexdock.docking.DockableFactory;
21 
22public class HiveGuiDockableFactory        extends DockableFactory.Stub
23{
24        public HiveGuiDockableFactory(        ViewContentFactory        contentFactory,
25                                                                        ViewFactory                        viewFactory)
26        {
27                _contentFactory = contentFactory;
28                _viewFactory = viewFactory;
29        }
30        
31        @Override public Dockable getDockable(String id)
32        {
33                if (EmptyableViewport.EMPTY_VIEW_ID.equals(id))
34                {
35                        return getEmptyView();
36                }
37                else
38                {
39                        return createDockable(id);
40                }
41        }
42        
43        protected Dockable        createDockable(String id)
44        {
45                // Instantiate actual component
46                JComponent content = _contentFactory.createContent(id);
47                // Instantiate dockable view
48                return _viewFactory.createView(id, content);
49        }
50        
51        protected Dockable        getEmptyView()
52        {
53                if (_emptyView == null)
54                {
55                        _emptyView = createDockable(EmptyableViewport.EMPTY_VIEW_ID);
56                }
57                return _emptyView;
58        }
59        
60        protected final ViewContentFactory        _contentFactory;
61        protected final ViewFactory                        _viewFactory;
62        protected Dockable                                        _emptyView;
63}

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