javax.help

Class WindowPresentation

Known Direct Subclasses:
MainWindow, SecondaryWindow

public abstract class WindowPresentation
extends Presentation

Window Presentation is an abstract class providing a generic interface for the development of Window Presentations. Each implementation of Presentation will need to override the static method getPresentation according to it's own needs. WindowPresentation implements several generic methods required in all window presentations. Includes the ability to handle modal and non-modal activation of the help window.
Since:
2.0
See Also:
HelpSet, JHelpNavigator, javax.help.HelpVisitListener

Constructor Summary

WindowPresentation(HelpSet hs)

Method Summary

void
createHelpWindow()
void
destroy()
Destroy this object.
Window
getActivationWindow()
Get the activation window.
String
getCurrentView()
Determines the current navigator.
Font
getFont()
Gets the font for this WindowPresentation
HelpSet.Presentation
getHelpSetPresentation()
Return the HelpSet.Presentation if one was set
Window
getHelpWindow()
Get the current window that help is displayed in
Point
getLocation()
Requests the location of the presentation.
int
getScreen()
Requests the screen of the presentation
Dimension
getSize()
Requests the size of the presentation.
String
getTitle()
boolean
isDestroyedOnExit()
Determines if the presentation should be distroyed on exit
boolean
isDisplayed()
Determines if the presentation is displayed.
boolean
isTitleSetFromDocument()
Is the title set from the Document.
boolean
isToolbarDisplayed()
Determines if the toolbar is visible.
boolean
isViewDisplayed()
Determines if the current view is visible.
void
setActivationObject(Object comp)
Set the activation window from given Component or MenuItem.
void
setActivationWindow(Window window)
Set the activation window.
void
setCurrentView(String name)
Set the currentView to the navigator with the same name as the name parameter.
void
setDestroyOnExit(boolean destroy)
Destory the window on exit
void
setDisplayed(boolean b)
Displays the presentation to the user.
void
setFont(Font f)
Sets the font for this this WindowPresentation.
void
setHelpSet(HelpSet hs)
Changes the HelpSet for this presentation.
void
setHelpSetPresentation(HelpSet.Presentation hsPres)
Set the Presentation attributes specific to WindowPresentations from a named presentation in a HelpSet.
void
setLocale(Locale l)
Sets the locale of this Presentation.
void
setLocation(Point p)
Requests the presentation be located at a given position.
void
setScreen(int screen)
Sets the screen of the presentation
void
setSize(Dimension d)
Requests the presentation be set to a given size.
void
setTitle(String title)
void
setTitleFromDocument(boolean b)
Set the title from the Document.
void
setToolbarDisplayed(boolean displayed)
Hides/Shows Toolbar
void
setViewDisplayed(boolean displayed)
Hides/Shows view.

Methods inherited from class javax.help.Presentation

getCurrentID, getCurrentURL, getFont, getHelpModel, getHelpSet, getLocale, getPresentation, getSize, isDisplayed, setCurrentID, setCurrentID, setCurrentURL, setDisplayed, setFont, setHelpSet, setHelpSetPresentation, setLocale, setSize

Constructor Details

WindowPresentation

public WindowPresentation(HelpSet hs)

Method Details

createHelpWindow

public void createHelpWindow()

destroy

public void destroy()
Destroy this object. Implementation of WindowPresentation that maintian a list of objects should override this method and call super.destroy to clear up the WindowPresentation internal fields.

getActivationWindow

public Window getActivationWindow()
Get the activation window.

getCurrentView

public String getCurrentView()
Determines the current navigator.

getFont

public Font getFont()
Gets the font for this WindowPresentation
Overrides:
getFont in interface Presentation

getHelpSetPresentation

public HelpSet.Presentation getHelpSetPresentation()
Return the HelpSet.Presentation if one was set

getHelpWindow

public Window getHelpWindow()
Get the current window that help is displayed in

getLocation

public Point getLocation()
Requests the location of the presentation.

getScreen

public int getScreen()
Requests the screen of the presentation

getSize

public Dimension getSize()
Requests the size of the presentation.
Overrides:
getSize in interface Presentation

getTitle

public String getTitle()

isDestroyedOnExit

public boolean isDestroyedOnExit()
Determines if the presentation should be distroyed on exit

isDisplayed

public boolean isDisplayed()
Determines if the presentation is displayed.
Overrides:
isDisplayed in interface Presentation

isTitleSetFromDocument

public boolean isTitleSetFromDocument()
Is the title set from the Document. This is generally useful in SecondaryWindows.
Returns:
boolean True if title is set from the Document, false otherwise.

isToolbarDisplayed

public boolean isToolbarDisplayed()
Determines if the toolbar is visible.

isViewDisplayed

public boolean isViewDisplayed()
Determines if the current view is visible.

setActivationObject

public void setActivationObject(Object comp)
Set the activation window from given Component or MenuItem. It find Window component in the component tree from given Component or MenuItem end call
setActivationWindow
.
Since:
2.0
See Also:
setActivationWindow

setActivationWindow

public void setActivationWindow(Window window)
Set the activation window. If the window is an instance of a Dialog and the is modal, modallyActivated help is set to true and ownerDialog is set to the window. In all other instances modallyActivated is set to false and ownerDialog is set to null.
Parameters:
window - the activating window

setCurrentView

public void setCurrentView(String name)
Set the currentView to the navigator with the same name as the name parameter.
Parameters:
name - The name of the navigator to set as the current view. If nav is null or not a valid Navigator in this WindowPresentation then an IllegalArgumentException is thrown.

setDestroyOnExit

public void setDestroyOnExit(boolean destroy)
Destory the window on exit

setDisplayed

public void setDisplayed(boolean b)
Displays the presentation to the user.
Overrides:
setDisplayed in interface Presentation

setFont

public void setFont(Font f)
Sets the font for this this WindowPresentation.
Overrides:
setFont in interface Presentation
Parameters:
f - The font.

setHelpSet

public void setHelpSet(HelpSet hs)
Changes the HelpSet for this presentation.
Overrides:
setHelpSet in interface Presentation
Parameters:
hs - The HelpSet to set for this presentation. A null hs is valid parameter.

setHelpSetPresentation

public void setHelpSetPresentation(HelpSet.Presentation hsPres)
Set the Presentation attributes specific to WindowPresentations from a named presentation in a HelpSet.
Overrides:
setHelpSetPresentation in interface Presentation

setLocale

public void setLocale(Locale l)
Sets the locale of this Presentation. The locale is propagated to the presentation.
Overrides:
setLocale in interface Presentation
Parameters:
l - The locale to become this component's locale. A null locale is the same as the defaultLocale.
See Also:
WindowPresentation

setLocation

public void setLocation(Point p)
Requests the presentation be located at a given position.

setScreen

public void setScreen(int screen)
Sets the screen of the presentation
Parameters:
screen - the screen number

setSize

public void setSize(Dimension d)
Requests the presentation be set to a given size. Updates the the presentation on the fly. This is an override of Presentation.SetSize.
Overrides:
setSize in interface Presentation

setTitle

public void setTitle(String title)

setTitleFromDocument

public void setTitleFromDocument(boolean b)
Set the title from the Document.
Parameters:
b - if true will set the title form the document, otherwise will set the title from the HelpSet.

setToolbarDisplayed

public void setToolbarDisplayed(boolean displayed)
Hides/Shows Toolbar

setViewDisplayed

public void setViewDisplayed(boolean displayed)
Hides/Shows view.