Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.swt.ole.win32
Class OleClientSite


java.lang.Object
  extended by 

org.eclipse.swt.widgets.Widget
      extended by 

org.eclipse.swt.widgets.Control
          extended by 

org.eclipse.swt.widgets.Scrollable
              extended by 

org.eclipse.swt.widgets.Composite
                  extended by 
org.eclipse.swt.ole.win32.OleClientSite
All Implemented Interfaces:
Drawable
Direct Known Subclasses:
OleControlSite

public class OleClientSite
extends Composite

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

See Also:
OLE and ActiveX snippets, SWT Examples: OLEExample, OleWebBrowser

Field Summary
protected  org.eclipse.swt.internal.ole.win32.GUID appClsid
           
protected   OleFrame frame
           
protected  org.eclipse.swt.internal.ole.win32.IOleDocumentView objDocumentView
           
protected  org.eclipse.swt.internal.ole.win32.IOleCommandTarget objIOleCommandTarget
           
protected  org.eclipse.swt.internal.ole.win32.IOleInPlaceObject objIOleInPlaceObject
           
protected  org.eclipse.swt.internal.ole.win32.IOleObject objIOleObject
           
protected  org.eclipse.swt.internal.ole.win32.IUnknown objIUnknown
           
protected  org.eclipse.swt.internal.ole.win32.IViewObject2 objIViewObject2
           
protected  org.eclipse.swt.internal.ole.win32.IStorage tempStorage
           
 
Fields inherited from class org.eclipse.swt.widgets. Control
handle
 
Constructor Summary
protected OleClientSite ( 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 Summary
protected  void addObjectReferences ()
           
protected  int AddRef ()
           
protected  void createCOMInterfaces ()
           
protected  org.eclipse.swt.internal.ole.win32.IStorage createTempStorage ()
           
 void deactivateInPlaceClient ()
          Deactivates an active in-place object and discards the object's undo state.
protected  void disposeCOMInterfaces ()
           
 int doVerb (int verb)
          Requests that the OLE Document or ActiveX Control perform an action; actions are almost always changes to the activation state.
 int exec (int cmdID, int options, Variant in, Variant out)
          Asks the OLE Document or ActiveX Control to execute a command from a standard list of commands.
protected  org.eclipse.swt.internal.ole.win32.GUID getClassID ( String clientName)
           
  Rectangle getIndent ()
          Returns the indent value that would be used to compute the clipping area of the active X object.
  String getProgramID ()
          Returns the program ID of the OLE Document or ActiveX Control.
protected  int GetWindow (int phwnd)
           
 boolean isDirty ()
          Returns whether ole document is dirty by checking whether the content of the file representing the document is dirty.
 boolean isFocusControl ()
          Returns true if the receiver has the user-interface focus, and false otherwise.
protected  int QueryInterface (int riid, int ppvObject)
           
 int queryStatus (int cmd)
          Returns the status of the specified command.
protected  int Release ()
           
protected  void releaseObjectInterfaces ()
           
 boolean save ( File file, boolean includeOleInfo)
          Saves the document to the specified file and includes OLE specific information if specified.
 void setIndent ( Rectangle newIndent)
          The indent value is no longer being used by the client site.
 void showProperties ( String title)
          Displays a dialog with the property information for this OLE Object.
 
Methods inherited from class org.eclipse.swt.widgets. Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets. Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets. Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets. Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

appClsid

protected org.eclipse.swt.internal.ole.win32.GUID appClsid

frame

protected 
OleFrame frame

objIUnknown

protected org.eclipse.swt.internal.ole.win32.IUnknown objIUnknown

objIOleObject

protected org.eclipse.swt.internal.ole.win32.IOleObject objIOleObject

objIViewObject2

protected org.eclipse.swt.internal.ole.win32.IViewObject2 objIViewObject2

objIOleInPlaceObject

protected org.eclipse.swt.internal.ole.win32.IOleInPlaceObject objIOleInPlaceObject

objIOleCommandTarget

protected org.eclipse.swt.internal.ole.win32.IOleCommandTarget objIOleCommandTarget

objDocumentView

protected org.eclipse.swt.internal.ole.win32.IOleDocumentView objDocumentView

tempStorage

protected org.eclipse.swt.internal.ole.win32.IStorage tempStorage
Constructor Detail

OleClientSite

protected OleClientSite(
Composite parent,
                        int style)

OleClientSite

public OleClientSite(
Composite parent,
                     int style,
                     
File file)
Create 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

OleClientSite

public OleClientSite(
Composite parent,
                     int style,
                     
String progId)
Create 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 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)
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

OleClientSite

public 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. 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
Method Detail

addObjectReferences

protected void addObjectReferences()

AddRef

protected int AddRef()

createCOMInterfaces

protected void createCOMInterfaces()

createTempStorage

protected org.eclipse.swt.internal.ole.win32.IStorage createTempStorage()

deactivateInPlaceClient

public void deactivateInPlaceClient()
Deactivates an active in-place object and discards the object's undo state.


disposeCOMInterfaces

protected void disposeCOMInterfaces()

doVerb

public 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

exec

public int exec(int cmdID,
                int options,
                
Variant in,
                
Variant out)
Asks 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

protected org.eclipse.swt.internal.ole.win32.GUID getClassID(
String clientName)

getIndent

public 
Rectangle getIndent()
Returns 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

getProgramID

public 
String getProgramID()
Returns the program ID of the OLE Document or ActiveX Control.

Returns:
the program ID of the OLE Document or ActiveX Control

GetWindow

protected int GetWindow(int phwnd)

isDirty

public boolean isDirty()
Returns whether ole document is dirty by checking whether the content of the file representing the document is dirty.

Returns:
true if the document has been modified, false otherwise.
Since:
3.1

isFocusControl

public boolean isFocusControl()
Description copied from class: Control
Returns true if the receiver has the user-interface focus, and false otherwise.

Overrides:
isFocusControl in class Control
Returns:
the receiver's focus state

QueryInterface

protected int QueryInterface(int riid,
                             int ppvObject)

queryStatus

public 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

Release

protected int Release()

releaseObjectInterfaces

protected void releaseObjectInterfaces()

save

public boolean save(
File file,
                    boolean includeOleInfo)
Saves 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

setIndent

public void setIndent(
Rectangle newIndent)
The indent value is no longer being used by the client site.

Parameters:
newIndent - the rectangle representing the indent amount

showProperties

public void showProperties(
String title)
Displays 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

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire