The Artima Developer Community
Sponsored Link

Version 1.1a
The ServiceUI API Specification
by Bill Venners

<<  Page 12 of 12

Advertisement

10. Package net.jini.lookup.entry

The Service UI API defines two classes, UIDescriptor and UIDescriptorBean, that were placed in a pre-existing package, net.jini.lookup.entry. This specification does not provide a complete specification of the net.jini.lookup.entry package. It does, however, provide a complete specification of classes net.jini.lookup.entry.UIDescriptor and net.jini.lookup.entry.UIDescriptorBean.

10.1. Class net.jini.lookup.entry.UIDescriptor

public class UIDescriptor
     extends net.jini.entry.AbstractEntry

Entry that enables a UI for a service to be associated with the service in the attribute sets of the service item. UIDescriptor holds a marshalled UI factory object, as well as a role string, a sub-role string, and set of attributes that describe the UI generated by the factory.

10.1.1. Constructor UIDescriptor()

public UIDescriptor()

Constructs a UIDescriptor with all fields set to null.

10.1.2. Constructor UIDescriptor(java.lang.String, java.lang.String, java.util.Set, java.rmi.MarshalledObject)

public UIDescriptor(java.lang.String role, java.lang.String toolkit, java.util.Set attributes, java.rmi.MarshalledObject factory)

Constructs a UIDescriptor with the fields set to passed values. This constructor copies the contents of the passed attributes Set into a serializable read-only Set that has a consistent serialized form across all VMs, and initializes the attributes field with the consistent Set.

Parameters:
role - the role
toolkit - the toolkit
attributes - the attributes
factory - the factory

10.1.3. Field role

public role

Gives the fully qualified name of the interface that represents the role of the UI generated by the marshalled UI factory. If the client program unmarshals the UI factory and invokes a factory method, the UI returned by the factory method must implement the role the interface specified by role.

For a client program to be able to use a UI, the client has to have prior knowledge of the UI semantics, which is defined by the UI's role type. Thus, for a client to be able to use a UI, the client must understand the semantics of the type whose fully qualified name is given in the String referenced from the role field of that UI's UIDescriptor.

For example, two role types that are defined in the net.jini.lookup.ui package by the Jini Service UI Specification are MainUI, for a main UI to a Jini service, and AdminUI, for an administration UI. Other role types may be defined by the Jini Service UI Specification and by individual Jini service API specifications.

As the strings referenced from the role field are Java type names, they are intended to be manipulated by client programs only. They should not be shown to a user.

10.1.4. Field toolkit

public toolkit

A String to facilitate searching whose value represents the main UI toolkit (for example Swing or AWT) which the produced UI makes use of. The value to which this field should be set is defined by the semantics of the factory type. (This field is intended to facilitate searches. For example, a client can search for all blender services that have Swing MainUI's.)

10.1.5. Field attributes

public attributes

A set of objects that describe the UI generated by the marshalled UI factory.

10.1.6. Field factory

public factory

The get() method of this MarshalledObject must return an object that implements one or more UI factory interfaces. The actual UI factory type or types implemented by the returned object must be described by a UIFactoryTypes attribute placed in the attributes set of this UIDescriptor.

10.1.7. Method getUIFactory(java.lang.ClassLoader)

public final java.lang.Object getUIFactory(java.lang.ClassLoader parentLoader)
     throws java.io.IOException, java.lang.ClassNotFoundException

A convenience method for unmarshalling the UI factory stored in the MarshalledObject referenced from the factory field. This method saves a reference to the current context class loader, sets the context class loader to the class loader passed as parentLoader, invokes get() on the marshalled object, then resets the context class loader to the saved reference before returning the object produced by get().

The class loader passed in parentLoader should be able to load classes needed when the UI interacts with the roleObject passed as the first parameter to the factory method. For example, if the roleObject is the service item (as it is for the MainUI and AdminUI roles), the class loader passed in parentLoader could be the class loader with which the service proxy object referenced from the service item's service field was loaded. For example:

 Object uiFactory = uiDescriptor.getUIFactory(
     serviceItem.service.getClass().getClassLoader());
 
Throws:
NullPointerException - if parentLoader is null.

10.1.8. Serialized Form of net.jini.lookup.entry.UIDescriptor

10.1.8.1. Serialized Field role

java.lang.String role

Gives the fully qualified name of the interface that represents the role of the UI generated by the marshalled UI factory. If the client program unmarshals the UI factory and invokes a factory method, the UI returned by the factory method must implement the role the interface specified by role.

For a client program to be able to use a UI, the client has to have prior knowledge of the UI semantics, which is defined by the UI's role type. Thus, for a client to be able to use a UI, the client must understand the semantics of the type whose fully qualified name is given in the String referenced from the role field of that UI's UIDescriptor.

For example, two role types that are defined in the net.jini.lookup.ui package by the Jini Service UI Specification are MainUI, for a main UI to a Jini service, and AdminUI, for an administration UI. Other role types may be defined by the Jini Service UI Specification and by individual Jini service API specifications.

As the strings referenced from the role field are Java type names, they are intended to be manipulated by client programs only. They should not be shown to a user.

10.1.8.2. Serialized Field toolkit

java.lang.String toolkit

A String to facilitate searching whose value represents the main UI toolkit (for example Swing or AWT) which the produced UI makes use of. The value to which this field should be set is defined by the semantics of the factory type. (This field is intended to facilitate searches. For example, a client can search for all blender services that have Swing MainUI's.)

10.1.8.3. Serialized Field attributes

java.util.Set attributes

A set of objects that describe the UI generated by the marshalled UI factory.

10.1.8.4. Serialized Field factory

java.rmi.MarshalledObject factory

The get() method of this MarshalledObject must return an object that implements one or more UI factory interfaces. The actual UI factory type or types implemented by the returned object must be described by a UIFactoryTypes attribute placed in the attributes set of this UIDescriptor.

10.2. Class net.jini.lookup.entry.UIDescriptorBean

public class UIDescriptorBean
     extends java.lang.Object
     implements net.jini.lookup.entry.EntryBean, java.io.Serializable

A JavaBeans(TM) component that encapsulates a UIDescriptor object.

10.2.1. Constructor UIDescriptorBean()

public UIDescriptorBean()

Construct a new JavaBeans component, linked to a new empty UIDescriptor object.

10.2.2. Field assoc

protected assoc

The UIDescriptor object associated with this JavaBeans component.

10.2.3. Method makeLink(net.jini.core.entry.Entry)

public void makeLink(net.jini.core.entry.Entry e)

Make a link to a UIDescriptor object.

Parameters:
e - the Entry object, which must be a UIDescriptor, to which to link
Throws:
java.lang.ClassCastException - the Entry is not a UIDescriptor, the correct type for this JavaBeans component

10.2.4. Method followLink()

public net.jini.core.entry.Entry followLink()

Return the UIDescriptor linked to by this JavaBeans component.

10.2.5. Method getRole()

public java.lang.String getRole()

Return the value of the role field in the object linked to by this JavaBeans component.

10.2.6. Method setRole(java.lang.String)

public void setRole(java.lang.String role)

Set the value of the role field in the object linked to by this JavaBeans component.

Parameters:
role - a String specifying the role value

10.2.7. Method getToolkit()

public java.lang.String getToolkit()

Return the value of the toolkit field in the object linked to by this JavaBeans component.

10.2.8. Method setToolkit(java.lang.String)

public void setToolkit(java.lang.String toolkit)

Set the value of the toolkit field in the object linked to by this JavaBeans component.

Parameters:
toolkit - a String specifying the toolkit value

10.2.9. Method getAttributes()

public java.util.Set getAttributes()

Return the value of the attributes field in the object linked to by this JavaBeans component.

10.2.10. Method setAttributes(java.util.Set)

public void setAttributes(java.util.Set attributes)

Set the value of the attributes field in the object linked to by this JavaBeans component.

Parameters:
attributes - a Set specifying the attributes value

10.2.11. Method getFactory()

public java.rmi.MarshalledObject getFactory()

Return the value of the factory field in the object linked to by this JavaBeans component.

10.2.12. Method setFactory(java.rmi.MarshalledObject)

public void setFactory(java.rmi.MarshalledObject factory)

Set the value of the factory field in the object linked to by this JavaBeans component.

Parameters:
factory - a MarshalledObject specifying the factory value

10.2.13. Serialized Form of net.jini.lookup.entry.UIDescriptorBean

10.2.13.1. Serialized Field assoc

net.jini.lookup.entry.UIDescriptor assoc

The UIDescriptor object associated with this JavaBeans component.

11. Package net.jini.lookup.ui

Provides UI role interfaces used to associate service UIs with Jini services.

11.1. Summary of Interfaces In Package net.jini.lookup.ui

11.2. Summary of Classes In Package net.jini.lookup.ui

No classes are declared in package net.jini.lookup.ui.

11.3. Summary of Exceptions In Package net.jini.lookup.ui

No Exceptions are declared in package net.jini.lookup.ui.

11.4. Summary of Errors In Package net.jini.lookup.ui

No Errors are declared in package net.jini.lookup.ui.

11.5. Interface net.jini.lookup.ui.AboutUI

public interface AboutUI

UI role interface implemented by About UIs, which enable users to view (or in some way experience) information about a service. If a UI descriptor's UI factory produces a UI that implements this interface (i.e., produces a About UI), the UI descriptor's role field must reference a String with the value "net.jini.lookup.ui.AboutUI".

The first parameter of any factory method declared in a UI factory type is an object called the "role object." Any factory method that produces an About UI must accept as the role object the service item (the net.jini.core.lookup.ServiceItem) of the service with which the About UI is associated.

About UIs should allow clients to configure them before they begin. For example, About UIs produced by FrameFactory, JFrameFactory, WindowFactory and JWindowFactory (all members of the net.jini.lookup.ui.factory package) should not be visible when they are returned from the factory method. This allows clients to set the UI's position and size, for example, before making the UI visible by invoking setVisible(true) on the UI.

A client should be able to invoke a About UI factory method multiple times sequentially. In other words, if a user uses a service via a About UI, then says exit, then double clicks once again on the service icon, the client can just simply invoke a UI factory method again, and get another About UI for the same service. About UIs, therefore, should be written so that they work no matter what state the service object happens to be in when the About UI is created.

It is recommended that clients use multiple About UIs for the same service only sequentially, and avoid creating multiple About UIs for the same service that operate concurrently with one another. But because some clients may create and use multiple About UIs at the same time for the same service, providers of services and About UIs should program defensively, to ensure that multiple About UIs for the same service at the same time will all work together concurrently.

11.5.1. Field ROLE

public static final ROLE

Convenience constant to use in the role field of UIDescriptors for AboutUI role UIs. The value of this constant is "net.jini.lookup.ui.AboutUI".

11.6. Interface net.jini.lookup.ui.AdminUI

public interface AdminUI

UI role interface implemented by Admin UIs, which enable users to administer a service. If a UI descriptor's UI factory produces a UI that implements this interface (i.e., produces a Admin UI), the UI descriptor's role field must reference a String with the value "net.jini.lookup.ui.AdminUI".

The first parameter of any factory method declared in a UI factory type is an object called the "role object." Any factory method that produces an Admin UI must accept as the role object the service item (the net.jini.core.lookup.ServiceItem) of the service with which the Admin UI is associated.

Admin UIs should allow clients to configure them before they begin. For example, Admin UIs produced by FrameFactory, JFrameFactory, WindowFactory and JWindowFactory (all members of the net.jini.lookup.ui.factory package) should not be visible when they are returned from the factory method. This allows clients to set the UI's position and size, for example, before making the UI visible by invoking setVisible(true) on the UI.

A client should be able to invoke a Admin UI factory method multiple times sequentially. In other words, if a user uses a service via a Admin UI, then says exit, then double clicks once again on the service icon, the client can just simply invoke a UI factory method again, and get another Admin UI for the same service. Admin UIs, therefore, should be written so that they work no matter what state the service object happens to be in when the Admin UI is created.

It is recommended that clients use multiple Admin UIs for the same service only sequentially, and avoid creating multiple Admin UIs for the same service that operate concurrently with one another. But because some clients may create and use multiple Admin UIs at the same time for the same service, providers of services and Admin UIs should program defensively, to ensure that multiple Admin UIs for the same service at the same time will all work together concurrently.

11.6.1. Field ROLE

public static final ROLE

Convenience constant to use in the role field of UIDescriptors for AdminUI role UIs. The value of this constant is "net.jini.lookup.ui.AdminUI".

11.7. Interface net.jini.lookup.ui.MainUI

public interface MainUI

UI role interface implemented by Main UIs, which enable client programs to grant users general access to a service. If a UI descriptor's UI factory produces a UI that implements this interface (i.e., produces a Main UI), the UI descriptor's role field must reference a String with the value "net.jini.lookup.ui.MainUI".

The first parameter of any factory method declared in a UI factory type is an object called the "role object." Any factory method that produces an Main UI must accept as the role object the service item (the net.jini.core.lookup.ServiceItem) of the service with which the Main UI is associated.

Main UIs should allow clients to configure them before they begin. For example, Main UIs produced by FrameFactory, JFrameFactory, WindowFactory and JWindowFactory (all members of the net.jini.lookup.ui.factory package) should not be visible when they are returned from the factory method. This allows clients to set the UI's position and size, for example, before making the UI visible by invoking setVisible(true) on the UI.

A client should be able to invoke a Main UI factory method multiple times sequentially. In other words, if a user uses a service via a Main UI, then says exit, then double clicks once again on the service icon, the client can just simply invoke a UI factory method again, and get another Main UI for the same service. Main UIs, therefore, should be written so that they work no matter what state the service object happens to be in when the Main UI is created.

It is recommended that clients use multiple Main UIs for the same service only sequentially, and avoid creating multiple Main UIs for the same service that operate concurrently with one another. But because some clients may create and use multiple Main UIs at the same time for the same service, providers of services and main UIs should program defensively, to ensure that multiple Main UIs for the same service at the same time will all work together concurrently.

11.7.1. Field ROLE

public static final ROLE

Convenience constant to use in the role field of UIDescriptors for MainUI role UIs. The value of this constant is "net.jini.lookup.ui.MainUI".

12. Package net.jini.lookup.ui.factory

Provides UI factory interfaces used to associate service UIs with Jini services.

12.1. Summary of Interfaces In Package net.jini.lookup.ui.factory

12.2. Summary of Classes In Package net.jini.lookup.ui.factory

No classes are declared in package net.jini.lookup.ui.factory.

12.3. Summary of Exceptions In Package net.jini.lookup.ui.factory

No Exceptions are declared in package net.jini.lookup.ui.factory.

12.4. Summary of Errors In Package net.jini.lookup.ui.factory

No Errors are declared in package net.jini.lookup.ui.factory.

12.5. Interface net.jini.lookup.ui.factory.DialogFactory

public interface DialogFactory
     extends java.io.Serializable

UI factory for a modal or non-modal AWT Dialog with a predetermined title.

If the UI generated by the method declared in this interface implements javax.accessibility.Accessible and supports the Java Accessibility API, an AccessibleUI attribute should be placed in the UIDescriptor's attributes set.

12.5.1. Field TOOLKIT

public static final TOOLKIT

Convenience constant to use in the toolkit field of UIDescriptors that contain a DialogFactory. The value of this constant is "java.awt".

12.5.2. Field TYPE_NAME

public static final TYPE_NAME

Convenience constant to use in the UIFactoryTypes set in the attributes set of UIDescriptors that contain a DialogFactory. The value of this constant is "net.jini.lookup.ui.factory.DialogFactory".

12.5.3. Method getDialog(java.lang.Object, java.awt.Dialog)

public java.awt.Dialog getDialog(java.lang.Object roleObject, java.awt.Dialog owner)

Returns a non-modal Dialog with predetermined title and the specified owner Dialog.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Dialog to act as owner of the returned Dialog

12.5.4. Method getDialog(java.lang.Object, java.awt.Frame)

public java.awt.Dialog getDialog(java.lang.Object roleObject, java.awt.Frame owner)

Returns a non-modal Dialog with predetermined title and the specified owner Frame.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Frame to act as owner of the returned Dialog

12.5.5. Method getDialog(java.lang.Object, java.awt.Dialog, boolean)

public java.awt.Dialog getDialog(java.lang.Object roleObject, java.awt.Dialog owner, boolean modal)

Returns a Dialog with predetermined title and the specified modality and owner Dialog.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Dialog to act as owner of the returned Dialog
modal - if true, the returned Dialog will block input to other windows when shown

12.5.6. Method getDialog(java.lang.Object, java.awt.Frame, boolean)

public java.awt.Dialog getDialog(java.lang.Object roleObject, java.awt.Frame owner, boolean modal)

Returns a Dialog with predetermined title and the specified modality and owner Frame.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Frame to act as owner of the returned Dialog
modal - if true, the returned Dialog will block input to other windows when shown

12.6. Interface net.jini.lookup.ui.factory.FrameFactory

public interface FrameFactory
     extends java.io.Serializable

UI factory for an AWT Frame with a predetermined title.

If the UI generated by the method declared in this interface implements javax.accessibility.Accessible and supports the Java Accessibility API, an AccessibleUI attribute should be placed in the UIDescriptor's attributes set.

12.6.1. Field TOOLKIT

public static final TOOLKIT

Convenience constant to use in the toolkit field of UIDescriptors that contain a FrameFactory. The value of this constant is "java.awt".

12.6.2. Field TYPE_NAME

public static final TYPE_NAME

Convenience constant to use in the UIFactoryTypes set in the attributes set of UIDescriptors that contain a FrameFactory. The value of this constant is "net.jini.lookup.ui.factory.FrameFactory".

12.6.3. Method getFrame(java.lang.Object)

public java.awt.Frame getFrame(java.lang.Object roleObject)

Returns a Frame with predetermined title.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)

12.7. Interface net.jini.lookup.ui.factory.JComponentFactory

public interface JComponentFactory
     extends java.io.Serializable

UI factory for a Swing JComponent.

If the UI generated by the method declared in this interface implements javax.accessibility.Accessible and supports the Java Accessibility API, an AccessibleUI attribute should be placed in the UIDescriptor's attributes set.

12.7.1. Field TOOLKIT

public static final TOOLKIT

Convenience constant to use in the toolkit field of UIDescriptors that contain a JComponentFactory. The value of this constant is "javax.swing".

12.7.2. Field TYPE_NAME

public static final TYPE_NAME

Convenience constant to use in the UIFactoryTypes set in the attributes set of UIDescriptors that contain a JComponentFactory. The value of this constant is "net.jini.lookup.ui.factory.JComponentFactory".

12.7.3. Method getJComponent(java.lang.Object)

public javax.swing.JComponent getJComponent(java.lang.Object roleObject)

Returns a JComponent.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)

12.8. Interface net.jini.lookup.ui.factory.JDialogFactory

public interface JDialogFactory
     extends java.io.Serializable

UI factory for a modal or non-modal Swing JDialog with a predetermined title.

If the UI generated by the method declared in this interface implements javax.accessibility.Accessible and supports the Java Accessibility API, an AccessibleUI attribute should be placed in the UIDescriptor's attributes set.

12.8.1. Field TOOLKIT

public static final TOOLKIT

Convenience constant to use in the toolkit field of UIDescriptors that contain a JDialogFactory. The value of this constant is "javax.swing".

12.8.2. Field TYPE_NAME

public static final TYPE_NAME

Convenience constant to use in the UIFactoryTypes set in the attributes set of UIDescriptors that contain a JDialogFactory. The value of this constant is "net.jini.lookup.ui.factory.JDialogFactory".

12.8.3. Method getJDialog(java.lang.Object)

public javax.swing.JDialog getJDialog(java.lang.Object roleObject)

Returns a non-modal JDialog with predetermined title and no specified owner.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)

12.8.4. Method getJDialog(java.lang.Object, java.awt.Dialog)

public javax.swing.JDialog getJDialog(java.lang.Object roleObject, java.awt.Dialog owner)

Returns a non-modal JDialog with a predetermined title with the specified owner Dialog.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Dialog to act as owner of the returned JDialog

12.8.5. Method getJDialog(java.lang.Object, java.awt.Frame)

public javax.swing.JDialog getJDialog(java.lang.Object roleObject, java.awt.Frame owner)

Returns a non-modal JDialog with a predetermined title with the specified owner Frame.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Frame to act as owner of the returned JDialog

12.8.6. Method getJDialog(java.lang.Object, java.awt.Dialog, boolean)

public javax.swing.JDialog getJDialog(java.lang.Object roleObject, java.awt.Dialog owner, boolean modal)

Returns a JDialog with predetermined title and the specified modality and owner Dialog.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Dialog to act as owner of the returned JDialog
modal - if true, the returned JDialog will block input to other windows when shown

12.8.7. Method getJDialog(java.lang.Object, java.awt.Frame, boolean)

public javax.swing.JDialog getJDialog(java.lang.Object roleObject, java.awt.Frame owner, boolean modal)

Returns a JDialog with predetermined title and the specified modality and owner Frame.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Frame to act as owner of the returned JDialog
modal - if true, the returned JDialog will block input to other windows when shown

12.9. Interface net.jini.lookup.ui.factory.JFrameFactory

public interface JFrameFactory
     extends java.io.Serializable

UI factory for a Swing JFrame with a predetermined title.

If the UI generated by the method declared in this interface implements javax.accessibility.Accessible and supports the Java Accessibility API, an AccessibleUI attribute should be placed in the UIDescriptor's attributes set.

12.9.1. Field TOOLKIT

public static final TOOLKIT

Convenience constant to use in the toolkit field of UIDescriptors that contain a JFrameFactory. The value of this constant is "javax.swing".

12.9.2. Field TYPE_NAME

public static final TYPE_NAME

Convenience constant to use in the UIFactoryTypes set in the attributes set of UIDescriptors that contain a JFrameFactory. The value of this constant is "net.jini.lookup.ui.factory.JFrameFactory".

12.9.3. Method getJFrame(java.lang.Object)

public javax.swing.JFrame getJFrame(java.lang.Object roleObject)

Returns a JFrame with predetermined title.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)

12.10. Interface net.jini.lookup.ui.factory.JWindowFactory

public interface JWindowFactory
     extends java.io.Serializable

UI factory for a Swing JWindow.

If the UI generated by the method declared in this interface implements javax.accessibility.Accessible and supports the Java Accessibility API, an AccessibleUI attribute should be placed in the UIDescriptor's attributes set.

12.10.1. Field TOOLKIT

public static final TOOLKIT

Convenience constant to use in the toolkit field of UIDescriptors that contain a JWindowFactory. The value of this constant is "javax.swing".

12.10.2. Field TYPE_NAME

public static final TYPE_NAME

Convenience constant to use in the UIFactoryTypes set in the attributes set of UIDescriptors that contain a JWindowFactory. The value of this constant is "net.jini.lookup.ui.factory.JWindowFactory".

12.10.3. Method getJWindow(java.lang.Object)

public javax.swing.JWindow getJWindow(java.lang.Object roleObject)

Returns a JWindow with no specified owner.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)

12.10.4. Method getJWindow(java.lang.Object, java.awt.Window)

public javax.swing.JWindow getJWindow(java.lang.Object roleObject, java.awt.Window owner)

Returns a JWindow with specified owner Window.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Window to act as owner of the returned JWindow

12.10.5. Method getJWindow(java.lang.Object, java.awt.Frame)

public javax.swing.JWindow getJWindow(java.lang.Object roleObject, java.awt.Frame owner)

Returns a JWindow with specified owner Frame.

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Frame to act as owner of the returned JWindow

12.11. Interface net.jini.lookup.ui.factory.PanelFactory

public interface PanelFactory
     extends java.io.Serializable

UI factory for an AWT Panel.

If the UI generated by the method declared in this interface implements javax.accessibility.Accessible and supports the Java Accessibility API, an AccessibleUI attribute should be placed in the UIDescriptor's attributes set.

A PreferredTitle may be placed in the attributes set to indicate a preferred title of a pop-up window containing this component.

12.11.1. Field TOOLKIT

public static final TOOLKIT

Convenience constant to use in the toolkit field of UIDescriptors that contain a PanelFactory. The value of this constant is "java.awt".

12.11.2. Field TYPE_NAME

public static final TYPE_NAME

Convenience constant to use in the UIFactoryTypes set in the attributes set of UIDescriptors that contain a JPanelFactory. The value of this constant is "net.jini.lookup.ui.factory.PanelFactory".

12.11.3. Method getPanel(java.lang.Object)

public java.awt.Panel getPanel(java.lang.Object roleObject)

Returns a Panel.

12.12. Interface net.jini.lookup.ui.factory.WindowFactory

public interface WindowFactory
     extends java.io.Serializable

UI factory for an AWT Window that isn't a Frame or a Dialog. AWT Frames should be produced by a FrameFactory. AWT Dialogs should be produced by a DialogFactory.)

If the UI generated by the method declared in this interface implements javax.accessibility.Accessible and supports the Java Accessibility API, an AccessibleUI attribute should be placed in the UIDescriptor's attributes set.

12.12.1. Field TOOLKIT

public static final TOOLKIT

Convenience constant to use in the toolkit field of UIDescriptors that contain a WindowFactory. The value of this constant is "java.awt".

12.12.2. Field TYPE_NAME

public static final TYPE_NAME

Convenience constant to use in the UIFactoryTypes set in the attributes set of UIDescriptors that contain a WindowFactory. The value of this constant is "net.jini.lookup.ui.factory.WindowFactory".

12.12.3. Method getWindow(java.lang.Object, java.awt.Window)

public java.awt.Window getWindow(java.lang.Object roleObject, java.awt.Window owner)

Returns a Window with specified owner Window

Parameters:
roleObject - an object defined by the semantics of the UI role interface implemented by the returned UI object. (UI role is indicated in the role field of UIDescriptors.)
owner - the Window to act as owner of the returned Window

12.12.4. Method getWindow(java.lang.Object, java.awt.Frame)

public java.awt.Window getWindow(java.lang.Object roleObject, java.awt.Frame owner)

Returns a Window with specified owner Frame

Parameters:
owner - the Frame to act as owner of the returned Window

13. Package net.jini.lookup.ui.attribute

Provides attribute classes used to associate service UIs with Jini services.

13.1. Summary of Interfaces In Package net.jini.lookup.ui.attribute

No interfaces are declared in package net.jini.lookup.ui.attribute.

13.2. Summary of Classes In Package net.jini.lookup.ui.attribute

13.3. Summary of Exceptions In Package net.jini.lookup.ui.attribute

No Exceptions are declared in package net.jini.lookup.ui.attribute.

13.4. Summary of Errors In Package net.jini.lookup.ui.attribute

No Errors are declared in package net.jini.lookup.ui.attribute.

13.5. Class net.jini.lookup.ui.attribute.AccessibleUI

public class AccessibleUI
     extends java.lang.Object
     implements java.io.Serializable

UI attribute that indicates a generated UI implements the the javax.accessibility.Accessible interface and that the designer of the UI did the necessary work to make sure the UI would work well with assistive technologies that are aware of the Java Accessibility API.

Only UIDescriptors whose marshalled UI factory produces a UI that supports the Accessibility API should include this attribute. The presence of this attribute in an attribute set means the produced UI will work well with assistive technologies that are aware of the Java Accessibility API.

13.5.1. Constructor AccessibleUI()

public AccessibleUI()

Constructs a new AccessibleUI attribute.

13.5.2. Method equals(java.lang.Object)

public boolean equals(java.lang.Object o)

Compares the specified object (passed in o) with this AccessibleUI object for equality. Returns true if o is non-null and the fully qualified class name of the specified object (passed in o) is the same as the fully qualified class name of this object.

Parameters:
o - the object to compare against

13.5.3. Method hashCode()

public int hashCode()

Returns the hash code value for this AccessibleUI. As all AccessibleUI objects are conceptually equivalent, this method returns the hash code value for this object's fully qualified class name String.

13.5.4. Serialized Form of net.jini.lookup.ui.attribute.AccessibleUI

Serialized form of class net.jini.lookup.ui.attribute.AccessibleUI has no serialized fields.

13.6. Class net.jini.lookup.ui.attribute.Locales

public class Locales
     extends java.lang.Object
     implements java.io.Serializable

UI attribute that lists the locales supported by a generated UI.

13.6.1. Constructor Locales(java.util.Set)

public Locales(java.util.Set locales)

Constructs a Locales using the passed Set. The Set can be mutable or immutable, and must contain only java.util.Locale objects. Each Locale must represent a locale that is supported by the UI generated by the UI factory stored in marshalled form in the same UIDescriptor. This constructor copies the contents of the passed Set into a serializable read-only Set that has a consistent serialized form across all VMs.

Parameters:
locales - A Set of Locale objects. Each element must be non-null and an instance of java.util.Locale.
Throws:
NullPointerException - if locales is null or any element of locales set is null.
IllegalArgumentException - if any non-null element of locales set is not an instance of java.util.Locale.

13.6.2. Method isLocaleSupported(java.util.Locale)

public boolean isLocaleSupported(java.util.Locale locale)

Indicates whether or not a locale is supported by the UI generated by the UI factory stored in the marshalled object of the same UIDescriptor. This method returns true only if the passed Locale exactly matches a Locale supported by the UI, as defined by the equals() method of class java.util.Locale. For example, imagine the UI supports the "en" (General English) locale, but not the "en_US" (US English) locale. Then, if "en_US" is passed to this method, the method will return false.

Parameters:
locale - the locale to check
Throws:
NullPointerException - if locale is null.

13.6.3. Method getFirstSupportedLocale(java.util.Locale[])

public java.util.Locale getFirstSupportedLocale(java.util.Locale[] locales)

Looks through the passed array of Locales (in the order they appear in the array) and returns the first Locale that is supported by the UI (as defined by isLocaleSupported()), or null, if none of the Locales in the passed array are supported by the UI.

Parameters:
locales - an array of locales in order of most desired to least desired
Throws:
NullPointerException - if locales is null.

13.6.4. Method getFirstSupportedLocale(java.util.List)

public java.util.Locale getFirstSupportedLocale(java.util.List locales)

Iterates through the passed List of Locales and returns the first Locale that is supported by the UI (as defined by isLocaleSupported()), or null, if none of the Locales in the passed array are supported by the UI.

Parameters:
locales - a List of locales in order of most desired to least desired
Throws:
NullPointerException - if locales is null.

13.6.5. Method iterator()

public java.util.Iterator iterator()

Returns an iterator over the set of java.util.Locale objects, one for each locale supported by the UI generated by the UI factory stored in the marshalled object of the same UIDescriptor. The returned Iterator does not support remove().

13.6.6. Method getLocales()

public java.util.Set getLocales()

Returns an unmodifiable java.util.Set that contains java.util.Locale objects, one for each locale supported by the UI generated by the UI factory stored in the marshalled object of the same UIDescriptor.

13.6.7. Method equals(java.lang.Object)

public boolean equals(java.lang.Object o)

Compares the specified object (the Object passed in o) with this Locales object for equality. Returns true if the specified object is not null, if the specified object's class is Locales, if the two sets of supported locales are the same size, and if every locale mentioned in the specified Locales object (passed in o) is also mentioned in this Locales object.

Parameters:
o - the object to compare against

13.6.8. Method hashCode()

public int hashCode()

Returns the hash code value for this Locales object.

13.6.9. Serialized Form of net.jini.lookup.ui.attribute.Locales

13.6.9.1. Serialized Field supportedLocales

java.util.Set supportedLocales

A Set of java.util.Locale objects, each of which represents one locale supported by the UI generated by the UI factory stored in marshalled form in the same UIDescriptor.

13.7. Class net.jini.lookup.ui.attribute.RequiredPackages

public class RequiredPackages
     extends java.lang.Object
     implements java.io.Serializable

UI attribute that enables clients to get a list of the fully qualified names and version numbers of packages required by a UI.

One or more RequiredPackages attributes may appear in the attributes of a UIDescriptor. Client programs interested in a UI may wish to verify that they have all required packages mentioned in the RequiredPackages attributes (if any) contained in the UI's UIDescriptor, before they attempt to create the UI. If the client is lacking any required packages (either because the entire package is absent or because the package is present but of an incompatible version), the client will not be able to use the UI,

The intent of this attribute is to provide a quick way for a client program to determine that a UI is unusable by a client, not to grant a guarantee that a UI is definitely usable by the client. If a client is missing a required package, or has an incompatible version of a required package, the client cannot use the UI. But if the client has compatible versions of all required packages listed in a RequiredPackage attribute, the client may or may not be able to use the UI.

UI providers should take bold and valiant strides to list in a RequiredPackage attribute all known packages required of the client, so that if the client discovers it has compatible versions of all listed packages and attempts to generate the UI via the factory method, the client will likely succeed. However, client programmers should bear in mind that a RequiredPackage attribute doesn't necessarily list all required packages. As a result, satisfying all required packages doesn't absolutely guarantee the UI will work on the client. As a result, client programs should program defensively. (For example, clients should probably catch LinkageError in appropriate places when dealing with UIs, even if they find they have compatible versions of all required packages listed in RequiredPackage attributes.) The version numbers must take the form of "specification version numbers," as used by the java.lang.Package class:

Specification version numbers use a "Dewey Decimal" syntax that consists of positive decimal integers separated by periods ".", for example, "2.0" or "1.2.3.4.5.6.7". This allows an extensible number to be used to represent major, minor, micro, etc versions. The version number must begin with a number.

13.7.1. Constructor RequiredPackages(java.util.Map)

public RequiredPackages(java.util.Map packages)

Constructs a RequiredPackages attribute with the passed Map. The keys contained in the passed Map must be Strings that represent fully qualified names of required packages. Each value contained in the passed Map must be the oldest version number of the package (defined by the key) that is compatible with the UI. Version numbers are Strings in the form of "specification version numbers," as used by the java.lang.Package class. This constructor copies the contents of the passed Map into a serializable unmodifiable Map that has a consistent serialized form across all VMs.

Parameters:
packages - a map of String fully qualified names of required packages to String version numbers
Throws:
NullPointerException - if packages is null or if any keys or values contained in packages are null.
IllegalArgumentException - if any non-null key or value contained in packages set is not an instance of java.lang.String.

13.7.2. Method iterator()

public java.util.Iterator iterator()

Returns an iterator over the set of String fully qualified package names required by the UI generated by the UI factory stored in the marshalled object of the same UIDescriptor. The returned Iterator does not support remove().

13.7.3. Method getVersion(java.lang.String)

public java.lang.String getVersion(java.lang.String packageName)

Returns a version number for the required package whose fully qualified package name is passed as the packageName parameter. If the passed String does not represent a required package listed in this RequiredPackage attribute, this method returns null. The version number returned should be a "specification version number," as used by the java.lang.Package class:

Specification version numbers use a "Dewey Decimal" syntax that consists of positive decimal integers separated by periods ".", for example, "2.0" or "1.2.3.4.5.6.7". This allows an extensible number to be used to represent major, minor, micro, etc versions. The version number must begin with a number.
Throws:
NullPointerException - if packageName is null.

13.7.4. Method getRequiredPackages()

public java.util.Map getRequiredPackages()

Returns a java.util.Map whose keys are Strings that represent fully qualified names of required packages and whose values are be the oldest version number of the package (defined by the key) that is compatible with the UI. Version numbers are Strings in the form of "specification version numbers," as used by the java.lang.Package class: The version numbers contained as values in the returned Map should be a "specification version number," as used by the java.lang.Package class:

Specification version numbers use a "Dewey Decimal" syntax that consists of positive decimal integers separated by periods ".", for example, "2.0" or "1.2.3.4.5.6.7". This allows an extensible number to be used to represent major, minor, micro, etc versions. The version number must begin with a number.

13.7.5. Method equals(java.lang.Object)

public boolean equals(java.lang.Object o)

Compares the specified object (the Object passed in o) with this RequiredPackages object for equality. Returns true if the specified object is not null, if the specified object's class is RequiredPackages, if the two sets of package-version pairs are the same size, and if every package-version pair mentioned in the specified RequiredPackages object (passed in o) is also mentioned in this RequiredPackages object.

Parameters:
o - the object to compare against

13.7.6. Method hashCode()

public int hashCode()

Returns the hash code value for this RequiredPackages object.

13.7.7. Serialized Form of net.jini.lookup.ui.attribute.RequiredPackages

13.7.7.1. Serialized Field requiredPackages

java.util.Map requiredPackages

A Map of String keys to String values. The keys contained in the Map must be Strings that represent fully qualified names of required packages. Each value contained in the Map must be the oldest version number of the package (defined by the key) that is compatible with the UI. Version numbers are Strings in the form of "specification version numbers," as used by the java.lang.Package class.

13.8. Class net.jini.lookup.ui.attribute.UIFactoryTypes

public class UIFactoryTypes
     extends java.lang.Object
     implements java.io.Serializable

UI attribute that lists UI factory interfaces of which a UI factory is an instance.

13.8.1. Constructor UIFactoryTypes(java.util.Set)

public UIFactoryTypes(java.util.Set typeNames)

Constructs a UIFactoryTypes attribute using the passed Set. The Set can be mutable or immutable, and must contain only Strings. Each String should represent a fully qualified Java type name of a UI factory interface. This constructor copies the contents of the passed Set into a serializable read-only Set that has a consistent serialized form across all VMs.

The isAssignableTo method of this class will only return true for types whose names are passed explicitly to this constructor via the typeNames parameter. This constructor does not inspect the inheritance hierarchies of the types whose names are passed via the typeNames parameter. It is the client's responsibility to include the name of every UI factory interface of which the relevant UI factory (the UI factory being described by this class) is an instance.

Parameters:
typeNames - A Set of String objects. Each element must be non-null and an instance of java.lang.String.
Throws:
NullPointerException - if typeNames is null or any element of typeNames set is null.
IllegalArgumentException - if any non-null element of typeNames set is not an instance of java.lang.String.

13.8.2. Method isAssignableTo(java.lang.Class)

public boolean isAssignableTo(java.lang.Class classObj)

Returns true if the UI factory (contained in marshalled form in the same UIDescriptor) is an instance of the UI factory interface type passed in parameter classObj. Else, returns false.

This method compares the fully qualified name of the type represented by the passed Class with the fully qualified names of UI factory interfaces implemented by the UI factory's class. If an exact string match is found, this method returns true. If the UI factory is ultimately loaded with a class loader whose parent-delegation chain doesn't include the class loader that defined the passed class, a type with the same name would be loaded into a different namespace of the virtual machine. If so, the two types would be considered different by the virtual machine, even though they shared the same fully qualified name.

Parameters:
classObj - the type to check
Throws:
NullPointerException - if classObj is null

13.8.3. Method iterator()

public java.util.Iterator iterator()

Returns an iterator over the set of types of which a UI factory object is an instance in no particular order. The returned Iterator does not support remove().

13.8.4. Method getTypeNames()

public java.util.Set getTypeNames()

Returns an unmodifiable Set of fully qualified type name Strings of which a UI factory is an instance in no particular order.

13.8.5. Method equals(java.lang.Object)

public boolean equals(java.lang.Object o)

Compares the specified object (the Object passed in o) with this UIFactoryTypes object for equality. Returns true if the specified object is not null, if the specified object's class is UIFactoryTypes, if the two sets of factory types are the same size, and if every factory type mentioned in the specified UIFactoryTypes object (passed in o) is also mentioned in this UIFactoryTypes object.

Parameters:
o - the object to compare against

13.8.6. Method hashCode()

public int hashCode()

Returns the hash code value for this UIFactoryTypes object.

13.8.7. Serialized Form of net.jini.lookup.ui.attribute.UIFactoryTypes

13.8.7.1. Serialized Field typeNames

java.util.Set typeNames

A Set of Strings, each of which represents one fully qualified type name. Each String type name should indicate one UI factory interface implemented by the UI factory contained in marshalled form in the same UIDescriptor in which this UIFactoryTypes appears.

ServiceUI is a trademark of Artima Software, Inc.

<<  Page 12 of 12


Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use