|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.semoa.ui.HostSelection
A Transferable
which implements the capability required
to transfer a host address. This Transferable
supports:
DN_FLAVOR
URLSelection.URL_FLAVOR
DataFlavor.stringFlavor
DropZone.DROPZONE_FLAVOR
DN_FLAVOR
,
URLSelection.URL_FLAVOR
,
DataFlavor.stringFlavor
,
DropZone.DROPZONE_FLAVOR
,
HostTransferHandler
Field Summary | |
private Name |
dn_
the distinguished name to transfer |
static DataFlavor |
DN_FLAVOR
The DataFlavor representing a distinguished name using a
Name class. |
private URL |
url_
the URL to transfer |
Constructor Summary | |
HostSelection(URL url,
Name dn)
Creates a Transferable capable of transferring a host
with the specified url and the specified distinguished
name dn . |
Method Summary | |
Object |
getTransferData(DataFlavor flavor)
Returns the Transferable 's data in the requested
DataFlavor if possible. |
DataFlavor[] |
getTransferDataFlavors()
Returns an array of flavors in which this Transferable can
provide the data. |
boolean |
isDataFlavorSupported(DataFlavor flavor)
Returns whether the requested flavor is supported by this Transferable . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final DataFlavor DN_FLAVOR
DataFlavor
representing a distinguished name using a
Name
class.
private Name dn_
private URL url_
URL
to transfer
Constructor Detail |
public HostSelection(URL url, Name dn)
Transferable
capable of transferring a host
with the specified url
and the specified distinguished
name dn
. Either url
or dn
may be
specified as null
but not both arguments.
url
- the URL
to transferdn
- the distinguished name to transfer
IllegalArgumentException
- if both url
and
dn
are equal to null
Method Detail |
public DataFlavor[] getTransferDataFlavors()
Transferable
can
provide the data. DataFlavor.stringFlavor
and
DropZone.DROPZONE_FLAVOR
are supported by all
HostSelection
objects. Those constructed with a non
null
url also support URLSelection.URL_FLAVOR
and those constructed with a non null
distinguished name
also support DN_FLAVOR
.
getTransferDataFlavors
in interface Transferable
public boolean isDataFlavorSupported(DataFlavor flavor)
Transferable
.
isDataFlavorSupported
in interface Transferable
flavor
- the requested flavor for the data
true
if flavor is supported by this
Transferable
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
Transferable
's data in the requested
DataFlavor
if possible. If the desired flavor is
DN_FLAVOR
a String
representation of the
hosts distinguished name is returned. If the desired flavor is
URLSelection.URL_FLAVOR
a URL
object
representing the host address is returned. If the desired flavor is
DataFlavor.stringFlavor
and this HostSelection
has been constructed with a non null
url, the
String
representing the host URL is returned. If the
desired flavor is DataFlavor.stringFlavor
and this
HostSelection
has been constructed with a null
url and a non null
dn, the String
representing the host distinguished name is returned. If the desired
flavor is DropZone.DROPZONE_FLAVOR
and this
HostSelection
has been constructed with a non
null
url an InputStream
is returned, that
should be used in conjunction with an ObjectInputStream
to read an URL
object. If the desired flavor is
DropZone.DROPZONE_FLAVOR
and this
HostSelection
has been constructed with a null
url and a non null
distinguished name an
InputStream
is returned, that should be used in conjunction
with an ObjectInputStream
to read a String
object.
getTransferData
in interface Transferable
flavor
- the requested flavor for the data
UnsupportedFlavorException
- if the requested data flavor is not
supported by this HostSelection
IOException
- if an IOException occurs while retrieving the data
NullPointerException
- if flavor
is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |