Openwings API Documentation (v1.1)

net.openwings.ui
Interface UserInterfaceFactory

All Superinterfaces:
java.io.Serializable

public interface UserInterfaceFactory
extends java.io.Serializable

This interface describes a factory that builds user interfaces for services. Factories that implement this interface can be queried about the types of service interfaces they support, and the Java types of user interface objects they produce.

Additionally, UserInterfaceFactory implementations must follow the following convention: for each type of user interface object produced by the factory, there are one or more methods that match this pattern:

For example, a user interface factory that produces user interfaces of class java.awt.Frame might have methods like this:


public class MyFactory
{
public java.awt.Frame getFrame(Object obj);
public java.awt.Frame getFrame(Object obj, GraphicsConfiguration gc);
public java.awt.Frame getFrame(Object obj, String title);
public java.awt.Frame getFrame(Object obj, String title, GraphicsConfiguration gc);
}

This example shows one factory method corresponding to each Frame constructor:

An implication of this pattern is that classes that the factory instantiates should support as many of the same constructors of the requested base class as possible.


Method Summary
 java.lang.Class[] getSupportedServiceInterfaces()
          This method is used to obtain the service interfaces for which this factory can build user interfaces.
 java.lang.Class[] getSupportedUIClasses()
          This method is used to get the desired type of user interface for a service, based on the class of the UI object.
 

Method Detail

getSupportedServiceInterfaces

public java.lang.Class[] getSupportedServiceInterfaces()
This method is used to obtain the service interfaces for which this factory can build user interfaces. This allows the same factory to be a provider of user interfaces for different types of service interfaces, if desired.

Returns:
array of service interfaces for which this factory can produce user interfaces.

getSupportedUIClasses

public java.lang.Class[] getSupportedUIClasses()
This method is used to get the desired type of user interface for a service, based on the class of the UI object.

Returns:
Java types of user interfaces produced by this factory.

Openwings API Documentation (v1.1)