com.jniwrapper.win32.jexcel.ui
Class JWorkbook

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.jniwrapper.win32.jexcel.ui.JWorkbook
All Implemented Interfaces:
GenericWorkbook, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JWorkbook
extends javax.swing.JComponent
implements GenericWorkbook

This class provides functionality for embedding Excel workbook into a Java Swing application as an ordinary Swing component.

See Also:
Serialized Form

Nested Class Summary
static class JWorkbook.WorkbookContainer
           
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JWorkbook()
          Creates an instance of JWorkbook component.
JWorkbook(boolean staticView)
          Creates an instance of JWorkbook component.
JWorkbook(java.io.File workbook)
          Creates an instance of JWorkbook component and displays the specified Excel workbook.
JWorkbook(java.io.File workbook, boolean staticView)
          Creates an instance of JWorkbook component and displays the specified Excel workbook.
 
Method Summary
 void activate()
          Activates an embedded workbook.
 void addJWorkbookEventListener(JWorkbookEventListener eventListener)
          Add a listener of the embedded workbook events.
 void addPrintPreviewListener(PrintPreviewListener l)
           
 void addWorkbookEventListener(WorkbookEventListener eventListener)
          Adds the listener of workbook events.
 Worksheet addWorksheet(java.lang.String name)
          Adds a worksheet to the workbook.
 Worksheet addWorksheet(Worksheet after, java.lang.String name)
          Adds a worksheet to the workbook.
 void close()
          Closes an embedded workbook.
 void copyWorksheet(Worksheet worksheet, Worksheet before, Worksheet after)
          Copies the worksheet to the position after the specified worksheet.
 void deactivate()
          Deactivates an embedded workbook ui.
 Worksheet getActiveWorksheet()
          Returns the active worksheet.
 Application getApplication()
          Returns the parent application.
 java.lang.String getAuthor()
          Returns the workbook author name.
 JWorkbook.WorkbookContainer getContainer()
          Return office container of this workbook.
 java.io.File getFile()
          If an embedded workbook has been loaded from a file or a new workbook has been saved, then the function returns the workbook file, otherwise it returns null.
 FileFormat getFileFormat()
          Returns the format of the workbook file.
 com.jniwrapper.win32.automation.OleMessageLoop getOleMessageLoop()
          Returns ole message loop of workbook.
 java.lang.String getTitle()
          Returns workbook title.
 Window getWindow()
          Returns the windows that corresponds to the workbook.
 Workbook getWorkbook()
          Returns an Excel workbook that is currently opened.
 java.lang.String getWorkbookName()
          Returns workbook name.
 Worksheet getWorksheet(int index)
          Returns the worksheet that is specified by its index.
 Worksheet getWorksheet(java.lang.String name)
          Returns the worksheet that is specified by its name.
 int getWorksheetCount()
          Returns number of worksheets in the workbook.
 java.util.List getWorksheets()
          Returns the list of worksheets of the workbook.
 boolean hasPassword()
          Returns "is workbook password protected" status
 boolean isActive()
          Returns "is workbook active" status
 boolean isClosed()
          Returns "is workbook closed" status.
 boolean isPrintPreview()
          Returns true if the component is in the preview mode.
 boolean isReadOnly()
          Returns "is workbook readonly" status.
 boolean isSaved()
          Returns "is workbook saved" status
 boolean isStaticMode()
          Returns true if the workbook is displayed in a static mode and false otherwise.
 boolean isWorkbookCreated()
          Returns status of embedded Excel workbook.
 void moveWorksheet(Worksheet worksheet, Worksheet after)
          Moves the worksheet to the position after the specified worksheet.
 void newWorkbook()
          Creates a new workbook in the container.
 void notifyPrintPreviewStateChanged()
           
 void onPrintPreview()
           
 void onPrintPreviewExit()
           
 void openWorkbook(java.io.File workbookFile)
          Opens the specified Excel workbookFile in the container.
 void print(int copies)
          Prints the specified number of copies of the workbook.
 void print(int firstSheet, int lastSheet, int copies)
          Prints the specified range of worksheet.
 void removeEventHandler()
          Removes the handler of workbook events.
 void removeJWorkbookEventListener(JWorkbookEventListener eventListener)
          Removes the specified event listener.
 void removePrintPreviewListener(PrintPreviewListener l)
           
 void removeWorkbookEventListener(WorkbookEventListener eventListener)
          Removes the specified listener of workbook events.
 void removeWorksheet(Worksheet worksheet)
          Removes the worksheet from the workbook.
 void save()
           
 void saveAs(java.io.File file, FileFormat fileFormat, boolean overwrite)
           
 void saveCopyAs(java.io.File file)
          Saves a copy of the workbook to another file.
 void setAuthor(java.lang.String author)
          Specifies the workbook author name.
protected  void setContainer(JWorkbook.WorkbookContainer container)
           
 void setEventHandler(WorkbookEventHandler eventHandler)
          Specifies the handler of workbook events.
 void setPassword(java.lang.String password)
          Allows setting workbook password.
 void setPrintPreview(boolean value)
          Switches the workbook to the print preview mode and back.
 void setStaticMode(boolean value)
          Changes the embedded workbook displaying mode.
 void setTitle(java.lang.String title)
          Sets up the title of the workbook.
 void setWritePassword(java.lang.String password)
          Allows setting write protection password.
 void showPrintDialog()
          Displays print dialog.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JWorkbook

public JWorkbook()
          throws ExcelException
Creates an instance of JWorkbook component.

Throws:
ExcelException - if Excel cannot be run.

JWorkbook

public JWorkbook(boolean staticView)
          throws ExcelException
Creates an instance of JWorkbook component.

Parameters:
staticView - specifies whether the embedded workbook has active UI or not. If true the workbook will be displayed in the static (not active) mode.
Throws:
ExcelException - if Excel cannot be run.
See Also:
setStaticMode(boolean)

JWorkbook

public JWorkbook(java.io.File workbook)
          throws java.io.FileNotFoundException,
                 ExcelException
Creates an instance of JWorkbook component and displays the specified Excel workbook.

Parameters:
workbook - is an Excel workbook file.
Throws:
ExcelException - if Excel cannot be run.
java.io.FileNotFoundException - if the specified file was not found.

JWorkbook

public JWorkbook(java.io.File workbook,
                 boolean staticView)
          throws java.io.FileNotFoundException,
                 ExcelException
Creates an instance of JWorkbook component and displays the specified Excel workbook.

Parameters:
workbook - is an Excel workbook file.
staticView - specifies whether the embedded workbook has active UI or not. If true the workbook will be displayed in the static (not active) mode.
Throws:
ExcelException - if Excel cannot be run.
java.io.FileNotFoundException - if the specified file was not found.
Method Detail

getOleMessageLoop

public com.jniwrapper.win32.automation.OleMessageLoop getOleMessageLoop()
Returns ole message loop of workbook.

Returns:
ole message loop

getContainer

public JWorkbook.WorkbookContainer getContainer()
Return office container of this workbook.

Returns:
office container

getWorkbook

public Workbook getWorkbook()
Returns an Excel workbook that is currently opened. If the container content changed, previously received instances become not valid.

Returns:
an Excel workbook that is currently opened.
See Also:
Workbook

activate

public void activate()
Activates an embedded workbook.

Specified by:
activate in interface GenericWorkbook

deactivate

public void deactivate()
Deactivates an embedded workbook ui.


getWindow

public Window getWindow()
Description copied from interface: GenericWorkbook
Returns the windows that corresponds to the workbook.

Specified by:
getWindow in interface GenericWorkbook
Returns:
the windows that corresponds to the workbook.
See Also:
Window

getAuthor

public java.lang.String getAuthor()
Description copied from interface: GenericWorkbook
Returns the workbook author name.

Specified by:
getAuthor in interface GenericWorkbook
Returns:
the workbook author name.

setAuthor

public void setAuthor(java.lang.String author)
Description copied from interface: GenericWorkbook
Specifies the workbook author name.

Specified by:
setAuthor in interface GenericWorkbook
Parameters:
author - is the workbook author name.

removeWorksheet

public void removeWorksheet(Worksheet worksheet)
Description copied from interface: GenericWorkbook
Removes the worksheet from the workbook.

Specified by:
removeWorksheet in interface GenericWorkbook
Parameters:
worksheet - specifies the worksheet to be removed.

moveWorksheet

public void moveWorksheet(Worksheet worksheet,
                          Worksheet after)
Description copied from interface: GenericWorkbook
Moves the worksheet to the position after the specified worksheet.

Specified by:
moveWorksheet in interface GenericWorkbook
Parameters:
worksheet - specifies the worksheet to be moved.
after - the worksheet will be moved to the position after this worksheet. If the value is null, the worksheet will be moved to the beginning of the worksheet list.

copyWorksheet

public void copyWorksheet(Worksheet worksheet,
                          Worksheet before,
                          Worksheet after)
Description copied from interface: GenericWorkbook
Copies the worksheet to the position after the specified worksheet.

Specified by:
copyWorksheet in interface GenericWorkbook
Parameters:
worksheet - specifies the worksheet to be moved.
before - the worksheet will be moved to the position before this worksheet. If the value is null, after parameter should be specified.
after - the worksheet will be moved to the position after this worksheet. If the value is null, before parameter should be specified.

getApplication

public Application getApplication()
Description copied from interface: GenericWorkbook
Returns the parent application.

Specified by:
getApplication in interface GenericWorkbook
Returns:
the parent application.

save

public void save()
          throws java.io.IOException
Throws:
java.io.IOException

saveAs

public void saveAs(java.io.File file,
                   FileFormat fileFormat,
                   boolean overwrite)
            throws java.io.IOException
Throws:
java.io.IOException

saveCopyAs

public void saveCopyAs(java.io.File file)
                throws java.io.IOException
Description copied from interface: GenericWorkbook
Saves a copy of the workbook to another file.

Specified by:
saveCopyAs in interface GenericWorkbook
Parameters:
file - specifies the file name.
Throws:
java.io.IOException - if the workbook cannot be saved to the specified file.

close

public void close()
Closes an embedded workbook.

Throws:
java.lang.IllegalStateException - if the component is in the preview mode.

openWorkbook

public void openWorkbook(java.io.File workbookFile)
                  throws java.io.FileNotFoundException
Opens the specified Excel workbookFile in the container.

Parameters:
workbookFile - is an Excel workbook file to be opened.
Throws:
java.lang.IllegalArgumentException - if the target file is not an Excel workbookFile.
java.io.FileNotFoundException - if the target file doesn't exist.
java.lang.IllegalStateException - if the component is in the preview mode.

newWorkbook

public void newWorkbook()
Creates a new workbook in the container.

Throws:
java.lang.IllegalStateException - if the component is in the preview mode.

setPrintPreview

public void setPrintPreview(boolean value)
Switches the workbook to the print preview mode and back.

Parameters:
value - if true the workbook will be switched to the print preview mode.

isPrintPreview

public boolean isPrintPreview()
Returns true if the component is in the preview mode.

Returns:
true if the component is in the preview mode.

showPrintDialog

public void showPrintDialog()
Displays print dialog.

Throws:
java.lang.IllegalStateException - if the component is in the preview mode.

addWorksheet

public Worksheet addWorksheet(java.lang.String name)
                       throws ExcelException
Description copied from interface: GenericWorkbook
Adds a worksheet to the workbook.

Specified by:
addWorksheet in interface GenericWorkbook
Parameters:
name - is the name of a new worksheet.
Returns:
the newly added worksheet.
Throws:
ExcelException - if a worksheet with such name already exists in the workbook.

addWorksheet

public Worksheet addWorksheet(Worksheet after,
                              java.lang.String name)
                       throws ExcelException
Description copied from interface: GenericWorkbook
Adds a worksheet to the workbook. The worksheet will be added to the position after the specified worksheet.

Specified by:
addWorksheet in interface GenericWorkbook
Parameters:
after - the worksheet will be added to the position after this worksheet. If the value is null, the worksheet will be added at the beginning of the worksheet list.
name - is the name of a new worksheet.
Returns:
a newly added worksheet.
Throws:
ExcelException - if a worksheet with such name already exists in the workbook.

getWorksheet

public Worksheet getWorksheet(java.lang.String name)
Description copied from interface: GenericWorkbook
Returns the worksheet that is specified by its name. If the specified worksheet was not found, the return value is null.

Specified by:
getWorksheet in interface GenericWorkbook
Parameters:
name - is the name of the worksheet.
Returns:
the worksheet of interest or null if such worksheet is not present.

getWorksheets

public java.util.List getWorksheets()
Description copied from interface: GenericWorkbook
Returns the list of worksheets of the workbook. Each element of the list is an instance of Worksheet class.

Specified by:
getWorksheets in interface GenericWorkbook
Returns:
the list of worksheets.

getWorksheet

public Worksheet getWorksheet(int index)
Description copied from interface: GenericWorkbook
Returns the worksheet that is specified by its index.

Specified by:
getWorksheet in interface GenericWorkbook
Parameters:
index - is the index of the worksheet.
Returns:
the worksheet of interest.

getActiveWorksheet

public Worksheet getActiveWorksheet()
Description copied from interface: GenericWorkbook
Returns the active worksheet.

Specified by:
getActiveWorksheet in interface GenericWorkbook
Returns:
the active worksheet.

setEventHandler

public void setEventHandler(WorkbookEventHandler eventHandler)
Description copied from interface: GenericWorkbook
Specifies the handler of workbook events.

Specified by:
setEventHandler in interface GenericWorkbook

removeEventHandler

public void removeEventHandler()
Description copied from interface: GenericWorkbook
Removes the handler of workbook events.

Specified by:
removeEventHandler in interface GenericWorkbook

addWorkbookEventListener

public void addWorkbookEventListener(WorkbookEventListener eventListener)
Description copied from interface: GenericWorkbook
Adds the listener of workbook events.

Specified by:
addWorkbookEventListener in interface GenericWorkbook

removeWorkbookEventListener

public void removeWorkbookEventListener(WorkbookEventListener eventListener)
Description copied from interface: GenericWorkbook
Removes the specified listener of workbook events.

Specified by:
removeWorkbookEventListener in interface GenericWorkbook
Parameters:
eventListener - is the listener to be removed.

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: GenericWorkbook
Sets up the title of the workbook.

Specified by:
setTitle in interface GenericWorkbook
Parameters:
title - is a new title of the workbook.

getTitle

public java.lang.String getTitle()
Returns workbook title.

Specified by:
getTitle in interface GenericWorkbook
Returns:
workbook title

getFile

public java.io.File getFile()
If an embedded workbook has been loaded from a file or a new workbook has been saved, then the function returns the workbook file, otherwise it returns null.

Specified by:
getFile in interface GenericWorkbook
Returns:
the workbook file.

getFileFormat

public FileFormat getFileFormat()
Description copied from interface: GenericWorkbook
Returns the format of the workbook file.

Specified by:
getFileFormat in interface GenericWorkbook
Returns:
the format of the workbook file.

print

public void print(int copies)
           throws javax.print.PrintException
Description copied from interface: GenericWorkbook
Prints the specified number of copies of the workbook.

Specified by:
print in interface GenericWorkbook
Parameters:
copies - is the number of copies to be printed.
Throws:
javax.print.PrintException - if print problems occured.

print

public void print(int firstSheet,
                  int lastSheet,
                  int copies)
           throws javax.print.PrintException
Description copied from interface: GenericWorkbook
Prints the specified range of worksheet.

Specified by:
print in interface GenericWorkbook
Parameters:
firstSheet - is the index of the first worksheet to be printed.
lastSheet - is the index of the last worksheet to be printed.
copies - is the number of copies to be printed.
Throws:
javax.print.PrintException - if print problems occured.

getWorksheetCount

public int getWorksheetCount()
Returns number of worksheets in the workbook.

Specified by:
getWorksheetCount in interface GenericWorkbook
Returns:
number of worksheets

setPassword

public void setPassword(java.lang.String password)
Allows setting workbook password.

Specified by:
setPassword in interface GenericWorkbook
Parameters:
password - string

hasPassword

public boolean hasPassword()
Returns "is workbook password protected" status

Specified by:
hasPassword in interface GenericWorkbook
Returns:
hasPassword status

setWritePassword

public void setWritePassword(java.lang.String password)
Allows setting write protection password.

Specified by:
setWritePassword in interface GenericWorkbook
Parameters:
password - is a new write protection password

getWorkbookName

public java.lang.String getWorkbookName()
Returns workbook name.

Specified by:
getWorkbookName in interface GenericWorkbook
Returns:
workbook name

isReadOnly

public boolean isReadOnly()
Returns "is workbook readonly" status.

Specified by:
isReadOnly in interface GenericWorkbook
Returns:
isReadonly status

isSaved

public boolean isSaved()
Returns "is workbook saved" status

Specified by:
isSaved in interface GenericWorkbook
Returns:
isSaved status

isClosed

public boolean isClosed()
Returns "is workbook closed" status.

Specified by:
isClosed in interface GenericWorkbook
Returns:
isClosed status

isActive

public boolean isActive()
Returns "is workbook active" status

Returns:
isActive status

addJWorkbookEventListener

public void addJWorkbookEventListener(JWorkbookEventListener eventListener)
Add a listener of the embedded workbook events.

Parameters:
eventListener - for this JWorkbook
See Also:
JWorkbookEventListener, JWorkbookEventAdapter

removeJWorkbookEventListener

public void removeJWorkbookEventListener(JWorkbookEventListener eventListener)
Removes the specified event listener.

Parameters:
eventListener - for this JWorkbook
See Also:
JWorkbookEventListener, JWorkbookEventAdapter

addPrintPreviewListener

public void addPrintPreviewListener(PrintPreviewListener l)

removePrintPreviewListener

public void removePrintPreviewListener(PrintPreviewListener l)

setStaticMode

public void setStaticMode(boolean value)
Changes the embedded workbook displaying mode.

Parameters:
value - if true the workbook is displayed in a static mode, otherwise in a UI active mode.

isStaticMode

public boolean isStaticMode()
Returns true if the workbook is displayed in a static mode and false otherwise.

Returns:
true if the workbook is displayed in a static mode and false otherwise.

isWorkbookCreated

public boolean isWorkbookCreated()
Returns status of embedded Excel workbook.

Returns:
JWorkbook status

notifyPrintPreviewStateChanged

public void notifyPrintPreviewStateChanged()

onPrintPreview

public void onPrintPreview()

onPrintPreviewExit

public void onPrintPreviewExit()

setContainer

protected void setContainer(JWorkbook.WorkbookContainer container)