javax.help
Class JHelpNavigator
JComponent
javax.help.JHelpNavigator
- Accessible
public class JHelpNavigator
extends JComponent
implements Accessible
A JHelpNavigator is a control that presents navigational help data.
It is identified by a type and it interacts with a HelpModel.
There are three JHelpNavigators that most JavaHelp implementations should
support:
type
protected String type
JHelpNavigator
public JHelpNavigator(NavigatorView view)
Returns a JHelpNavigator with an instance of DefaultHelpModel as its
data model.
view
- The NavigatorView to use. If view is null it creates a JHelpTOCNavigator
with a null NavigatorView.
JHelpNavigator
public JHelpNavigator(NavigatorView view,
HelpModel model)
Constructs a JHelpNavigator from some view and with a preexisting model and in default initial state of navigation
entries.
view
- The NavigatorView. If view is null it creates a JHelpNavigator
with a null NavigatorView.model
- The model that generates changes.
If model is null it creates a JHelpNavigator without a model.
addHelpModelListener
public void addHelpModelListener(HelpModelListener l)
Adds a listener for the HelpModelEvent posted after the model has
changed.
l
- - The listener to add.
canMerge
public boolean canMerge(NavigatorView view)
Determines if this instance of a JHelpNavigator can merge its data with another one.
view
- The data to merge.
- Whether it can be merged.
merge(NavigatorView)
, remove(NavigatorView)
createParams
protected static Hashtable createParams(URL data)
Creates the parameters for a Navigator from data stored in a URL.
- A Hashtable of parameters
getAccessibleContext
public AccessibleContext getAccessibleContext()
Get the AccessibleContext associated with this JComponent.
- The AccessibleContext of this JComponent
getIcon
public Icon getIcon()
Gets an icon to identify this Navigator. Currently this is a read-only
property.
- An icon to identify this navigator.
getModel
public HelpModel getModel()
Returns the HelpModel that provides the data.
getNavigatorLabel
public String getNavigatorLabel()
Gets the name of this navigator view.
- The label for this NavigatorView.
getNavigatorLabel
public String getNavigatorLabel(Locale locale)
Gets locale-dependent name for this navigator view.
- the label for this NavigatorView. If locale is null it is
treated as the default Locale.
getNavigatorName
public String getNavigatorName()
Names this Navigator.
- The name of this Navigator. This is locale independent and can be
used by the application to identify the view.
getNavigatorView
public NavigatorView getNavigatorView()
Gets the NavigatorView that created this Navigator View.
getSelectedItems
public TreeItem[] getSelectedItems()
Returns a list of selected items
getUI
public HelpNavigatorUI getUI()
Returns the HelpUI that provides the current look and feel.
getUIClassID
public String getUIClassID()
merge
public void merge(NavigatorView view)
Merged a NavigatorView into this instance.
canMerge(NavigatorView)
, remove(NavigatorView)
remove
public void remove(NavigatorView view)
Removes a NavigatorView from this instance.
canMerge(NavigatorView)
, merge(NavigatorView)
removeHelpModelListener
public void removeHelpModelListener(HelpModelListener l)
Removes a listener previously added with addHelpModelListener.
l
- - The listener to remove.
setModel
public void setModel(HelpModel newModel)
Sets the HelpModel that provides the data.
newModel
- The HelpModel for this component. A null for newModel
is valid.
setSelectedItems
public void setSelectedItems(TreeItem[] selectedItems)
Sets the list of selected items
setUI
public void setUI(HelpNavigatorUI ui)
Sets the HelpUI that provides the current look and feel.
updateUI
public void updateUI()
Replaces the UI with the latest version from the default
UIFactory.