com.jniwrapper.win32.jexcel
Class Window

java.lang.Object
  extended by com.jniwrapper.win32.jexcel.Window
All Implemented Interfaces:
com.jniwrapper.AutoDeleteParameter

public class Window
extends java.lang.Object

This class provides functionality for working with Excel windows.


Nested Class Summary
static class Window.State
          This class is an enumeration of supported window states.
 
Method Summary
 void activate()
          Activates the window.
 Application getApplication()
          Returns the application object.
 java.lang.String getCaption()
          Returns the caption of the window.
 boolean getDisplayFormulas()
          Checks the visibility of formulas in this window.
 boolean getDisplayGridlines()
          Checks the visibility of griglines in this window.
 boolean getDisplayHeadings()
          Checks the visibility of headings in this window.
 boolean getDisplayHorizontalScrollBar()
          Checks the visibility of horizontal scroll bar in this window.
 boolean getDisplayOutline()
          Checks the visibility of outline in this window.
 boolean getDisplayVerticalScrollBar()
          Checks the visibility of vertical scroll bar in this window.
 boolean getDisplayWorkbookTabs()
          Checks the visibility of workbook tabs in this window.
 int getHeight()
          Returns the current height of the window in pixels.
 int getIndex()
          Returns the index number of the window.
 com.jniwrapper.win32.automation.OleMessageLoop getOleMessageLoop()
          Returns the message loop thread for processing native peer function calls.
 com.jniwrapper.win32.excel.Window getPeer()
          Returns the appropriate native peer.
 Window.State getState()
          Returns the window state.
 int getWidth()
          Returns the current width of the window in pixels.
 GenericWorkbook getWorkbook()
          Returns the contained workbook.
 double getZoom()
          Returns the document zoom in percents.
 boolean isAutoDelete()
           
 boolean isVisible()
          Checked if the window in shown.
 void release()
          Releases this wrapper object.
 void setAutoDelete(boolean value)
           
 void setCaption(java.lang.String caption)
          Sets up the caption of the window.
 void setDisplayFormulas(boolean value)
          Sets up the visibility of formulas in the window.
 void setDisplayGridlines(boolean value)
          Sets up the visibility of griglines in the window.
 void setDisplayHeadings(boolean value)
          Sets up the visibility of headings scroll bar in the window.
 void setDisplayHorizontalScrollBar(boolean value)
          Sets up the visibility of horizontal scroll bar in the window.
 void setDisplayOutline(boolean value)
          Sets up the visibility of outline in the window.
 void setDisplayVerticalScrollBar(boolean value)
          Sets up the visibility of vertical scroll bar in the window.
 void setDisplayWorkbookTabs(boolean value)
          Sets up the visibility of workbook tabs in the window.
 void setHeight(int height)
          Sets up the height of the window.
protected  void setOleMessageLoop(com.jniwrapper.win32.automation.OleMessageLoop oleMessageLoop)
           
 void setState(Window.State state)
          Changes the window state.
 void setVisible(boolean visible)
          Sets up the visibility of the window.
 void setWidth(int width)
          Sets up the width of the window.
 void setZoom(double zoom)
          Specifies the document zoom in percents.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getPeer

public com.jniwrapper.win32.excel.Window getPeer()
Returns the appropriate native peer.

Returns:
the appropriate native peer.

getCaption

public java.lang.String getCaption()
Returns the caption of the window.

Returns:
the caption of the window.

setCaption

public void setCaption(java.lang.String caption)
Sets up the caption of the window.

Parameters:
caption - is the caption to be set up.
Throws:
java.lang.IllegalArgumentException - the specified caption is null.

activate

public void activate()
Activates the window.


getWorkbook

public GenericWorkbook getWorkbook()
Returns the contained workbook.

Returns:
the contained workbook.

getIndex

public int getIndex()
Returns the index number of the window.

Returns:
the index number of the window.

setHeight

public void setHeight(int height)
Sets up the height of the window. NOTE: The height can be modified only if the window is in @link State.NORMAL state.

Parameters:
height - is the height in pixels to be set up.
Throws:
java.lang.IllegalArgumentException - if the specified height is negative or cannot be set up.
java.lang.IllegalStateException - if the window is not in @link State.NORMAL state.

getHeight

public int getHeight()
Returns the current height of the window in pixels.

Returns:
the current height of the window.

setWidth

public void setWidth(int width)
Sets up the width of the window. NOTE: The width can be modified only if the window is in @link State.NORMAL state.

Parameters:
width - is the width in pixels to be set up.
Throws:
java.lang.IllegalArgumentException - if the specified width is negative or cannot be set up.
java.lang.IllegalStateException - if the window is not in @link State.NORMAL state.

getWidth

public int getWidth()
Returns the current width of the window in pixels.

Returns:
the current width of the window.

isVisible

public boolean isVisible()
Checked if the window in shown.

Returns:
true if the window is shown.

setVisible

public void setVisible(boolean visible)
Sets up the visibility of the window.

Parameters:
visible - is a state to set up.

getZoom

public double getZoom()
Returns the document zoom in percents.

Returns:
the document zoom in percents.

setZoom

public void setZoom(double zoom)
Specifies the document zoom in percents.

Parameters:
zoom - is the document zoom in percents.
Throws:
java.lang.IllegalArgumentException - if the specified zoom cannot be set up.

setState

public void setState(Window.State state)
Changes the window state.

Parameters:
state - is a new state.
Throws:
java.lang.IllegalArgumentException - if the target state is null.
See Also:
Window.State

getState

public Window.State getState()
Returns the window state.

Returns:
the window state.
See Also:
Window.State

setDisplayGridlines

public void setDisplayGridlines(boolean value)
Sets up the visibility of griglines in the window.

Parameters:
value - value is a state to set up.

getDisplayGridlines

public boolean getDisplayGridlines()
Checks the visibility of griglines in this window.

Returns:
true if gridlines are visible; false otherwise.

setDisplayFormulas

public void setDisplayFormulas(boolean value)
Sets up the visibility of formulas in the window.

Parameters:
value - value is a state to set up.

getDisplayFormulas

public boolean getDisplayFormulas()
Checks the visibility of formulas in this window.

Returns:
true if formulas are visible; false otherwise.

setDisplayHorizontalScrollBar

public void setDisplayHorizontalScrollBar(boolean value)
Sets up the visibility of horizontal scroll bar in the window.

Parameters:
value - value is a state to set up.

getDisplayHorizontalScrollBar

public boolean getDisplayHorizontalScrollBar()
Checks the visibility of horizontal scroll bar in this window.

Returns:
true if horizontal scroll bar is visible; false otherwise.

setDisplayVerticalScrollBar

public void setDisplayVerticalScrollBar(boolean value)
Sets up the visibility of vertical scroll bar in the window.

Parameters:
value - value is a state to set up.

getDisplayVerticalScrollBar

public boolean getDisplayVerticalScrollBar()
Checks the visibility of vertical scroll bar in this window.

Returns:
true if vertical scroll bar is visible; false otherwise.

setDisplayHeadings

public void setDisplayHeadings(boolean value)
Sets up the visibility of headings scroll bar in the window.

Parameters:
value - value is a state to set up.

getDisplayHeadings

public boolean getDisplayHeadings()
Checks the visibility of headings in this window.

Returns:
true if headings are visible; false otherwise.

setDisplayWorkbookTabs

public void setDisplayWorkbookTabs(boolean value)
Sets up the visibility of workbook tabs in the window.

Parameters:
value - value is a state to set up.

getDisplayWorkbookTabs

public boolean getDisplayWorkbookTabs()
Checks the visibility of workbook tabs in this window.

Returns:
true if workbook tabs are visible; false otherwise.

setDisplayOutline

public void setDisplayOutline(boolean value)
Sets up the visibility of outline in the window.

Parameters:
value - value is a state to set up.

getDisplayOutline

public boolean getDisplayOutline()
Checks the visibility of outline in this window.

Returns:
true if outline is visible; false otherwise.

release

public void release()
Releases this wrapper object.


getApplication

public Application getApplication()
Returns the application object.

Returns:
the application.

getOleMessageLoop

public com.jniwrapper.win32.automation.OleMessageLoop getOleMessageLoop()
Returns the message loop thread for processing native peer function calls.

Returns:
the message loop thread for processing native peer function calls.

setOleMessageLoop

protected void setOleMessageLoop(com.jniwrapper.win32.automation.OleMessageLoop oleMessageLoop)

setAutoDelete

public void setAutoDelete(boolean value)
Specified by:
setAutoDelete in interface com.jniwrapper.AutoDeleteParameter

isAutoDelete

public boolean isAutoDelete()
Specified by:
isAutoDelete in interface com.jniwrapper.AutoDeleteParameter

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object