Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.swing / org.gvsig.fmap.dal.swing.api / src / main / java / org / gvsig / fmap / dal / swing / DALSwingLocator.java @ 42104

History | View | Annotate | Download (2.56 KB)

1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2014 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.fmap.dal.swing;
24

    
25
import org.gvsig.tools.locator.BaseLocator;
26

    
27
/**
28
 * @author fdiaz
29
 *
30
 */
31
public class DALSwingLocator extends BaseLocator {
32

    
33
    /**
34
     * AttributeEditor swing manager name.
35
     */
36
    public static final String SWING_MANAGER_NAME
37
            = "AttributeEditor.swing.manager";
38

    
39
    /**
40
     * AttributeEditor swing manager description.
41
     */
42
    public static final String SWING_MANAGER_DESCRIPTION
43
            = "AttributeEditor UIManager";
44

    
45
    private static final String LOCATOR_NAME = "AttributeEditor.swing.locator";
46

    
47
    /**
48
     * Unique instance.
49
     */
50
    private static final DALSwingLocator INSTANCE
51
            = new DALSwingLocator();
52

    
53
    /**
54
     * Return the singleton instance.
55
     *
56
     * @return the singleton instance
57
     */
58
    public static DALSwingLocator getInstance() {
59
        return INSTANCE;
60
    }
61

    
62
    /**
63
     * Return the Locator's name
64
     *
65
     * @return a String with the Locator's name
66
     */
67
    public final String getLocatorName() {
68
        return LOCATOR_NAME;
69
    }
70

    
71
    /**
72
     * Registers the Class implementing the PersistenceManager interface.
73
     *
74
     * @param clazz implementing the SwingManager interface
75
     */
76
    public static void registerSwingManager(Class clazz) {
77
        getInstance().register(SWING_MANAGER_NAME, SWING_MANAGER_DESCRIPTION,
78
                clazz);
79
    }
80

    
81
    /**
82
     * Gets the instance of the {@link DataSwingManager} registered.
83
     *
84
     * @return {@link DataSwingManager}
85
     */
86
    public static DataSwingManager getSwingManager() {
87
        return (DataSwingManager) getInstance()
88
                .get(SWING_MANAGER_NAME);
89
    }
90

    
91
}