Package com.sun.java.help.impl
Class JHelpPrintHandler
java.lang.Object
com.sun.java.help.impl.JHelpPrintHandler
- All Implemented Interfaces:
ActionListener
,EventListener
- Direct Known Subclasses:
JHelpPrintHandler1_2
Print handler for JavaHelp. Because JDK1.1 is not supported since JavaHelp
version 2.0 this class contains all printing code.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SwingPropertyChangeSupport
If anyPropertyChangeListeners
have been registered, thechangeSupport
field describes them.static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
ActionListener to perform printing.void
Adds aPropertyChangeListener
to the listener list.protected void
firePropertyChange
(String propertyName, Object oldValue, Object newValue) Supports reporting bound property changes.Getter for property model.static JHelpPrintHandler
getJHelpPrintHandler
(JHelp help) Getter for property pageFormat.getPF()
Deprecated.protected static Rectangle
getViewRec
(View rootview, float width, float height) Setups size of editor and return its optimal width.void
handlePageSetup
(Component psComp) Sets the PrintHandler to handle pageSetup as a separate action from printing.boolean
Returns true if the action is enabled.void
void
void
protected static void
void
Removes aPropertyChangeListener
from the listener list.void
setEnabled
(boolean newValue) Enables or disables the action.void
setHelpModel
(HelpModel helpModel) void
setPageFormat
(PageFormat pageFormat) Setter for property pageFormat.void
setPF
(PageFormat pf) Deprecated.As of JDK version 2.0, replaced bysetPageFormat(pageFormat)
.
-
Field Details
-
PRINT_BUTTON_NAME
- See Also:
-
PAGE_SETUP_BUTTON_NAME
- See Also:
-
PRINT_LATER_BUTTON_NAME
- See Also:
-
changeSupport
If anyPropertyChangeListeners
have been registered, thechangeSupport
field describes them.
-
-
Constructor Details
-
JHelpPrintHandler
-
-
Method Details
-
getJHelpPrintHandler
-
firePropertyChange
Supports reporting bound property changes. This method can be called when a bound property has changed and it will send the appropriatePropertyChangeEvent
to any registeredPropertyChangeListeners
. -
addPropertyChangeListener
Adds aPropertyChangeListener
to the listener list. The listener is registered for all properties.A
PropertyChangeEvent
will get fired in response to setting a bound property, e.g.setFont
,setBackground
, orsetForeground
. Note that if the current component is inheriting its foreground, background, or font from its container, then no event will be fired in response to a change in the inherited property.- Parameters:
listener
- ThePropertyChangeListener
to be added- See Also:
-
removePropertyChangeListener
Removes aPropertyChangeListener
from the listener list. This removes aPropertyChangeListener
that was registered for all properties.- Parameters:
listener
- thePropertyChangeListener
to be removed- See Also:
-
isEnabled
public boolean isEnabled()Returns true if the action is enabled.- Returns:
- true if the action is enabled, false otherwise
- See Also:
-
setEnabled
public void setEnabled(boolean newValue) Enables or disables the action.- Parameters:
newValue
- true to enable the action, false to disable it- See Also:
-
actionPerformed
ActionListener to perform printing. The current implementation of Swing requires that this go through an ActionListener as it must be in the EventDispatchThread.- Specified by:
actionPerformed
in interfaceActionListener
-
printSetup
public void printSetup() -
print
-
print
-
getPageFormat
Getter for property pageFormat.- Returns:
- Value of property pageFormat.
-
getPF
Deprecated.As of JavaHelp version 2.0, replaced bygetPageFormat()
. -
setPageFormat
Setter for property pageFormat.- Parameters:
pageFormat
- New value of property pageFormat.
-
setPF
Deprecated.As of JDK version 2.0, replaced bysetPageFormat(pageFormat)
. -
getPrinterJob
-
handlePageSetup
Sets the PrintHandler to handle pageSetup as a separate action from printing. PageSetup is only in 1.2 but we put in the 1.1 code to make it easier. On 1.1 this will essential do nothing. On 1.2 this sets up the button so we know if we're printing or just doing a page setup. -
setHelpModel
-
getHelpModel
Getter for property model.- Returns:
- Value of property model.
-
getViewRec
Setups size of editor and return its optimal width. -
processException
-
getPageFormat()
.