org.graffiti.managers
Class DefaultViewManager

java.lang.Object
  extended by 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: 5779 $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.graffiti.managers.ViewManager
ViewManager.ViewManagerListener
 
Constructor Summary
DefaultViewManager()
          Constructs a new view manager.
 
Method Summary
 void addListener(ViewManager.ViewManagerListener viewManagerListener)
          Registers the given ViewManagerListener.
 void addView(String viewType)
          Adds the given view type (class name) to the map of view types.
 void addViewListener(ViewListener viewListener)
          Registers the given ViewListener.
 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[] getViewNames()
          Returns the class names of the registered views.
 boolean hasViews()
          Returns true, 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)
          Returns true, if the given view manager listener was in the list of listeners and could be removed.
 boolean removeViewListener(ViewListener l)
          Returns true, 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 viewChanged(View newView)
          This method is called when the view changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultViewManager

public DefaultViewManager()
Constructs a new view manager.

Method Detail

getViewNames

public String[] getViewNames()
Description copied from interface: ViewManager
Returns the class names of the registered views.

Specified by:
getViewNames in interface ViewManager
Returns:
the class names of the registered views.

addListener

public void addListener(ViewManager.ViewManagerListener viewManagerListener)
Description copied from interface: ViewManager
Registers the given ViewManagerListener.

Specified by:
addListener in interface ViewManager
Parameters:
viewManagerListener - the listener to register.

addView

public void addView(String viewType)
Description copied from interface: ViewManager
Adds the given view type (class name) to the map of view types.

Specified by:
addView in interface ViewManager
Parameters:
viewType - the new view to add to the map.

addViewListener

public void addViewListener(ViewListener viewListener)
Description copied from interface: ViewManager
Registers the given ViewListener.

Specified by:
addViewListener in interface ViewManager
Parameters:
viewListener - the listener to register.

addViews

public void addViews(String[] views)
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 interface ViewManager
Parameters:
views - the list of classNames to add to the view type list.

createView

public View createView(String name)
                throws InstanceCreationException
Description copied from interface: ViewManager
Returns a new instance of the specified view.

Specified by:
createView in interface ViewManager
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
Returns true, if there is at least one registered view plugin available. /

Specified by:
hasViews in interface ViewManager
Returns:
DOCUMENT ME!

pluginAdded

public void pluginAdded(GenericPlugin plugin,
                        PluginDescription desc)
Description copied from interface: PluginManagerListener
Called by the plugin manager, iff a plugin has been added.

Specified by:
pluginAdded in interface PluginManagerListener
Parameters:
plugin - the added plugin.
desc - the description of the new plugin.

removeListener

public boolean removeListener(ViewManager.ViewManagerListener l)
Description copied from interface: ViewManager
Returns true, if the given view manager listener was in the list of listeners and could be removed.

Specified by:
removeListener in interface ViewManager
Parameters:
l - the view manager listener to remove.
Returns:
DOCUMENT ME!

removeViewListener

public boolean removeViewListener(ViewListener l)
Description copied from interface: ViewManager
Returns true, if the given view listener was in the list of listeners and could be removed.

Specified by:
removeViewListener in interface ViewManager
Parameters:
l - the view manager listener to remove.
Returns:
DOCUMENT ME!

viewChanged

public void viewChanged(View newView)
Description copied from interface: ViewListener
This method is called when the view changes. This method is not called when another session is activated. Implement SessionListener if you are interested in session changed events.

Specified by:
viewChanged in interface ViewListener
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 interface ViewManager


Generated at 2012-05-30 11:00:36 PM CEST