Revision 37599 branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/SwingInstallerLocator.java
SwingInstallerLocator.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
public class SwingInstallerLocator extends AbstractLocator { |
42 | 42 |
|
43 |
private static final String LOCATOR_NAME = "SwingInstallerLocator"; |
|
44 |
/** |
|
45 |
* SwingInstallerManager name used by the locator to access the instance |
|
46 |
*/ |
|
47 |
public static final String SWING_INSTALLER_MANAGER_NAME = |
|
48 |
"SwingInstallerManager"; |
|
49 |
private static final String SWING_INSTALLER_MANAGER_DESCRIPTION = |
|
50 |
"SwingInstallerManager of gvSIG"; |
|
43 |
private static final String LOCATOR_NAME = "SwingInstallerLocator"; |
|
44 |
/** |
|
45 |
* SwingInstallerManager name used by the locator to access the instance |
|
46 |
*/ |
|
47 |
public static final String SWING_INSTALLER_MANAGER_NAME = "SwingInstallerManager"; |
|
48 |
private static final String SWING_INSTALLER_MANAGER_DESCRIPTION = "SwingInstallerManager of gvSIG"; |
|
51 | 49 |
|
52 |
/** |
|
53 |
* Unique instance. |
|
54 |
*/ |
|
55 |
private static final SwingInstallerLocator instance = |
|
56 |
new SwingInstallerLocator(); |
|
50 |
/** |
|
51 |
* Unique instance. |
|
52 |
*/ |
|
53 |
private static final SwingInstallerLocator instance = new SwingInstallerLocator(); |
|
57 | 54 |
|
58 |
/**
|
|
59 |
* @see Locator#getLocatorName()
|
|
60 |
*/
|
|
61 |
public String getLocatorName() {
|
|
62 |
return LOCATOR_NAME;
|
|
63 |
}
|
|
55 |
/**
|
|
56 |
* @see Locator#getLocatorName()
|
|
57 |
*/
|
|
58 |
public String getLocatorName() {
|
|
59 |
return LOCATOR_NAME;
|
|
60 |
}
|
|
64 | 61 |
|
65 |
/**
|
|
66 |
* Return a reference to {@link SwingInstallerManager}.
|
|
67 |
*
|
|
68 |
* @return a reference to SwingInstallerManager
|
|
69 |
* @throws LocatorException
|
|
70 |
* if there is no access to the class or the class cannot be
|
|
71 |
* instantiated
|
|
72 |
* @see Locator#get(String)
|
|
73 |
*/
|
|
74 |
public static SwingInstallerManager getSwingInstallerManager()
|
|
75 |
throws LocatorException {
|
|
76 |
return (SwingInstallerManager) getInstance().get(
|
|
77 |
SWING_INSTALLER_MANAGER_NAME);
|
|
78 |
}
|
|
62 |
/**
|
|
63 |
* Return a reference to {@link SwingInstallerManager}.
|
|
64 |
*
|
|
65 |
* @return a reference to SwingInstallerManager
|
|
66 |
* @throws LocatorException
|
|
67 |
* if there is no access to the class or the class cannot be
|
|
68 |
* instantiated
|
|
69 |
* @see Locator#get(String)
|
|
70 |
*/
|
|
71 |
public static SwingInstallerManager getSwingInstallerManager()
|
|
72 |
throws LocatorException {
|
|
73 |
return (SwingInstallerManager) getInstance().get(
|
|
74 |
SWING_INSTALLER_MANAGER_NAME);
|
|
75 |
}
|
|
79 | 76 |
|
80 |
/**
|
|
81 |
* Return the singleton instance.
|
|
82 |
*
|
|
83 |
* @return the singleton instance
|
|
84 |
*/
|
|
85 |
public static SwingInstallerLocator getInstance() {
|
|
86 |
return instance;
|
|
87 |
}
|
|
77 |
/**
|
|
78 |
* Return the singleton instance.
|
|
79 |
*
|
|
80 |
* @return the singleton instance
|
|
81 |
*/
|
|
82 |
public static SwingInstallerLocator getInstance() {
|
|
83 |
return instance;
|
|
84 |
}
|
|
88 | 85 |
|
89 |
/**
|
|
90 |
* Registers the Class implementing the {@link SwingInstallerManager}
|
|
91 |
* interface.
|
|
92 |
*
|
|
93 |
* @param clazz
|
|
94 |
* implementing the SwingInstallerManager interface
|
|
95 |
*/
|
|
96 |
public static void registerSwingInstallerManager(
|
|
97 |
Class<? extends SwingInstallerManager> clazz) {
|
|
98 |
getInstance().register(SWING_INSTALLER_MANAGER_NAME,
|
|
99 |
SWING_INSTALLER_MANAGER_DESCRIPTION, clazz);
|
|
100 |
}
|
|
86 |
/**
|
|
87 |
* Registers the Class implementing the {@link SwingInstallerManager}
|
|
88 |
* interface.
|
|
89 |
*
|
|
90 |
* @param clazz
|
|
91 |
* implementing the SwingInstallerManager interface
|
|
92 |
*/
|
|
93 |
public static void registerSwingInstallerManager(
|
|
94 |
Class<? extends SwingInstallerManager> clazz) {
|
|
95 |
getInstance().register(SWING_INSTALLER_MANAGER_NAME,
|
|
96 |
SWING_INSTALLER_MANAGER_DESCRIPTION, clazz);
|
|
97 |
}
|
|
101 | 98 |
} |
Also available in: Unified diff