Package org.eclipse.swt.ole.win32
Class OleClientSite
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.ole.win32.OleClientSite
- All Implemented Interfaces:
- Drawable
- Direct Known Subclasses:
- OleControlSite
OleClientSite provides a site to manage an embedded OLE Document within a container.
 
The OleClientSite provides the following capabilities:
- creates the in-place editor for a blank document or opening an existing OLE Document
- lays the editor out
- provides a mechanism for activating and deactivating the Document
- provides a mechanism for saving changes made to the document
This object implements the OLE Interfaces IUnknown, IOleClientSite, IAdviseSink, IOleInPlaceSite
Note that although this class is a subclass of Composite,
 it does not make sense to add Control children to it,
 or set a layout on it.
 
- Styles
- BORDER
- Events
- Dispose, Move, Resize
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected org.eclipse.swt.internal.ole.win32.GUIDprotected OleFrameprotected org.eclipse.swt.internal.ole.win32.IOleDocumentViewprotected org.eclipse.swt.internal.ole.win32.IOleCommandTargetprotected org.eclipse.swt.internal.ole.win32.IOleInPlaceObjectprotected org.eclipse.swt.internal.ole.win32.IOleObjectprotected org.eclipse.swt.internal.ole.win32.IUnknownprotected org.eclipse.swt.internal.ole.win32.IViewObject2protected org.eclipse.swt.internal.ole.win32.IStorage
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedOleClientSite(Composite parent, int style) OleClientSite(Composite parent, int style, File file) Create an OleClientSite child widget using the OLE Document type associated with the specified file.OleClientSite(Composite parent, int style, String progId) Create an OleClientSite child widget to edit a blank document using the specified OLE Document application.OleClientSite(Composite parent, int style, String progId, File file) Create an OleClientSite child widget to edit the specified file using the specified OLE Document application.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidprotected intAddRef()protected voidprotected org.eclipse.swt.internal.ole.win32.IStoragevoidDeactivates an active in-place object and discards the object's undo state.protected voidintdoVerb(int verb) Requests that the OLE Document or ActiveX Control perform an action; actions are almost always changes to the activation state.intAsks the OLE Document or ActiveX Control to execute a command from a standard list of commands.protected org.eclipse.swt.internal.ole.win32.GUIDgetClassID(String clientName) Returns the indent value that would be used to compute the clipping area of the active X object.Returns the program ID of the OLE Document or ActiveX Control.protected intGetWindow(long phwnd) booleanisDirty()Returns whether ole document is dirty by checking whether the content of the file representing the document is dirty.booleanReturnstrueif the receiver has the user-interface focus, andfalseotherwise.protected intQueryInterface(long riid, long ppvObject) intqueryStatus(int cmd) Returns the status of the specified command.protected intRelease()protected voidbooleanSaves the document to the specified file and includes OLE specific information if specified.voidThe indent value is no longer being used by the client site.voidshowProperties(String title) Displays a dialog with the property information for this OLE Object.Methods inherited from class org.eclipse.swt.widgets.Compositechanged, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toStringMethods inherited from class org.eclipse.swt.widgets.ScrollablecomputeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods inherited from class org.eclipse.swt.widgets.ControladdControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateMethods inherited from class org.eclipse.swt.widgets.WidgetaddDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setDataMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.DrawableisAutoScalable
- 
Field Details- 
appClsidprotected org.eclipse.swt.internal.ole.win32.GUID appClsid
- 
frame
- 
objIUnknownprotected org.eclipse.swt.internal.ole.win32.IUnknown objIUnknown
- 
objIOleObjectprotected org.eclipse.swt.internal.ole.win32.IOleObject objIOleObject
- 
objIViewObject2protected org.eclipse.swt.internal.ole.win32.IViewObject2 objIViewObject2
- 
objIOleInPlaceObjectprotected org.eclipse.swt.internal.ole.win32.IOleInPlaceObject objIOleInPlaceObject
- 
objIOleCommandTargetprotected org.eclipse.swt.internal.ole.win32.IOleCommandTarget objIOleCommandTarget
- 
objDocumentViewprotected org.eclipse.swt.internal.ole.win32.IOleDocumentView objDocumentView
- 
tempStorageprotected org.eclipse.swt.internal.ole.win32.IStorage tempStorage
 
- 
- 
Constructor Details- 
OleClientSite
- 
OleClientSiteCreate an OleClientSite child widget using the OLE Document type associated with the specified file. The OLE Document type is determined either through header information in the file or through a Registry entry for the file extension. Use style bits to select a particular look or set of properties.- Parameters:
- parent- a composite widget; must be an OleFrame
- style- the bitwise OR'ing of widget styles
- file- the file that is to be opened in this OLE Document
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT when the parent is null
- ERROR_INVALID_ARGUMENT when the parent is not an OleFrame
 
- SWTException-- ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
- ERROR_CANNOT_CREATE_OBJECT when failed to create OLE Object
- ERROR_CANNOT_OPEN_FILE when failed to open file
- ERROR_INTERFACE_NOT_FOUND when unable to create callbacks for OLE Interfaces
- ERROR_INVALID_CLASSID
 
 
- 
OleClientSiteCreate an OleClientSite child widget to edit a blank document using the specified OLE Document application. Use style bits to select a particular look or set of properties.- Parameters:
- parent- a composite widget; must be an OleFrame
- style- the bitwise OR'ing of widget styles
- progId- the unique program identifier of an OLE Document application; the value of the ProgID key or the value of the VersionIndependentProgID key specified in the registry for the desired OLE Document (for example, the VersionIndependentProgID for Word is Word.Document)
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT when the parent is null
- ERROR_INVALID_ARGUMENT when the parent is not an OleFrame
 
- SWTException-- ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
- ERROR_INVALID_CLASSID when the progId does not map to a registered CLSID
- ERROR_CANNOT_CREATE_OBJECT when failed to create OLE Object
 
 
- 
OleClientSiteCreate an OleClientSite child widget to edit the specified file using the specified OLE Document application. Use style bits to select a particular look or set of properties.IMPORTANT: This method is not part of the public API for OleClientSite. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.- Parameters:
- parent- a composite widget; must be an OleFrame
- style- the bitwise OR'ing of widget styles
- progId- the unique program identifier of am OLE Document application; the value of the ProgID key or the value of the VersionIndependentProgID key specified in the registry for the desired OLE Document (for example, the VersionIndependentProgID for Word is Word.Document)
- file- the file that is to be opened in this OLE Document
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT when the parent is null
- ERROR_INVALID_ARGUMENT when the parent is not an OleFrame
 
- SWTException-- ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
- ERROR_INVALID_CLASSID when the progId does not map to a registered CLSID
- ERROR_CANNOT_CREATE_OBJECT when failed to create OLE Object
- ERROR_CANNOT_OPEN_FILE when failed to open file
 
- Restriction:
- This method is not intended to be referenced by clients.
 
 
- 
- 
Method Details- 
addObjectReferencesprotected void addObjectReferences()
- 
AddRefprotected int AddRef()
- 
createCOMInterfacesprotected void createCOMInterfaces()
- 
createTempStorageprotected org.eclipse.swt.internal.ole.win32.IStorage createTempStorage()
- 
deactivateInPlaceClientpublic void deactivateInPlaceClient()Deactivates an active in-place object and discards the object's undo state.
- 
disposeCOMInterfacesprotected void disposeCOMInterfaces()
- 
doVerbpublic int doVerb(int verb) Requests that the OLE Document or ActiveX Control perform an action; actions are almost always changes to the activation state.- Parameters:
- verb- the operation that is requested. This is one of the OLE.OLEIVERB_ values
- Returns:
- an HRESULT value indicating the success of the operation request; OLE.S_OK indicates success
 
- 
execAsks the OLE Document or ActiveX Control to execute a command from a standard list of commands. The OLE Document or ActiveX Control must support the IOleCommandTarget interface. The OLE Document or ActiveX Control does not have to support all the commands in the standard list. To check if a command is supported, you can call queryStatus with the cmdID.- Parameters:
- cmdID- the ID of a command; these are the OLE.OLECMDID_ values - a small set of common commands
- options- the optional flags; these are the OLE.OLECMDEXECOPT_ values
- in- the argument for the command
- out- the return value of the command
- Returns:
- an HRESULT value; OLE.S_OK is returned if successful
 
- 
getClassID
- 
getIndentReturns the indent value that would be used to compute the clipping area of the active X object. NOTE: The indent value is no longer being used by the client site.- Returns:
- the rectangle representing the indent
 
- 
getProgramIDReturns the program ID of the OLE Document or ActiveX Control.- Returns:
- the program ID of the OLE Document or ActiveX Control
 
- 
GetWindowprotected int GetWindow(long phwnd) 
- 
isDirtypublic boolean isDirty()Returns whether ole document is dirty by checking whether the content of the file representing the document is dirty.- Returns:
- trueif the document has been modified,- falseotherwise.
- Since:
- 3.1
 
- 
isFocusControlpublic boolean isFocusControl()Description copied from class:ControlReturnstrueif the receiver has the user-interface focus, andfalseotherwise.- Overrides:
- isFocusControlin class- Control
- Returns:
- the receiver's focus state
 
- 
QueryInterfaceprotected int QueryInterface(long riid, long ppvObject) 
- 
queryStatuspublic int queryStatus(int cmd) Returns the status of the specified command. The status is any bitwise OR'd combination of SWTOLE.OLECMDF_SUPPORTED, SWTOLE.OLECMDF_ENABLED, SWTOLE.OLECMDF_LATCHED, SWTOLE.OLECMDF_NINCHED. You can query the status of a command before invoking it with OleClientSite.exec. The OLE Document or ActiveX Control must support the IOleCommandTarget to make use of this method.- Parameters:
- cmd- the ID of a command; these are the OLE.OLECMDID_ values - a small set of common commands
- Returns:
- the status of the specified command or 0 if unable to query the OLE Object; these are the OLE.OLECMDF_ values
 
- 
Releaseprotected int Release()
- 
releaseObjectInterfacesprotected void releaseObjectInterfaces()
- 
saveSaves the document to the specified file and includes OLE specific information if specified. This method must only be used for files that have an OLE Storage format. For example, a word file edited with Word.Document should be saved using this method because there is formating information that should be stored in the OLE specific Storage format.- Parameters:
- file- the file to which the changes are to be saved
- includeOleInfo- the flag to indicate whether OLE specific information should be saved.
- Returns:
- true if the save was successful
 
- 
setIndentThe indent value is no longer being used by the client site.- Parameters:
- newIndent- the rectangle representing the indent amount
 
- 
showPropertiesDisplays a dialog with the property information for this OLE Object. The OLE Document or ActiveX Control must support the ISpecifyPropertyPages interface.- Parameters:
- title- the name that will appear in the titlebar of the dialog
 
 
-