edu.iu.iv.common.util.algorithmview
Class AlgorithmViewComponentRegistry

java.lang.Object
  |
  +--edu.iu.iv.common.util.algorithmview.AlgorithmViewComponentRegistry

public class AlgorithmViewComponentRegistry
extends java.lang.Object

A registry used for getting a properly instantiated AlgorithmViewComponent given a class that will need to be edited. Note this class is a singleton and so you must get an instance of this class through its static getInstance() method.

Author:
Team IVC

Method Summary
 AlgorithmViewComponent getComponent(java.lang.Class editableClass)
          given the class to be edited returns an instantiated algorithm view component to be used for editing the data for that class. if there is no appropriate component then this will return null.
static AlgorithmViewComponentRegistry getInstance()
           
 void register(AlgorithmViewComponent component)
          register an already instantiated algorithm view component.
 void register(java.lang.Class editableClass, java.lang.Class algorithmViewComponentClass)
          registers the algorithm view component.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AlgorithmViewComponentRegistry getInstance()
Returns:
the singleton instance of the registry

register

public void register(AlgorithmViewComponent component)
register an already instantiated algorithm view component.

Parameters:
component - the component to register.

register

public void register(java.lang.Class editableClass,
                     java.lang.Class algorithmViewComponentClass)
registers the algorithm view component.

Parameters:
editableClass - the class the component can edit.
algorithmViewComponentClass - the class of the view component to use.

getComponent

public AlgorithmViewComponent getComponent(java.lang.Class editableClass)
given the class to be edited returns an instantiated algorithm view component to be used for editing the data for that class. if there is no appropriate component then this will return null.

Parameters:
editableClass - the class of the data that will need to be edited.
Returns:
the associated view component to use or null if there is none.