com.jniwrapper.win32.automation
Class OfficeContainer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended bycom.jniwrapper.win32.automation.OleContainer
              extended bycom.jniwrapper.win32.automation.OfficeContainer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class OfficeContainer
extends OleContainer

This class enables to embed OLE/ActiveX MS Office controls into java application.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.jniwrapper.win32.automation.OleContainer
OleContainer.AutoActivateMode, OleContainer.SizeMode
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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
OfficeContainer()
          Creates OLE container for MS Office components.
OfficeContainer(OleMessageLoop messageLoop)
          Creates OLE container for MS Office components.
 
Method Summary
protected  void activate()
          Activates UI
protected  void configureSibling()
          Configures sibling window
 void createObject(CLSID clsid)
          Creates an object in the container by CLSID.
 void createObject(java.io.File file)
          Creates an object in the container by association specified by the file name.
 void createObject(java.lang.String oleClassName)
          Creates an object in the container by class name.
 void destroyObject()
          Destroys the previously created OleObject.
protected  void draw()
          Default method for drawning an embedded component which is in inactive state.
 OleContainer.AutoActivateMode getAutoActivateMode()
          Describes how the object in an OLE container is activated.
 CLSID getContainedObjectCLSID()
          Retrieves CLSID of the object embedded into OLE container
protected  boolean isActive()
          Returns UI state
 boolean isStaticMode()
          Returns true if the embedded object is displayed in a static mode and false in a UI active mode.
 void paint(java.awt.Graphics g)
           
 HResult save(java.io.File file)
          Saves an OLE object to file.
protected  void setActive(boolean active)
          Switches application UI active state
 void setStaticMode(boolean value)
          Changes the embedded workbook displaying mode.
 
Methods inherited from class com.jniwrapper.win32.automation.OleContainer
addFocusListener, addNotify, doVerb, drawBitmap, getActivationVerb, getContainerBounds, getContainerWindow, getCurrentDocumentType, getFileOperationsHandler, getObjectWindow, getOleClientSite, getOleMessageLoop, getOleObject, getOleObjectViewSize, getPrintDocumentHandler, getSizeMode, inPlaceDeactivate, insertObject, isFocused, isHandleUpdateAsSave, isPrintPreview, load, load, load, open, processKeyEvent, removeFocusListener, removeNotify, save, save, setActivationVerb, setAutoActivateMode, setFileOperationsHandler, setFocused, setHandleUpdateAsSave, setPrintDocumentHandler, setSizeMode, takeScreenshot, uiActivate, uiDeactivate, updateClientSide
 
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OfficeContainer

public OfficeContainer()
Creates OLE container for MS Office components.


OfficeContainer

public OfficeContainer(OleMessageLoop messageLoop)
Creates OLE container for MS Office components.

Parameters:
messageLoop - - Ole Message Loop specific for this container. Shall be started before creating an object.
Method Detail

createObject

public void createObject(CLSID clsid)
                  throws ComException
Creates an object in the container by CLSID. A previously created object is destroyed automatically.

Overrides:
createObject in class OleContainer
Parameters:
clsid - - CLSID of the object to be created
Throws:
ComException

createObject

public void createObject(java.io.File file)
                  throws ComException
Creates an object in the container by association specified by the file name. A previously created object is destroyed automatically.

Overrides:
createObject in class OleContainer
Parameters:
file - - source(storage) file of the object to be created
Throws:
ComException

createObject

public void createObject(java.lang.String oleClassName)
                  throws ComException
Creates an object in the container by class name. A previously created object is destroyed automatically.

Overrides:
createObject in class OleContainer
Parameters:
oleClassName - - class name of the object to be created
Throws:
ComException

save

public HResult save(java.io.File file)
Description copied from class: OleContainer
Saves an OLE object to file.

Overrides:
save in class OleContainer
Parameters:
file - for saving
Returns:
returns non-negative result of native method. Can be used to determine user choise in overwrite dialog.
See Also:
HResult.S_OK, HResult.S_FALSE

activate

protected void activate()
Activates UI

Overrides:
activate in class OleContainer

draw

protected void draw()
Default method for drawning an embedded component which is in inactive state.

Overrides:
draw in class OleContainer

configureSibling

protected void configureSibling()
Configures sibling window

Overrides:
configureSibling in class OleContainer

getAutoActivateMode

public OleContainer.AutoActivateMode getAutoActivateMode()
Describes how the object in an OLE container is activated.

Overrides:
getAutoActivateMode in class OleContainer

destroyObject

public void destroyObject()
Destroys the previously created OleObject.

Overrides:
destroyObject in class OleContainer

paint

public void paint(java.awt.Graphics g)

isActive

protected boolean isActive()
Returns UI state

Returns:
- UI state: true - UI activated; false - UI deactivated

setActive

protected void setActive(boolean active)
Switches application UI active state

Parameters:
active - - true - UI activated, other components addressing the same server may loose the UI controls; false - UI deactivated, UI controls free for usage in other components.

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 embedded object is displayed in a static mode and false in a UI active mode.

Returns:
true if the embedded object is displayed in a static mode and false in a UI active mode.

getContainedObjectCLSID

public CLSID getContainedObjectCLSID()
Retrieves CLSID of the object embedded into OLE container

Returns:
- CLSID of the embedded object