Sponsored Link •
|
Advertisement
|
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
.
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.
UIDescriptor()
public UIDescriptor()
Constructs a UIDescriptor
with all fields set to null
.
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
.
role
- the roletoolkit
- the toolkitattributes
- the attributesfactory
- the factoryrole
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.
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.)
attributes
public attributes
A set of objects that describe the UI generated by the marshalled UI factory.
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
.
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());
NullPointerException
- if parentLoader
is null.net.jini.lookup.entry.UIDescriptor
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.
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.)
attributes
java.util.Set attributes
A set of objects that describe the UI generated by the marshalled UI factory.
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
.
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.
UIDescriptorBean()
public UIDescriptorBean()
Construct a new JavaBeans component, linked to a new empty UIDescriptor
object.
assoc
protected assoc
The UIDescriptor
object associated with this JavaBeans component.
makeLink(net.jini.core.entry.Entry)
public void makeLink(net.jini.core.entry.Entry e)
Make a link to a UIDescriptor
object.
e
- the Entry
object, which must be a UIDescriptor
, to which to linkjava.lang.ClassCastException
- the Entry
is not
a UIDescriptor
, the correct type for this JavaBeans componentfollowLink()
public net.jini.core.entry.Entry followLink()
Return the UIDescriptor
linked to by this JavaBeans component.
getRole()
public java.lang.String getRole()
Return the value of the role
field in the object linked to by
this JavaBeans component.
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.
role
- a String
specifying the role valuegetToolkit()
public java.lang.String getToolkit()
Return the value of the toolkit
field in the object linked to by
this JavaBeans component.
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.
toolkit
- a String
specifying the toolkit valuegetAttributes()
public java.util.Set getAttributes()
Return the value of the attributes
field in the object linked to by
this JavaBeans component.
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.
attributes
- a Set
specifying the attributes valuegetFactory()
public java.rmi.MarshalledObject getFactory()
Return the value of the factory
field in the object linked to by
this JavaBeans component.
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.
factory
- a MarshalledObject
specifying the factory valuenet.jini.lookup.entry.UIDescriptorBean
assoc
net.jini.lookup.entry.UIDescriptor assoc
The UIDescriptor
object associated with this JavaBeans component.
net.jini.lookup.ui
net.jini.lookup.ui
AboutUI
- UI role interface implemented by About UIs, which enable users to
view (or in some way experience) information about a service.
AdminUI
- UI role interface implemented by Admin UIs,
which enable users to administer a service.
MainUI
- UI role interface implemented by Main UIs,
which enable client programs to grant users general access to a service.
net.jini.lookup.ui
No classes are declared in package net.jini.lookup.ui
.
Exception
s In Package net.jini.lookup.ui
No Exception
s are declared in package net.jini.lookup.ui
.
Error
s In Package net.jini.lookup.ui
No Error
s are declared in package net.jini.lookup.ui
.
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.
ROLE
public static final ROLE
Convenience constant to use in the role
field of UIDescriptor
s for AboutUI role UIs.
The value of this constant is "net.jini.lookup.ui.AboutUI"
.
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.
ROLE
public static final ROLE
Convenience constant to use in the role
field of UIDescriptor
s for AdminUI role UIs.
The value of this constant is "net.jini.lookup.ui.AdminUI"
.
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.
ROLE
public static final ROLE
Convenience constant to use in the role
field of UIDescriptor
s for MainUI role UIs.
The value of this constant is "net.jini.lookup.ui.MainUI"
.
net.jini.lookup.ui.factory
net.jini.lookup.ui.factory
DialogFactory
- UI factory for a modal or non-modal AWT Dialog
with a
predetermined title.
FrameFactory
- UI factory for an AWT Frame
with a predetermined
title.
JComponentFactory
- UI factory for a Swing JComponent
.
JDialogFactory
- UI factory for a modal or non-modal Swing JDialog
with a predetermined title.
JFrameFactory
- UI factory for a Swing JFrame
with a predetermined
title.
JWindowFactory
- UI factory for a Swing JWindow
.
PanelFactory
- UI factory for an AWT Panel
.
WindowFactory
- UI factory for an AWT Window
that isn't a Frame
or a Dialog
.
net.jini.lookup.ui.factory
No classes are declared in package net.jini.lookup.ui.factory
.
Exception
s In Package net.jini.lookup.ui.factory
No Exception
s are declared in package net.jini.lookup.ui.factory
.
Error
s In Package net.jini.lookup.ui.factory
No Error
s are declared in package net.jini.lookup.ui.factory
.
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.
TOOLKIT
public static final TOOLKIT
Convenience constant to use in the toolkit
field of UIDescriptor
s that contain a
DialogFactory
.
The value of this constant is "java.awt"
.
TYPE_NAME
public static final TYPE_NAME
Convenience constant to use in the UIFactoryTypes
set in the attributes
set of UIDescriptor
s
that contain a DialogFactory
.
The value of this constant is "net.jini.lookup.ui.factory.DialogFactory"
.
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
.
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 UIDescriptor
s.)owner
- the Dialog
to act as owner of the returned
Dialog
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
.
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 UIDescriptor
s.)owner
- the Frame
to act as owner of the returned
Dialog
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
.
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 UIDescriptor
s.)owner
- the Dialog
to act as owner of the returned
Dialog
modal
- if true
, the returned Dialog
will block
input to other windows when showngetDialog(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
.
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 UIDescriptor
s.)owner
- the Frame
to act as owner of the returned
Dialog
modal
- if true
, the returned Dialog
will block
input to other windows when shownnet.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.
TOOLKIT
public static final TOOLKIT
Convenience constant to use in the toolkit
field of UIDescriptor
s that contain a
FrameFactory
.
The value of this constant is "java.awt"
.
TYPE_NAME
public static final TYPE_NAME
Convenience constant to use in the UIFactoryTypes
set in the attributes
set of UIDescriptor
s
that contain a FrameFactory
.
The value of this constant is "net.jini.lookup.ui.factory.FrameFactory"
.
getFrame(java.lang.Object)
public java.awt.Frame getFrame(java.lang.Object roleObject)
Returns a Frame
with predetermined title.
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 UIDescriptor
s.)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.
TOOLKIT
public static final TOOLKIT
Convenience constant to use in the toolkit
field of UIDescriptor
s that contain a
JComponentFactory
.
The value of this constant is "javax.swing"
.
TYPE_NAME
public static final TYPE_NAME
Convenience constant to use in the UIFactoryTypes
set in the attributes
set of UIDescriptor
s
that contain a JComponentFactory
.
The value of this constant is "net.jini.lookup.ui.factory.JComponentFactory"
.
getJComponent(java.lang.Object)
public javax.swing.JComponent getJComponent(java.lang.Object roleObject)
Returns a JComponent
.
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 UIDescriptor
s.)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.
TOOLKIT
public static final TOOLKIT
Convenience constant to use in the toolkit
field of UIDescriptor
s that contain a
JDialogFactory
.
The value of this constant is "javax.swing"
.
TYPE_NAME
public static final TYPE_NAME
Convenience constant to use in the UIFactoryTypes
set in the attributes
set of UIDescriptor
s
that contain a JDialogFactory
.
The value of this constant is "net.jini.lookup.ui.factory.JDialogFactory"
.
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.
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 UIDescriptor
s.)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
.
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 UIDescriptor
s.)owner
- the Dialog
to act as owner of the returned
JDialog
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.
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 UIDescriptor
s.)owner
- the Frame
to act as owner of the returned
JDialog
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
.
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 UIDescriptor
s.)owner
- the Dialog
to act as owner of the returned
JDialog
modal
- if true
, the returned JDialog
will block
input to other windows when showngetJDialog(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
.
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 UIDescriptor
s.)owner
- the Frame
to act as owner of the returned
JDialog
modal
- if true
, the returned JDialog
will block
input to other windows when shownnet.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.
TOOLKIT
public static final TOOLKIT
Convenience constant to use in the toolkit
field of UIDescriptor
s that contain a
JFrameFactory
.
The value of this constant is "javax.swing"
.
TYPE_NAME
public static final TYPE_NAME
Convenience constant to use in the UIFactoryTypes
set in the attributes
set of UIDescriptor
s
that contain a JFrameFactory
.
The value of this constant is "net.jini.lookup.ui.factory.JFrameFactory"
.
getJFrame(java.lang.Object)
public javax.swing.JFrame getJFrame(java.lang.Object roleObject)
Returns a JFrame
with predetermined title.
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 UIDescriptor
s.)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.
TOOLKIT
public static final TOOLKIT
Convenience constant to use in the toolkit
field of UIDescriptor
s that contain a
JWindowFactory
.
The value of this constant is "javax.swing"
.
TYPE_NAME
public static final TYPE_NAME
Convenience constant to use in the UIFactoryTypes
set in the attributes
set of UIDescriptor
s
that contain a JWindowFactory
.
The value of this constant is "net.jini.lookup.ui.factory.JWindowFactory"
.
getJWindow(java.lang.Object)
public javax.swing.JWindow getJWindow(java.lang.Object roleObject)
Returns a JWindow
with no specified
owner.
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 UIDescriptor
s.)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
.
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 UIDescriptor
s.)owner
- the Window
to act as owner of the returned
JWindow
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
.
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 UIDescriptor
s.)owner
- the Frame
to act as owner of the returned
JWindow
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.
TOOLKIT
public static final TOOLKIT
Convenience constant to use in the toolkit
field of UIDescriptor
s that contain a
PanelFactory
.
The value of this constant is "java.awt"
.
TYPE_NAME
public static final TYPE_NAME
Convenience constant to use in the UIFactoryTypes
set in the attributes
set of UIDescriptor
s
that contain a JPanelFactory
.
The value of this constant is "net.jini.lookup.ui.factory.PanelFactory"
.
getPanel(java.lang.Object)
public java.awt.Panel getPanel(java.lang.Object roleObject)
Returns a Panel
.
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 Frame
s should be produced by a FrameFactory
.
AWT Dialog
s 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.
TOOLKIT
public static final TOOLKIT
Convenience constant to use in the toolkit
field of UIDescriptor
s that contain a
WindowFactory
.
The value of this constant is "java.awt"
.
TYPE_NAME
public static final TYPE_NAME
Convenience constant to use in the UIFactoryTypes
set in the attributes
set of UIDescriptor
s
that contain a WindowFactory
.
The value of this constant is "net.jini.lookup.ui.factory.WindowFactory"
.
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
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 UIDescriptor
s.)owner
- the Window
to act as owner of the returned
Window
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
owner
- the Frame
to act as owner of the returned
Window
net.jini.lookup.ui.attribute
net.jini.lookup.ui.attribute
No interfaces are declared in package net.jini.lookup.ui.attribute
.
net.jini.lookup.ui.attribute
AccessibleUI
- 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.
Locales
- UI attribute that lists the locales supported
by a generated UI.
RequiredPackages
- UI attribute that enables clients to get a list of
the fully qualified names and version numbers of packages
required by a UI.
UIFactoryTypes
- UI attribute that lists UI factory interfaces of which a UI factory
is an instance.
Exception
s In Package net.jini.lookup.ui.attribute
No Exception
s are declared in package net.jini.lookup.ui.attribute
.
Error
s In Package net.jini.lookup.ui.attribute
No Error
s are declared in package net.jini.lookup.ui.attribute
.
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 UIDescriptor
s 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.
AccessibleUI()
public AccessibleUI()
Constructs a new AccessibleUI
attribute.
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.
o
- the object to compare againsthashCode()
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
.
net.jini.lookup.ui.attribute.AccessibleUI
Serialized form of class
net.jini.lookup.ui.attribute.AccessibleUI
has no serialized fields.
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.
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.
locales
- A Set
of Locale
objects. Each element must be non-null and an instance
of java.util.Locale
.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
.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
.
locale
- the locale to checkNullPointerException
- if locale
is null
.getFirstSupportedLocale(java.util.Locale[])
public java.util.Locale getFirstSupportedLocale(java.util.Locale[] locales)
Looks through the passed array of Locale
s
(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 Locale
s in
the passed array are supported by the UI.
locales
- an array of locales in order of most desired to
least desiredNullPointerException
- if locales
is null
.getFirstSupportedLocale(java.util.List)
public java.util.Locale getFirstSupportedLocale(java.util.List locales)
Iterates through the passed List
of Locale
s
and returns the first Locale
that is
supported by the UI (as defined by isLocaleSupported()
),
or null
, if none of the Locale
s in
the passed array are supported by the UI.
locales
- a List
of locales in order of most
desired to least desiredNullPointerException
- if locales
is null
.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()
.
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
.
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.
o
- the object to compare againsthashCode()
public int hashCode()
Returns the hash code value for this Locales
object.
net.jini.lookup.ui.attribute.Locales
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
.
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.
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 String
s
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
String
s 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.
packages
- a map of String
fully qualified
names of required packages to String
version
numbersNullPointerException
- 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
.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()
.
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.
NullPointerException
- if packageName
is null
.getRequiredPackages()
public java.util.Map getRequiredPackages()
Returns a java.util.Map
whose keys
are String
s 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
String
s 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.
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.
o
- the object to compare againsthashCode()
public int hashCode()
Returns the hash code value for this RequiredPackages
object.
net.jini.lookup.ui.attribute.RequiredPackages
requiredPackages
java.util.Map requiredPackages
A Map
of String
keys to
String
values. The keys contained
in the Map
must be String
s
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
String
s in the form of "specification version
numbers," as used by the java.lang.Package
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.
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
String
s. 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.
typeNames
- A Set
of String
objects. Each element must be non-null and an instance
of java.lang.String
.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
.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.
classObj
- the type to checkNullPointerException
- if classObj
is null
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()
.
getTypeNames()
public java.util.Set getTypeNames()
Returns an unmodifiable Set of fully qualified type name
String
s of which
a UI factory is an instance in no particular order.
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.
o
- the object to compare againsthashCode()
public int hashCode()
Returns the hash code value for this UIFactoryTypes
object.
net.jini.lookup.ui.attribute.UIFactoryTypes
typeNames
java.util.Set typeNames
A Set
of String
s,
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.
Sponsored Links
|