public class PanelGroupManager extends Object implements Serializable
Implemented to use the AbstractPanelGroup
type desired.
This class allows having different implementations of AbstractPanelGroup
and only load in memory the class of some of them, whom have previously been imported to future use. Then, when
a graphical interface would need use a AbstractPanelGroup
instance, will instance an object of the
class selected (set previously as default) of the registered types in this manager.
Modifier | Constructor and Description |
---|---|
protected |
PanelGroupManager()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
deregisterPanelGroup(Class panelGroup)
Unregisters a
AbstractPanelGroup class type if it
was previously registered. |
static PanelGroupManager |
getManager()
The singleton
PanelGroupManager instance. |
AbstractPanelGroup |
getPanelGroup(Object reference)
Gets the default
AbstractPanelGroup class type. |
void |
registerPanelGroup(Class panelGroup)
Registers a new
AbstractPanelGroup class type if it
wasn't already done. |
void |
setDefaultType(Class panelGroup)
Sets as default one of the
AbstractPanelGroup class type
previously registered. |
public static PanelGroupManager getManager()
The singleton PanelGroupManager
instance.
public void registerPanelGroup(Class panelGroup)
Registers a new AbstractPanelGroup
class type if it
wasn't already done.
panelGroup
- the new AbstractPanelGroup
class type to registerderegisterPanelGroup(Class)
public void deregisterPanelGroup(Class panelGroup)
Unregisters a AbstractPanelGroup
class type if it
was previously registered.
If the type to unregister is the default, sets default to null
.
panelGroup
- the AbstractPanelGroup
class type to unregisterregisterPanelGroup(Class)
public void setDefaultType(Class panelGroup)
Sets as default one of the AbstractPanelGroup
class type
previously registered.
panelGroup
- a AbstractPanelGroup
class type#getPanelGroup()
public AbstractPanelGroup getPanelGroup(Object reference) throws Exception
Gets the default AbstractPanelGroup
class type.
AbstractPanelGroup
class type or null
if isn't anyException
- any exception produced loading the AbstractPanel
setDefaultType(Class)