org.eodisp.wrapper.excel
Class ExcelApplication

java.lang.Object
  extended by org.eodisp.wrapper.excel.ExcelApplication

public class ExcelApplication
extends java.lang.Object

Represents the Excel Application. Usage:

 Display display = new Display();
 Shell shell = new Shell(display);
 ExcelApplication excelApplication = new ExcelApplication(shell);
 excelApplication.setVisible(true);
 while (!shell.isDisposed()) {
     if (!display.readAndDispatch())
        display.sleep();
 }
 display.dispose();
 

Author:
ibirrer

Field Summary
static int ALWAYS_UPDATE_LINKS
           
(package private) static int APPLICATION_VISIBLE
           
static int NEVER_UPDATE_LINKS
           
static int USER_SPECIFIED_UPDATE_LINKS
           
 
Constructor Summary
ExcelApplication(org.eclipse.swt.widgets.Shell shell)
           
 
Method Summary
 org.eclipse.swt.ole.win32.OleAutomation getAutomation()
          Returns the ole automation object of the Excel Application.
(package private)  org.eclipse.swt.ole.win32.OleControlSite getControlSite()
           
 long getNrOfWorkbooks()
          Returns the number of workbooks open in this Excel Application.
static void main(java.lang.String[] args)
          For testing only
 Workbook openWorkbook(java.io.File file)
          Opens a workbook.
 Workbook openWorkbook(java.io.File file, int updateLinks, boolean readOnly)
          Opens a workbook.
 void quit()
          Quit the Excel application.
 void setVisible(boolean visible)
          Toggle the visibility of the application's main window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION_VISIBLE

static final int APPLICATION_VISIBLE
See Also:
Constant Field Values

USER_SPECIFIED_UPDATE_LINKS

public static final int USER_SPECIFIED_UPDATE_LINKS
See Also:
Constant Field Values

NEVER_UPDATE_LINKS

public static final int NEVER_UPDATE_LINKS
See Also:
Constant Field Values

ALWAYS_UPDATE_LINKS

public static final int ALWAYS_UPDATE_LINKS
See Also:
Constant Field Values
Constructor Detail

ExcelApplication

public ExcelApplication(org.eclipse.swt.widgets.Shell shell)
Method Detail

getNrOfWorkbooks

public long getNrOfWorkbooks()
Returns the number of workbooks open in this Excel Application.

Returns:
the number of workbooks open in this Excel Application.

openWorkbook

public Workbook openWorkbook(java.io.File file)
                      throws java.io.IOException
Opens a workbook.

Parameters:
file - the workbook to open
Returns:
the opened workbook.
Throws:
java.io.IOException - if the workbook could not be opened

openWorkbook

public Workbook openWorkbook(java.io.File file,
                             int updateLinks,
                             boolean readOnly)
                      throws java.io.IOException
Opens a workbook.

Parameters:
file - the workbook to open
updateLinks - if Excel links shall be updated at loading time
readOnly - if the workbook shall be loaded as read-only.
Returns:
the workbook
Throws:
java.io.IOException - if the workbook could not be opened

setVisible

public void setVisible(boolean visible)
Toggle the visibility of the application's main window.

Parameters:
visible - true to set it visible

getControlSite

org.eclipse.swt.ole.win32.OleControlSite getControlSite()

main

public static void main(java.lang.String[] args)
For testing only

Parameters:
args - command line args

quit

public void quit()
Quit the Excel application.


getAutomation

public org.eclipse.swt.ole.win32.OleAutomation getAutomation()
Returns the ole automation object of the Excel Application.

Returns:
the ole automation object of the Excel Application.