Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.about / org.gvsig.about.api / src / main / java / org / gvsig / about / AboutLocator.java @ 42024

History | View | Annotate | Download (2.45 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.about;
23

    
24
import org.gvsig.tools.locator.BaseLocator;
25
import org.gvsig.tools.locator.Locator;
26
import org.gvsig.tools.locator.LocatorException;
27

    
28
/**
29
 * @author gvSIG Team
30
 * @version $Id$
31
 * 
32
 */
33
public class AboutLocator extends BaseLocator {
34

    
35
    private static final String LOCATOR_NAME = "AboutLocator";
36

    
37
    public static final String MANAGER_NAME = "aboutlocator.manager";
38

    
39
    public static final String MANAGER_DESCRIPTION = "About Manager";
40

    
41
    /**
42
     * Unique instance.
43
     */
44
    private static final AboutLocator instance = new AboutLocator();
45

    
46
    /**
47
     * Return the singleton instance.
48
     * 
49
     * @return the singleton instance
50
     */
51
    public static AboutLocator getInstance() {
52
        return instance;
53
    }
54

    
55
    @Override
56
    public String getLocatorName() {
57
        return LOCATOR_NAME;
58
    }
59

    
60
    /**
61
     * Return a reference to AboutManager.
62
     * 
63
     * @return a reference to AboutManager
64
     * @throws LocatorException
65
     *             if there is no access to the class or the class cannot be
66
     *             instantiated
67
     * @see Locator#get(String)
68
     */
69
    public static AboutManager getManager() throws LocatorException {
70
        return (AboutManager) getInstance().get(MANAGER_NAME);
71
    }
72

    
73
    /**
74
     * Registers the Class implementing the AboutManager interface.
75
     * 
76
     * @param clazz
77
     *            implementing the AboutManager interface
78
     */
79
    public static void registerManager(Class<? extends AboutManager> clazz) {
80
        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
81
    }
82

    
83
}