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

COVERAGE SUMMARY FOR SOURCE FILE [AbstractRendererDelegate.java]

nameclass, %method, %block, %line, %
AbstractRendererDelegate.java0%   (0/1)0%   (0/5)0%   (0/64)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractRendererDelegate0%   (0/1)0%   (0/5)0%   (0/64)0%   (0/15)
<static initializer> 0%   (0/1)0%   (0/4)0%   (0/1)
AbstractRendererDelegate (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getKey (Object): String 0%   (0/1)0%   (0/30)0%   (0/4)
setContextHolder (ApplicationContextHolder): void 0%   (0/1)0%   (0/17)0%   (0/5)
setRendererName (String): void 0%   (0/1)0%   (0/10)0%   (0/4)

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.component;
16 
17import javax.swing.JLabel;
18 
19import org.apache.commons.logging.Log;
20import org.apache.commons.logging.LogFactory;
21import org.jdesktop.application.ApplicationContext;
22import org.jdesktop.application.ResourceMap;
23 
24import net.sourceforge.hivegui.application.ApplicationContextHolder;
25 
26public abstract class AbstractRendererDelegate implements RendererDelegate
27{
28        static private final Log        _logger = LogFactory.getLog(AbstractRendererDelegate.class);
29 
30        public void        setRendererName(String name)
31        {
32                if (_map != null)
33                {
34                        _logger.warn("setRendererName(): _map has already been set!");
35                }
36                _prefix = name;
37        }
38        
39        public void        setContextHolder(ApplicationContextHolder holder)
40        {
41                if (_map == null)
42                {
43                        _context = holder.getContext();
44                        _map = _context.getResourceMap(getClass());
45                        init();
46                }
47        }
48        
49        protected String        getKey(Object value)
50        {
51                String prefix = (_prefix != null ? _prefix : getClass().getSimpleName());
52                String suffix = (value != null ? value.toString() : "null");
53                String key = prefix + "." + suffix;
54                return key;
55        }
56        
57        abstract protected void init();
58        abstract public void setValue(JLabel renderer, Object value);
59 
60        private String                                                _prefix;
61        protected ApplicationContext                _context;
62        protected ResourceMap                                _map;
63}

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