Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.swt.ole.win32
Class OleControlSite

    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
                          org.eclipse.swt.ole.win32.OleControlSite

All Implemented Interfaces:
  Drawable

public class OleControlSite
extends OleClientSite

OleControlSite provides a site to manage an embedded ActiveX Control within a container.

In addition to the behaviour provided by OleClientSite, this object provides the following:

- events from the ActiveX control
- notification of property changes from the ActiveX control
- simplified access to well known properties of the ActiveX Control (e.g. font, background color)
- expose ambient properties of the container to the ActiveX Control

This object implements the OLE Interfaces IOleControlSite, IDispatch, and IPropertyNotifySink.

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 Summary

Fields inherited from class org.eclipse.swt.ole.win32.OleClientSite
`appClsid, frame, objDocumentView, objIOleCommandTarget, objIOleInPlaceObject, objIOleObject, objIUnknown, objIViewObject2, tempStorage`

Fields inherited from class org.eclipse.swt.widgets.Control
`handle`

Constructor Summary
`OleControlSite(Composite parent, int style, String progId)` Create an OleControlSite child widget using style bits to select a particular look or set of properties.

Method Summary
`void` | `addEventListener(int eventID, OleListener listener)` Adds the listener to receive events.
`void` | `addEventListener(OleAutomation automation, int eventID, OleListener listener)` Adds the listener to receive events.
`protected void` | `addObjectReferences()`
`void` | `addPropertyListener(int propertyID, OleListener listener)` Adds the listener to receive events.
`protected void` | `createCOMInterfaces()`
`protected void` | `disposeCOMInterfaces()`
`Color` | `getBackground()` Returns the receiver's background color.
`Font` | `getFont()` Returns the font that the receiver will use to paint textual information.
`Color` | `getForeground()` Returns the foreground color that the receiver will use to draw.
`protected int` | `getLicenseInfo(org.eclipse.swt.internal.ole.win32.GUID clsid)`
`Variant` | `getSiteProperty(int dispId)` Get the control site property specified by the dispIdMember.
`protected int` | `GetWindow(int phwnd)`
`protected int` | `OnUIDeactivate(int fUndoable)`
`protected int` | `QueryInterface(int riid, int ppvObject)`
`protected int` | `Release()`
`protected void` | `releaseObjectInterfaces()`
`void` | `removeEventListener(int eventID, OleListener listener)` Removes the listener.
`void` | `removeEventListener(OleAutomation automation, org.eclipse.swt.internal.ole.win32.GUID guid, int eventID, OleListener listener)` Deprecated. - use OleControlSite.removeEventListener(OleAutomation, int, OleListener)
`void` | `removeEventListener(OleAutomation automation, int eventID, OleListener listener)` Removes the listener.
`void` | `removePropertyListener(int propertyID, OleListener listener)` Removes the listener.
`void` | `setBackground(Color color)` Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.
`void` | `setFont(Font font)` Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.
`void` | `setForeground(Color color)` Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.
`void` | `setSiteProperty(int dispId, Variant value)` Sets the control site property specified by the dispIdMember to a new value.

Methods inherited from class org.eclipse.swt.ole.win32.OleClientSite
`AddRef, createTempStorage, deactivateInPlaceClient, doVerb, exec, getClassID, getIndent, getProgramID, isDirty, isFocusControl, queryStatus, save, setIndent, showProperties`

Methods inherited from class org.eclipse.swt.widgets.Composite
`checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList`

Methods inherited from class org.eclipse.swt.widgets.Scrollable
`computeTrim, getClientArea, getHorizontalBar, getVerticalBar`

Methods inherited from class org.eclipse.swt.widgets.Control
`addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBorderWidth, getBounds, getEnabled, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBounds, setBounds, setCapture, setCursor, setEnabled, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, 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, 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`

Constructor Detail

### OleControlSite

    public OleControlSite(Composite parent,
                          int style,
                          String progId)

  Create an OleControlSite child widget using 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
Throws:
  `SWTError` -
  - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
  - ERROR_ERROR_NULL_ARGUMENT when the parent is null
  - 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_ACCESS_CLASSFACTORY when Class Factory could not be found
  - ERROR_CANNOT_CREATE_LICENSED_OBJECT when failed to create a licensed OLE Object
  - ERROR_INTERFACES_NOT_INITIALIZED when unable to create callbacks for OLE Interfaces

Method Detail

### addEventListener

    public void addEventListener(int eventID,
                                 OleListener listener)

  Adds the listener to receive events.

  Parameters:
    `eventID` - the id of the event
    `listener` - the listener
  Throws:
    `SWTError` -
    - ERROR_NULL_ARGUMENT when listener is null

### addEventListener

    public void addEventListener(OleAutomation automation,
                                 int eventID,
                                 OleListener listener)

  Adds the listener to receive events.

  Parameters:
    `automation` - the automation object that provides the event notification
    `eventID` - the id of the event
    `listener` - the listener
  Throws:
    `SWTError` -
    - ERROR_NULL_ARGUMENT when listener is null
  Since:
    2.0

### addObjectReferences

    protected void addObjectReferences()

  Overrides:
    `addObjectReferences` in class `OleClientSite`

### addPropertyListener

    public void addPropertyListener(int propertyID,
                                    OleListener listener)

  Adds the listener to receive events.

  Parameters:
    `propertyID` - the identifier of the property
    `listener` - the listener
  Throws:
    `SWTError` -
    - ERROR_NULL_ARGUMENT when listener is null

### createCOMInterfaces

    protected void createCOMInterfaces()

  Overrides:
    `createCOMInterfaces` in class `OleClientSite`

### disposeCOMInterfaces

    protected void disposeCOMInterfaces()

  Overrides:
    `disposeCOMInterfaces` in class `OleClientSite`

### getBackground

    public Color getBackground()

  Description copied from class: `Control`
  Returns the receiver's background color.

  Overrides:
    `getBackground` in class `Control`
  Returns:
    the background color

### getFont

    public Font getFont()

  Description copied from class: `Control`
  Returns the font that the receiver will use to paint textual information.

  Overrides:
    `getFont` in class `Control`
  Returns:
    the receiver's font

### getForeground

    public Color getForeground()

  Description copied from class: `Control`
  Returns the foreground color that the receiver will use to draw.

  Overrides:
    `getForeground` in class `Control`
  Returns:
    the receiver's foreground color

### getLicenseInfo

    protected int getLicenseInfo(org.eclipse.swt.internal.ole.win32.GUID clsid)

### getSiteProperty

    public Variant getSiteProperty(int dispId)

  Get the control site property specified by the dispIdMember.

  Since:
    2.1

### GetWindow

    protected int GetWindow(int phwnd)

  Overrides:
    `GetWindow` in class `OleClientSite`

### OnUIDeactivate

    protected int OnUIDeactivate(int fUndoable)

### QueryInterface

    protected int QueryInterface(int riid,
                                 int ppvObject)

  Overrides:
    `QueryInterface` in class `OleClientSite`

### Release

    protected int Release()

  Overrides:
    `Release` in class `OleClientSite`

### releaseObjectInterfaces

    protected void releaseObjectInterfaces()

  Overrides:
    `releaseObjectInterfaces` in class `OleClientSite`

### removeEventListener

    public void removeEventListener(int eventID,
                                    OleListener listener)

  Removes the listener.

  Parameters:
    `eventID` - the event identifier
    `listener` - the listener
  Throws:
    `SWTError` -
    - ERROR_NULL_ARGUMENT when listener is null

### removeEventListener

    public void removeEventListener(OleAutomation automation,
                                    org.eclipse.swt.internal.ole.win32.GUID guid,
                                    int eventID,
                                    OleListener listener)

  Deprecated. - use OleControlSite.removeEventListener(OleAutomation, int, OleListener)

  Removes the listener.

  Parameters:
    `automation` - the automation object that provides the event notification
    `guid` - the identifier of the events COM interface
    `eventID` - the event identifier
    `listener` - the listener
  Throws:
    `SWTError` -
    - ERROR_NULL_ARGUMENT when listener is null
  Since:
    2.0

### removeEventListener

    public void removeEventListener(OleAutomation automation,
                                    int eventID,
                                    OleListener listener)

  Removes the listener.

  Parameters:
    `automation` - the automation object that provides the event notification
    `eventID` - the event identifier
    `listener` - the listener
  Throws:
    `SWTError` -
    - ERROR_NULL_ARGUMENT when listener is null
  Since:
    2.0

### removePropertyListener

    public void removePropertyListener(int propertyID,
                                       OleListener listener)

  Removes the listener.

  Parameters:
    `listener` - the listener
  Throws:
    `SWTError` -
    - ERROR_NULL_ARGUMENT when listener is null

### setBackground

    public void setBackground(Color color)

  Description copied from class: `Control`
  Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.

  Overrides:
    `setBackground` in class `Control`
  Parameters:
    `color` - the new color (or null)

### setFont

    public void setFont(Font font)

  Description copied from class: `Control`
  Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.

  Overrides:
    `setFont` in class `Control`
  Parameters:
    `font` - the new font (or null)

### setForeground

    public void setForeground(Color color)

  Description copied from class: `Control`
  Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.

  Overrides:
    `setForeground` in class `Control`
  Parameters:
    `color` - the new color (or null)

### setSiteProperty

    public void setSiteProperty(int dispId,
                                Variant value)

  Sets the control site property specified by the dispIdMember to a new value. The value will be disposed by the control site when it is no longer required using Variant.dispose. Passing a value of null will clear the dispId value.

  Parameters:
    `dispId` - the ID of the property as specified by the IDL of the ActiveX Control
    `value` - The new value for the property as expressed in a Variant.
  Since:
    2.1

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.