Revision 270 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.swing/org.gvsig.tools.swing.api/src/main/java/org/gvsig/tools/swing/api/ToolsSwingLocator.java
ToolsSwingLocator.java | ||
---|---|---|
33 | 33 |
*/ |
34 | 34 |
public class ToolsSwingLocator extends BaseLocator { |
35 | 35 |
|
36 |
private static final String LOCATOR_NAME = "Tools.swing.locator";
|
|
36 |
private static final String LOCATOR_NAME = "Tools.swing.locator";
|
|
37 | 37 |
|
38 |
public static final String DYNOBJECT_SWING_MANAGER_NAME = "Tools.dynobject.swing.manager"; |
|
38 |
public static final String DYNOBJECT_SWING_MANAGER_NAME = |
|
39 |
"Tools.dynobject.swing.manager"; |
|
39 | 40 |
|
40 |
public static final String DYNOBJECT_SWING_MANAGER_DESCRIPTION = "Tools DynObject Swing Manager"; |
|
41 |
public static final String DYNOBJECT_SWING_MANAGER_DESCRIPTION = |
|
42 |
"Tools DynObject Swing Manager"; |
|
41 | 43 |
|
42 |
public static final String USABILITY_SWING_MANAGER_NAME = "Tools.usability.swing.manager"; |
|
44 |
public static final String USABILITY_SWING_MANAGER_NAME = |
|
45 |
"Tools.usability.swing.manager"; |
|
43 | 46 |
|
44 |
public static final String USABILITY_SWING_MANAGER_DESCRIPTION = "Tools Usability Swing Manager"; |
|
47 |
public static final String USABILITY_SWING_MANAGER_DESCRIPTION = |
|
48 |
"Tools Usability Swing Manager"; |
|
45 | 49 |
|
46 |
|
|
47 |
/** |
|
48 |
* Unique instance. |
|
49 |
*/ |
|
50 |
private static final ToolsSwingLocator instance = new ToolsSwingLocator(); |
|
50 |
/** |
|
51 |
* Unique instance. |
|
52 |
*/ |
|
53 |
private static final ToolsSwingLocator instance = new ToolsSwingLocator(); |
|
51 | 54 |
|
55 |
/** |
|
56 |
* Gets the instance of the {@link DynObjectSwingManager} registered. |
|
57 |
* |
|
58 |
* @return {@link DynObjectSwingManager} |
|
59 |
*/ |
|
60 |
public static DynObjectSwingManager getDynObjectSwingManager() { |
|
61 |
return (DynObjectSwingManager) getInstance().get( |
|
62 |
DYNOBJECT_SWING_MANAGER_NAME); |
|
63 |
} |
|
52 | 64 |
|
53 |
/** |
|
54 |
* Gets the instance of the {@link DynObjectSwingManager} registered. |
|
55 |
* |
|
56 |
* @return {@link DynObjectSwingManager} |
|
57 |
*/ |
|
58 |
public static DynObjectSwingManager getDynObjectSwingManager() { |
|
59 |
return (DynObjectSwingManager) getInstance().get( |
|
60 |
DYNOBJECT_SWING_MANAGER_NAME); |
|
61 |
} |
|
65 |
/** |
|
66 |
* Return the singleton instance. |
|
67 |
* |
|
68 |
* @return the singleton instance |
|
69 |
*/ |
|
70 |
public static ToolsSwingLocator getInstance() { |
|
71 |
return instance; |
|
72 |
} |
|
62 | 73 |
|
63 |
/** |
|
64 |
* Return the singleton instance. |
|
65 |
* |
|
66 |
* @return the singleton instance |
|
67 |
*/ |
|
68 |
public static ToolsSwingLocator getInstance() { |
|
69 |
return instance; |
|
70 |
} |
|
74 |
/** |
|
75 |
* Gets the instance of the {@link UsabilitySwingManager} registered. |
|
76 |
* |
|
77 |
* @return {@link UsabilitySwingManager} |
|
78 |
*/ |
|
79 |
public static UsabilitySwingManager getUsabilitySwingManager() { |
|
80 |
return (UsabilitySwingManager) getInstance().get( |
|
81 |
USABILITY_SWING_MANAGER_NAME); |
|
82 |
} |
|
71 | 83 |
|
72 |
/** |
|
73 |
* Gets the instance of the {@link UsabilitySwingManager} registered. |
|
74 |
* |
|
75 |
* @return {@link UsabilitySwingManager} |
|
76 |
*/ |
|
77 |
public static UsabilitySwingManager getUsabilitySwingManager() { |
|
78 |
return (UsabilitySwingManager) getInstance().get( |
|
79 |
USABILITY_SWING_MANAGER_NAME); |
|
80 |
} |
|
84 |
/** |
|
85 |
* Registers the Class implementing the DynObjectSwingManager interface. |
|
86 |
* |
|
87 |
* @param clazz |
|
88 |
* implementing the DynObjectSwingManager interface |
|
89 |
*/ |
|
90 |
public static void registerDynObjectSwingManager( |
|
91 |
Class<? extends DynObjectSwingManager> clazz) { |
|
92 |
getInstance().register(DYNOBJECT_SWING_MANAGER_NAME, |
|
93 |
DYNOBJECT_SWING_MANAGER_DESCRIPTION, clazz); |
|
94 |
} |
|
81 | 95 |
|
82 |
/**
|
|
83 |
* Registers the Class implementing the DynObjectSwingManager interface.
|
|
84 |
*
|
|
85 |
* @param clazz
|
|
86 |
* implementing the DynObjectSwingManager interface
|
|
87 |
*/
|
|
88 |
public static void registerDynObjectSwingManager(
|
|
89 |
Class<? extends DynObjectSwingManager> clazz) {
|
|
90 |
getInstance().register(DYNOBJECT_SWING_MANAGER_NAME,
|
|
91 |
DYNOBJECT_SWING_MANAGER_DESCRIPTION, clazz);
|
|
92 |
}
|
|
96 |
/**
|
|
97 |
* Registers the Class implementing the UsabilitySwingManager interface.
|
|
98 |
*
|
|
99 |
* @param clazz
|
|
100 |
* implementing the UsabilitySwingManager interface
|
|
101 |
*/
|
|
102 |
public static void registerUsabilitySwingManager(
|
|
103 |
Class<? extends UsabilitySwingManager> clazz) {
|
|
104 |
getInstance().register(USABILITY_SWING_MANAGER_NAME,
|
|
105 |
USABILITY_SWING_MANAGER_DESCRIPTION, clazz);
|
|
106 |
}
|
|
93 | 107 |
|
94 |
/** |
|
95 |
* Registers the Class implementing the UsabilitySwingManager interface. |
|
96 |
* |
|
97 |
* @param clazz |
|
98 |
* implementing the UsabilitySwingManager interface |
|
99 |
*/ |
|
100 |
public static void registerUsabilitySwingManager( |
|
101 |
Class<? extends UsabilitySwingManager> clazz) { |
|
102 |
getInstance().register(USABILITY_SWING_MANAGER_NAME, |
|
103 |
USABILITY_SWING_MANAGER_DESCRIPTION, clazz); |
|
104 |
} |
|
108 |
/** |
|
109 |
* Return the Locator's name |
|
110 |
* |
|
111 |
* @return a String with the Locator's name |
|
112 |
*/ |
|
113 |
public String getLocatorName() { |
|
114 |
return LOCATOR_NAME; |
|
115 |
} |
|
105 | 116 |
|
106 |
/** |
|
107 |
* Return the Locator's name |
|
108 |
* |
|
109 |
* @return a String with the Locator's name |
|
110 |
*/ |
|
111 |
public String getLocatorName() { |
|
112 |
return LOCATOR_NAME; |
|
113 |
} |
|
114 |
|
|
115 |
} |
|
117 |
} |
Also available in: Unified diff