|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jniwrapper.win32.jexcel.Application
public class Application
This class provides functionality for resolving general Excel application tasks.
Field Summary | |
---|---|
static com.jniwrapper.Int32 |
LANGUAGE_NEUTRAL_LCID
|
Constructor Summary | |
---|---|
Application(com.jniwrapper.win32.excel._Application application,
com.jniwrapper.win32.automation.OleMessageLoop messageLoop)
|
|
Application()
Creates an instance of Excel application. |
Method Summary | |
---|---|
void |
addApplicationEventListener(ApplicationEventListener eventListener)
Adds the specified application events listener. |
protected void |
addChildResource(com.jniwrapper.win32.jexcel.ApplicationAwareWrapper wrapper)
Adds a specified resource to the managed collection. |
void |
addToRecentFiles(java.io.File file)
Adds the specified file to the list of recent files. |
void |
allowMacros(boolean allow)
Restricts or allows macros execution in uploaded workbook. |
void |
close()
Closes the application and all opened workbooks without saving changes and without calling Application's quit() method. |
void |
close(boolean forceQuit)
Closes the application and all opened workbooks without saving changes. |
Workbook |
createWorkbook(java.lang.String title)
Adds a new workbook to the application. |
java.lang.String |
getActivePrinter()
Returns the name of the active printer. |
Window |
getActiveWindow()
Returns the active window. |
GenericWorkbook |
getActiveWorkbook()
Returns the active workbook. |
boolean |
getDisplayAlerts()
Checks whether Excel alerts are enabled or disabled. |
int |
getMajorVersionNumber()
Returns the major version number of MS Excel. |
com.jniwrapper.win32.excel.Name[] |
getNames()
Returns array of names. |
com.jniwrapper.win32.automation.OleMessageLoop |
getOleMessageLoop()
Returns the message loop thread for processing native peer function calls. |
com.jniwrapper.win32.excel._Application |
getPeer()
Returns the appropriate native peer. |
java.util.List |
getRecentFiles()
Returns the list of recent opened files. |
Range |
getSelection()
Returns selection. |
java.lang.String |
getVersion(com.jniwrapper.Int32 lcid)
Returns Excel version as a string value. |
java.util.List |
getWindows()
Returns the list of opened windows. |
java.util.List |
getWorkbooks()
Returns the list of opened workbooks. |
boolean |
isAutoDelete()
|
boolean |
isClosed()
Returns true if the application is closed. |
boolean |
isVisible()
Returns true if the application is visible or false otherwise. |
Workbook |
openWorkbook(java.io.File file)
Opens the specified workbook. |
Workbook |
openWorkbook(java.io.File file,
boolean readOnly)
Opens the specified workbook. |
Workbook |
openWorkbook(java.io.File file,
boolean readOnly,
java.lang.String password)
Opens the specified workbook. |
Workbook |
openWorkbook(java.io.File file,
boolean readOnly,
java.lang.String password,
java.lang.String writeResPassword)
Opens the specified workbook. |
void |
quit()
Quits this application. |
void |
removeApplicationEventListener(ApplicationEventListener eventListener)
Removes the specified application events listener from the list of listeners. |
protected void |
removeChildResource(com.jniwrapper.win32.jexcel.ApplicationAwareWrapper wrapper)
Removes a specified resource to the managed collection. |
void |
setActivePrinter(java.lang.String name)
Changes the active printer to the specified one. |
void |
setAutoDelete(boolean value)
|
void |
setDisplayAlerts(boolean value)
Allows or disallows disabling the Excel alerts depending of the specified parameters. |
protected void |
setOleMessageLoop(com.jniwrapper.win32.automation.OleMessageLoop oleMessageLoop)
|
void |
setVisible(boolean visible)
Shows or hides the application. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final com.jniwrapper.Int32 LANGUAGE_NEUTRAL_LCID
Constructor Detail |
---|
public Application() throws ExcelException
ExcelException
- if the Microsoft Excel application cannot be run.public Application(com.jniwrapper.win32.excel._Application application, com.jniwrapper.win32.automation.OleMessageLoop messageLoop)
Method Detail |
---|
public void addApplicationEventListener(ApplicationEventListener eventListener)
eventListener
- event listenerApplicationEventListener
public void removeApplicationEventListener(ApplicationEventListener eventListener)
eventListener
- event listenerApplicationEventListener
public com.jniwrapper.win32.automation.OleMessageLoop getOleMessageLoop()
public Workbook createWorkbook(java.lang.String title)
title
- is a title of the new workbook. May be null
.
public void allowMacros(boolean allow)
allow
- - execution security statepublic Workbook openWorkbook(java.io.File file) throws java.io.FileNotFoundException, ExcelException
file
- is a workbook file to be opened.
java.lang.IllegalArgumentException
- if the target file is not a file
java.io.FileNotFoundException
- if the target file doesn't exist
ExcelException
- if the target file has an unsupported format.public Workbook openWorkbook(java.io.File file, boolean readOnly) throws java.io.FileNotFoundException, ExcelException
file
- is a workbook file to be opened.readOnly
- if true
the file opens for read only.
java.lang.IllegalArgumentException
- if the target file is not a file
java.io.FileNotFoundException
- if the target file doesn't exist
ExcelException
- if the target file has an unsupported format.public Workbook openWorkbook(java.io.File file, boolean readOnly, java.lang.String password) throws java.io.FileNotFoundException, ExcelException
file
- is a workbook file to be opened.readOnly
- if true
the file opens for read only.password
- specified the password that required for opening the workbook. May be null.
java.lang.IllegalArgumentException
- if the target file is not a file
java.io.FileNotFoundException
- if the target file doesn't exist
ExcelException
- if the target file has an unsupported format.public Workbook openWorkbook(java.io.File file, boolean readOnly, java.lang.String password, java.lang.String writeResPassword) throws java.io.FileNotFoundException, ExcelException
file
- is a workbook file to be opened.readOnly
- if true
the file opens for read only.password
- specified the password that required for opening the workbook. May be null.writeResPassword
- specified the password that required for opening workbook for changes. May be null.
java.lang.IllegalArgumentException
- if the target file is not a file
java.io.FileNotFoundException
- if the target file doesn't exist
ExcelException
- if the target file has an unsupported format.public java.lang.String getVersion(com.jniwrapper.Int32 lcid)
lcid
- locale id
public int getMajorVersionNumber()
public java.util.List getWorkbooks()
Workbook
.
public java.util.List getWindows()
Window
.
public GenericWorkbook getActiveWorkbook()
public Window getActiveWindow()
public java.util.List getRecentFiles()
File
.
public void addToRecentFiles(java.io.File file)
file
- is a file to be added.public com.jniwrapper.win32.excel._Application getPeer()
public void setActivePrinter(java.lang.String name) throws java.awt.print.PrinterException
name
- is the full name of a printer.
java.lang.IllegalArgumentException
- if the target name is null
.
java.awt.print.PrinterException
- if the specified printer cannot be set up.public java.lang.String getActivePrinter()
public void setVisible(boolean visible)
visible
- if true
the application become visible.public boolean isVisible()
true
if the application is visible or false
otherwise.
true
if the application is visible or false
otherwise.public boolean isClosed()
true
if the application is closed.
true
if the application is closed.protected void addChildResource(com.jniwrapper.win32.jexcel.ApplicationAwareWrapper wrapper)
wrapper
- child resource.protected void removeChildResource(com.jniwrapper.win32.jexcel.ApplicationAwareWrapper wrapper)
wrapper
- child resource.public void quit()
public void close(boolean forceQuit)
forceQuit
- determines whether to call application's quit method.public void close()
public void setDisplayAlerts(boolean value)
value
- true allows to display alerts; false otherwisepublic boolean getDisplayAlerts()
public Range getSelection()
public com.jniwrapper.win32.excel.Name[] getNames()
protected void setOleMessageLoop(com.jniwrapper.win32.automation.OleMessageLoop oleMessageLoop)
public void setAutoDelete(boolean value)
setAutoDelete
in interface com.jniwrapper.AutoDeleteParameter
public boolean isAutoDelete()
isAutoDelete
in interface com.jniwrapper.AutoDeleteParameter
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |