javax.help

Class FavoritesItem

Implemented Interfaces:
Serializable, Transferable

public class FavoritesItem
extends TreeItem
implements Transferable, Serializable

A class for individual favorites items.

Field Summary

static DataFlavor
FAVORITES_FLAVOR

Fields inherited from class javax.help.TreeItem

COLLAPSE, DEFAULT_EXPANSION, EXPAND, locale

Constructor Summary

FavoritesItem()
Creates empty item
FavoritesItem(String name)
Creates item with name
FavoritesItem(String name, String target, String url, String title, Locale locale)
Creates FavoritesItem.

Method Summary

void
add(FavoritesItem item)
Adds FavoritesItem as a child.
boolean
allowsChildren()
Returns wheter item allows children or not
Object
clone()
boolean
emptyInitState()
Returns true if item was initialized as empty
Vector
getChildren()
Returns children of this FavoritesItem.
String
getHelpSetTitle()
Returns the title of HelpSet
FavoritesItem
getParent()
Returns parent of FavoritesItem.
String
getTarget()
Returns the id for this item.
Object
getTransferData(DataFlavor df)
Returns an object which represents the data to be transferred.
DataFlavor[]
getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
URL
getURL()
Return the URL for this item
String
getURLSpec()
Returns the external representation of url for this item.
boolean
isDataFlavorSupported(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 leaf
boolean
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)
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, getURL, setExpansionType, setHelpSet, setID, setMergeType, setName, setPresentation, setPresentationName, toString

Field Details

FAVORITES_FLAVOR

public static final DataFlavor FAVORITES_FLAVOR

Constructor Details

FavoritesItem

public FavoritesItem()
Creates empty item

FavoritesItem

public FavoritesItem(String name)
Creates item with name
Parameters:
name - The name of item

FavoritesItem

public FavoritesItem(String name,
                     String target,
                     String url,
                     String title,
                     Locale locale)
Creates FavoritesItem.
Parameters:
name - The name of item
target - The target of item
url - The external representation of url
title - The title of the HelpSet
locale - The Locale of this item

Method Details

add

public void add(FavoritesItem item)
Adds FavoritesItem as a child.
Parameters:
item - The FavoritesItem.

allowsChildren

public boolean allowsChildren()
Returns wheter item allows children or not

clone

public Object clone()

emptyInitState

public boolean emptyInitState()
Returns true if item was initialized as empty

getChildren

public Vector getChildren()
Returns children of this FavoritesItem.

getHelpSetTitle

public String getHelpSetTitle()
Returns the title of HelpSet

getParent

public FavoritesItem getParent()
Returns parent of FavoritesItem.

getTarget

public String getTarget()
Returns the id for this item.

getTransferData

public Object getTransferData(DataFlavor df)
            throws UnsupportedFlavorException,
                   IOException
Returns an object which represents the data to be transferred.

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.

getURL

public URL getURL()
Return the URL for this item
Overrides:
getURL in interface TreeItem

getURLSpec

public String getURLSpec()
Returns the external representation of url for this item.

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor df)
Returns whether or not the specified data flavor is supported for this object.

isFolder

public boolean isFolder()
Returns whether or not this item is folder.

isLeaf

public boolean isLeaf()
Returns whether or not this item is leaf

isVisible

public boolean isVisible()

remove

public void remove(FavoritesItem item)
Removes FavoritesItem from vector of children.
Parameters:
item - The FavoritesItem to remove.

setAsFolder

public void setAsFolder()
Sets this item as folder.

setParent

public void setParent(FavoritesItem parent)
Sets the parent of this item.
Parameters:
parent - The FavoritesItem.

setVisible

public void setVisible(boolean visible)

toString

public String toString()
Returns a String used when displaying the object. Used by CellRenderers.
Overrides:
toString in interface TreeItem
See Also:
TOCCellRenderer