Package org.graffiti.managers
Class DefaultViewManager
java.lang.Object
org.graffiti.managers.DefaultViewManager
- All Implemented Interfaces:
PluginManagerListener
,ViewManager
,ViewListener
public class DefaultViewManager extends Object implements ViewManager
Manages a list of view types.
- Version:
- $Revision: 1.11 $
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.graffiti.managers.ViewManager
ViewManager.ViewManagerListener
-
Constructor Summary
Constructors Constructor Description DefaultViewManager()
Constructs a new view manager. -
Method Summary
Modifier and Type Method Description void
addListener(ViewManager.ViewManagerListener viewManagerListener)
Registers the givenViewManagerListener
.void
addView(String viewType)
Adds the given view type (class name) to the map of view types.void
addViewListener(ViewListener viewListener)
Registers the givenViewListener
.void
addViews(String[] views)
Adds the given list of views types (class names) to the list of available view types.View
createView(String name)
Returns a new instance of the specified view.String
getDefaultView()
String[]
getViewDescriptions()
String[]
getViewNames()
Returns the class names of the registered views.boolean
hasViews()
Returnstrue
, if there is at least one registered view plugin available.void
pluginAdded(GenericPlugin plugin, PluginDescription desc)
Called by the plugin manager, iff a plugin has been added.boolean
removeListener(ViewManager.ViewManagerListener l)
Returnstrue
, if the given view manager listener was in the list of listeners and could be removed.boolean
removeViewListener(ViewListener l)
Returnstrue
, if the given view listener was in the list of listeners and could be removed.void
removeViews()
Removes the known list of views from the internal memory.void
setDefaultView(String defaultView)
void
viewChanged(View newView)
This method is called when the view changes.
-
Constructor Details
-
DefaultViewManager
public DefaultViewManager()Constructs a new view manager.
-
-
Method Details
-
getViewNames
Description copied from interface:ViewManager
Returns the class names of the registered views.- Specified by:
getViewNames
in interfaceViewManager
- Returns:
- the class names of the registered views.
-
getViewDescriptions
- Specified by:
getViewDescriptions
in interfaceViewManager
-
addListener
Description copied from interface:ViewManager
Registers the givenViewManagerListener
.- Specified by:
addListener
in interfaceViewManager
- Parameters:
viewManagerListener
- the listener to register.
-
addView
Description copied from interface:ViewManager
Adds the given view type (class name) to the map of view types.- Specified by:
addView
in interfaceViewManager
- Parameters:
viewType
- the new view to add to the map.
-
addViewListener
Description copied from interface:ViewManager
Registers the givenViewListener
.- Specified by:
addViewListener
in interfaceViewManager
- Parameters:
viewListener
- the listener to register.
-
addViews
Description copied from interface:ViewManager
Adds the given list of views types (class names) to the list of available view types.- Specified by:
addViews
in interfaceViewManager
- Parameters:
views
- the list of classNames to add to the view type list.
-
createView
Description copied from interface:ViewManager
Returns a new instance of the specified view.- Specified by:
createView
in interfaceViewManager
- Parameters:
name
- the class name of the view.- Returns:
- a new instance of the specified view.
- Throws:
InstanceCreationException
-
hasViews
public boolean hasViews()Description copied from interface:ViewManager
Returnstrue
, if there is at least one registered view plugin available. /- Specified by:
hasViews
in interfaceViewManager
- Returns:
- DOCUMENT ME!
-
pluginAdded
Description copied from interface:PluginManagerListener
Called by the plugin manager, iff a plugin has been added.- Specified by:
pluginAdded
in interfacePluginManagerListener
- Parameters:
plugin
- the added plugin.desc
- the description of the new plugin.
-
removeListener
Description copied from interface:ViewManager
Returnstrue
, if the given view manager listener was in the list of listeners and could be removed.- Specified by:
removeListener
in interfaceViewManager
- Parameters:
l
- the view manager listener to remove.- Returns:
- DOCUMENT ME!
-
removeViewListener
Description copied from interface:ViewManager
Returnstrue
, if the given view listener was in the list of listeners and could be removed.- Specified by:
removeViewListener
in interfaceViewManager
- Parameters:
l
- the view manager listener to remove.- Returns:
- DOCUMENT ME!
-
viewChanged
Description copied from interface:ViewListener
This method is called when the view changes. This method is not called when another session is activated. ImplementSessionListener
if you are interested in session changed events.- Specified by:
viewChanged
in interfaceViewListener
- Parameters:
newView
- the new View.
-
removeViews
public void removeViews()Description copied from interface:ViewManager
Removes the known list of views from the internal memory. Makes it possible to remove and re-add views.- Specified by:
removeViews
in interfaceViewManager
-
getDefaultView
- Specified by:
getDefaultView
in interfaceViewManager
-
setDefaultView
- Specified by:
setDefaultView
in interfaceViewManager
-