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 @ 42775
History | View | Annotate | Download (3.5 KB)
1 | 42104 | jjdelcerro | /* 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 | 42775 | jjdelcerro | import org.gvsig.fmap.dal.EditingNotificationManager; |
26 | 42104 | jjdelcerro | import org.gvsig.tools.locator.BaseLocator; |
27 | |||
28 | /**
|
||
29 | * @author fdiaz
|
||
30 | *
|
||
31 | */
|
||
32 | public class DALSwingLocator extends BaseLocator { |
||
33 | |||
34 | /**
|
||
35 | * AttributeEditor swing manager name.
|
||
36 | */
|
||
37 | 42775 | jjdelcerro | public static final String SWING_MANAGER_NAME = "dal.swing.manager"; |
38 | 42104 | jjdelcerro | |
39 | /**
|
||
40 | * AttributeEditor swing manager description.
|
||
41 | */
|
||
42 | 42775 | jjdelcerro | public static final String SWING_MANAGER_DESCRIPTION = "DAL Swing Manager"; |
43 | 42104 | jjdelcerro | |
44 | 42775 | jjdelcerro | private static final String EDITINGNOTIFICATION_MANAGER_NAME = "dal.editingnotification.manager"; |
45 | private static final String EDITINGNOTIFICATION_MANAGER_DESCRIPTION = "DAL editing notification manager"; |
||
46 | |||
47 | private static final String LOCATOR_NAME = "dal.swing.locator"; |
||
48 | 42104 | jjdelcerro | |
49 | /**
|
||
50 | * Unique instance.
|
||
51 | */
|
||
52 | private static final DALSwingLocator INSTANCE |
||
53 | = new DALSwingLocator();
|
||
54 | |||
55 | /**
|
||
56 | * Return the singleton instance.
|
||
57 | *
|
||
58 | * @return the singleton instance
|
||
59 | */
|
||
60 | public static DALSwingLocator getInstance() { |
||
61 | return INSTANCE;
|
||
62 | } |
||
63 | |||
64 | /**
|
||
65 | * Return the Locator's name
|
||
66 | *
|
||
67 | * @return a String with the Locator's name
|
||
68 | */
|
||
69 | public final String getLocatorName() { |
||
70 | return LOCATOR_NAME;
|
||
71 | } |
||
72 | |||
73 | /**
|
||
74 | * Registers the Class implementing the PersistenceManager interface.
|
||
75 | *
|
||
76 | * @param clazz implementing the SwingManager interface
|
||
77 | */
|
||
78 | public static void registerSwingManager(Class clazz) { |
||
79 | getInstance().register(SWING_MANAGER_NAME, SWING_MANAGER_DESCRIPTION, |
||
80 | clazz); |
||
81 | } |
||
82 | |||
83 | /**
|
||
84 | * Gets the instance of the {@link DataSwingManager} registered.
|
||
85 | *
|
||
86 | * @return {@link DataSwingManager}
|
||
87 | */
|
||
88 | public static DataSwingManager getSwingManager() { |
||
89 | return (DataSwingManager) getInstance()
|
||
90 | .get(SWING_MANAGER_NAME); |
||
91 | } |
||
92 | |||
93 | 42775 | jjdelcerro | /**
|
94 | * Registers the Class implementing the EditingNotificationManager interface.
|
||
95 | *
|
||
96 | * @param clazz implementing the EditingNotificationManager interface
|
||
97 | */
|
||
98 | public static void registerEditingNotificationManager(Class clazz) { |
||
99 | getInstance().register(EDITINGNOTIFICATION_MANAGER_NAME, EDITINGNOTIFICATION_MANAGER_DESCRIPTION, |
||
100 | clazz); |
||
101 | } |
||
102 | |||
103 | /**
|
||
104 | * Gets the instance of the {@link EditingNotificationManager} registered.
|
||
105 | *
|
||
106 | * @return {@link EditingNotificationManager}
|
||
107 | */
|
||
108 | public static EditingNotificationManager getEditingNotificationManager() { |
||
109 | return (EditingNotificationManager) getInstance()
|
||
110 | .get(EDITINGNOTIFICATION_MANAGER_NAME); |
||
111 | } |
||
112 | 42104 | jjdelcerro | } |