WebObjects 5.2.3

com.webobjects.eointerface
Class EOWidgetPluginRegistry

java.lang.Object
  extended bycom.webobjects.eointerface.EOWidgetPluginRegistry

public class EOWidgetPluginRegistry
extends Object

The EOWidgetPluginRegistry maintains a mapping from widget plugin classes to association and widget classes. The registry provides static methods for setting and getting which plugin should be used, given a widget and association. So, for any pair of association and widget classes, there can be only one widget plugin class registered. This allows for objects of any association class to be used with multiple widgets (regardless of widget set). Typically, when an application using the widget plugin registry starts up, the application first registers widget plugins with the registry, before the application's nib's are loaded.


Nested Class Summary
static class EOWidgetPluginRegistry.WidgetSetPlugin
          Abstract super class for plugins that handle the widget set specific task of displaying alert panels.
 
Constructor Summary
EOWidgetPluginRegistry()
           
 
Method Summary
static Class findWidgetPluginClass(Class associationClass, Class widgetClass)
          Searches the set of registered plugins, looking for a widget plugin class that is registered for use with EOAssociation's of class associationClass and objects of class widgetClass and returns the first one found.
static EOWidgetAssociation.WidgetPlugin newWidgetPluginForAssociation(EOWidgetAssociation association, Object widget)
          Creates a new instance of the widget plugin class that is usable with association and widget.
static void registerWidgetPluginClass(Class associationClass, Class widgetClass, Class widgetPluginClass)
          Registers widgetPluginClass with the application's EOWidgetPluginRegistry.
static void setWidgetSetPlugin(EOWidgetPluginRegistry.WidgetSetPlugin widgetSetPlugin)
          Sets widgetSetPlugin as the application's WidgetSetPlugin.
static EOWidgetPluginRegistry.WidgetSetPlugin widgetSetPlugin()
          Returns the application's WidgetSetPlugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOWidgetPluginRegistry

public EOWidgetPluginRegistry()
Method Detail

findWidgetPluginClass

public static Class findWidgetPluginClass(Class associationClass,
                                          Class widgetClass)
Searches the set of registered plugins, looking for a widget plugin class that is registered for use with EOAssociation's of class associationClass and objects of class widgetClass and returns the first one found. This method will attempt to find a widget plugin for widgetClass's superclass or associationClass's superclass if no widget plugin is registered for widgetClass and associationClass.

Parameters:
associationClass - the association class the widget plugin should be usable with.
widgetClass - the widget class that the widget plugin should be usable with.
Returns:
the class of the widget plugin that is usable with both associationClass and widgetClass objects, or null if no such object is registered

newWidgetPluginForAssociation

public static EOWidgetAssociation.WidgetPlugin newWidgetPluginForAssociation(EOWidgetAssociation association,
                                                                             Object widget)
Creates a new instance of the widget plugin class that is usable with association and widget. This method looks for the widget plugin class that is registered for use with association and widget. This method throws an IllegalArgumentException if either association or widget are null or if the found widget plugin class is not a subclass of association.widgetPluginClass(). Throws an IllegalStateException if no widget plugin is registered for use with association and widget.

Parameters:
association - the association the widget plugin should be usable with
widget - the widget that the widget plugin should be usable with
Returns:
a widget plugin instance that is usable with both association and widget objects

registerWidgetPluginClass

public static void registerWidgetPluginClass(Class associationClass,
                                             Class widgetClass,
                                             Class widgetPluginClass)
Registers widgetPluginClass with the application's EOWidgetPluginRegistry. widgetPluginClass is registered as the widget plugin class to use to connect associations of class associationClass to widgets of class widgetClass. Any widget plugin class that was previously registered for this associationClass/widgetClass combination is unregistered.

Parameters:
associationClass - the association class the widget plugin can be usable with
widgetClass - the widget class that the widget plugin should be used with
widgetPluginClass - the widget plugin class to use to connect objects of class widgetPluginClass and associations of class associationClass

setWidgetSetPlugin

public static void setWidgetSetPlugin(EOWidgetPluginRegistry.WidgetSetPlugin widgetSetPlugin)
Sets widgetSetPlugin as the application's WidgetSetPlugin.

Parameters:
widgetSetPlugin - the WidgetSetPlugin object for the application

widgetSetPlugin

public static EOWidgetPluginRegistry.WidgetSetPlugin widgetSetPlugin()
Returns the application's WidgetSetPlugin.

Returns:
the WidgetSetPlugin object for the application

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.