Package javax.help
Class FavoritesItem
- java.lang.Object
-
- javax.help.TreeItem
-
- javax.help.FavoritesItem
-
- All Implemented Interfaces:
java.awt.datatransfer.Transferable
,java.io.Serializable
public class FavoritesItem extends TreeItem implements java.awt.datatransfer.Transferable, java.io.Serializable
A class for individual favorites items.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.awt.datatransfer.DataFlavor
FAVORITES_FLAVOR
-
Fields inherited from class javax.help.TreeItem
COLLAPSE, DEFAULT_EXPANSION, EXPAND, locale
-
-
Constructor Summary
Constructors Constructor Description FavoritesItem()
Creates empty itemFavoritesItem(java.lang.String name)
Creates item with nameFavoritesItem(java.lang.String name, java.lang.String target, java.lang.String url, java.lang.String title, java.util.Locale locale)
Creates FavoritesItem.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(FavoritesItem item)
Adds FavoritesItem as a child.boolean
allowsChildren()
Returns wheter item allows children or notjava.lang.Object
clone()
boolean
emptyInitState()
Returns true if item was initialized as emptyjava.util.Vector
getChildren()
Returns children of this FavoritesItem.java.lang.String
getHelpSetTitle()
Returns the title of HelpSetFavoritesItem
getParent()
Returns parent of FavoritesItem.java.lang.String
getTarget()
Returns the id for this item.java.lang.Object
getTransferData(java.awt.datatransfer.DataFlavor df)
Returns an object which represents the data to be transferred.java.awt.datatransfer.DataFlavor[]
getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.java.net.URL
getURL()
Return the URL for this itemjava.lang.String
getURLSpec()
Returns the external representation of url for this item.boolean
isDataFlavorSupported(java.awt.datatransfer.DataFlavor df)
Returns whether or not the specified data flavor is supported for this object.boolean
isFolder()
Returns whether or not this item is folder.boolean
isLeaf()
Returns whether or not this item is leafboolean
isVisible()
void
remove(FavoritesItem item)
Removes FavoritesItem from vector of children.void
setAsFolder()
Sets this item as folder.void
setParent(FavoritesItem parent)
Sets the parent of this item.void
setVisible(boolean visible)
java.lang.String
toString()
Returns a String used when displaying the object.-
Methods inherited from class javax.help.TreeItem
getExpansionType, getHelpSet, getID, getLocale, getMergeType, getName, getPresentation, getPresentationName, setExpansionType, setHelpSet, setID, setMergeType, setName, setPresentation, setPresentationName
-
-
-
-
Constructor Detail
-
FavoritesItem
public FavoritesItem(java.lang.String name)
Creates item with name- Parameters:
name
- The name of item
-
FavoritesItem
public FavoritesItem()
Creates empty item
-
FavoritesItem
public FavoritesItem(java.lang.String name, java.lang.String target, java.lang.String url, java.lang.String title, java.util.Locale locale)
Creates FavoritesItem.- Parameters:
name
- The name of itemtarget
- The target of itemurl
- The external representation of urltitle
- The title of the HelpSetlocale
- The Locale of this item
-
-
Method Detail
-
setVisible
public void setVisible(boolean visible)
-
isVisible
public boolean isVisible()
-
getTarget
public java.lang.String getTarget()
Returns the id for this item.
-
getURLSpec
public java.lang.String getURLSpec()
Returns the external representation of url for this item.
-
getURL
public java.net.URL getURL()
Return the URL for this item
-
getHelpSetTitle
public java.lang.String getHelpSetTitle()
Returns the title of HelpSet
-
setAsFolder
public void setAsFolder()
Sets this item as folder.
-
allowsChildren
public boolean allowsChildren()
Returns wheter item allows children or not
-
isLeaf
public boolean isLeaf()
Returns whether or not this item is leaf
-
isFolder
public boolean isFolder()
Returns whether or not this item is folder.
-
add
public void add(FavoritesItem item)
Adds FavoritesItem as a child.- Parameters:
item
- The FavoritesItem.
-
emptyInitState
public boolean emptyInitState()
Returns true if item was initialized as empty
-
remove
public void remove(FavoritesItem item)
Removes FavoritesItem from vector of children.- Parameters:
item
- The FavoritesItem to remove.
-
getParent
public FavoritesItem getParent()
Returns parent of FavoritesItem.
-
setParent
public void setParent(FavoritesItem parent)
Sets the parent of this item.- Parameters:
parent
- The FavoritesItem.
-
getChildren
public java.util.Vector getChildren()
Returns children of this FavoritesItem.
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.lang.Object
-
toString
public java.lang.String toString()
Description copied from class:TreeItem
Returns a String used when displaying the object. Used by CellRenderers.
-
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
Returns an object which represents the data to be transferred.- Specified by:
getTransferData
in interfacejava.awt.datatransfer.Transferable
- Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
-
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.- Specified by:
getTransferDataFlavors
in interfacejava.awt.datatransfer.Transferable
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor df)
Returns whether or not the specified data flavor is supported for this object.- Specified by:
isDataFlavorSupported
in interfacejava.awt.datatransfer.Transferable
-
-