|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jacob.com.JacobObject
com.jacob.com.Dispatch
com.jacob.activeX.ActiveXComponent
public class ActiveXComponent
This class provides a higher level, more object like, wrapper for top of the Dispatch object. The Dispatch class's method essentially directly map to Microsoft C API including the first parameter that is almost always the target of the message. ActiveXComponent assumes the target of every message is the MS COM object behind the ActiveXComponent. This removes the need to pass the Dispatch object into every method.
It is really up to the developer as to whether they want to use the Dispatch interface or the ActiveXComponent interface.
This class simulates com.ms.activeX.ActiveXComponent only in the sense that it is used for creating Dispatch objects
Field Summary | |
---|---|
static boolean |
shouldLogEvents
This boolean determines if callback events should be logged |
Fields inherited from class com.jacob.com.Dispatch |
---|
fdexNameCaseSensitive, Get, LOCALE_SYSTEM_DEFAULT, m_pDispatch, Method, Put, PutRef |
Constructor Summary | |
---|---|
ActiveXComponent(Dispatch dispatchToBeWrapped)
Creates an active X component that is built on top of the COM pointers held in the passed in dispatch. |
|
ActiveXComponent(String programId)
Normally used to create a new connection to a microsoft application. |
Method Summary | |
---|---|
static ActiveXComponent |
connectToActiveInstance(String pRequestedProgramId)
Most code should use the standard ActiveXComponent(String) constructor and not this factory method. |
static ActiveXComponent |
createNewInstance(String pRequestedProgramId)
Most code should use the standard ActiveXComponent(String) contructor and not this factory method. |
protected void |
finalize()
|
Dispatch |
getObject()
Probably was a cover for something else in the past. |
Variant |
getProperty(String propertyName)
retrieves a property and returns it as a Variant |
boolean |
getPropertyAsBoolean(String propertyName)
retrieves a property and returns it as a Boolean |
byte |
getPropertyAsByte(String propertyName)
retrieves a property and returns it as a byte |
ActiveXComponent |
getPropertyAsComponent(String propertyName)
retrieves a property and returns it as an ActiveX component |
int |
getPropertyAsInt(String propertyName)
retrieves a property and returns it as a int |
String |
getPropertyAsString(String propertyName)
retrieves a property and returns it as a String |
Variant |
invoke(String callAction)
makes a dispatch call for the passed in action and no parameter |
Variant |
invoke(String actionCommand,
boolean parameter)
makes a dispatch call to the passed in action with a single boolean parameter |
Variant |
invoke(String actionCommand,
int parameter)
makes a dispatch call to the passed in action with a single int parameter |
Variant |
invoke(String actionCommand,
int parameter1,
int parameter2)
makes a dispatch call to the passed in action with two integer parameters (this was put in for some application) |
Variant |
invoke(String actionCommand,
String parameter)
invokes a single parameter call on this dispatch that returns no value |
Variant |
invoke(String actionCommand,
String parameter1,
int parameter2)
makes a dispatch call to the passed in action with a string and integer parameter (this was put in for some application) |
Variant |
invoke(String callAction,
Variant parameter)
makes a dispatch call for the passed in action and single parameter |
Variant |
invoke(String name,
Variant[] args)
This is really a cover for call(String,Variant[]) that should be eliminated call with a variable number of args mainly used for quit. |
Variant |
invoke(String callAction,
Variant parameter1,
Variant parameter2)
makes a dispatch call for the passed in action and two parameter |
Variant |
invoke(String callAction,
Variant parameter1,
Variant parameter2,
Variant parameter3)
makes a dispatch call for the passed in action and two parameter |
Variant |
invoke(String callAction,
Variant parameter1,
Variant parameter2,
Variant parameter3,
Variant parameter4)
calls call() with 4 variant parameters |
ActiveXComponent |
invokeGetComponent(String callAction)
makes a dispatch call for the passed in action and no parameter |
ActiveXComponent |
invokeGetComponent(String callAction,
Variant parameter)
makes a dispatch call for the passed in action and single parameter |
ActiveXComponent |
invokeGetComponent(String callAction,
Variant parameter1,
Variant parameter2)
makes a dispatch call for the passed in action and single parameter |
ActiveXComponent |
invokeGetComponent(String callAction,
Variant parameter1,
Variant parameter2,
Variant parameter3)
makes a dispatch call for the passed in action and single parameter |
ActiveXComponent |
invokeGetComponent(String callAction,
Variant parameter1,
Variant parameter2,
Variant parameter3,
Variant parameter4)
makes a dispatch call for the passed in action and single parameter |
void |
logCallbackEvent(String description,
Variant[] args)
used by the doc and application listeners to get intelligent logging |
void |
setProperty(String propertyName,
boolean propValue)
sets a property as a boolean value |
void |
setProperty(String propertyName,
byte propValue)
sets a property as a boolean value |
void |
setProperty(String propertyName,
Dispatch arg)
sets a property on this object |
void |
setProperty(String propertyName,
int propValue)
sets the property as an int value |
void |
setProperty(String propertyName,
String propertyValue)
sets a property to be the value of the string |
void |
setProperty(String propertyName,
Variant arg)
sets a property on this object |
Methods inherited from class com.jacob.com.Dispatch |
---|
call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, callN_CaseSensitive, callN, callN, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSubN, callSubN, coCreateInstance, get_CaseSensitive, get, get, getActiveInstance, getIDOfName, getIDsOfNames, getIDsOfNames, getProgramId, invoke, invoke, invoke, invokeSub, invokeSub, invokeSub, invokeSubv, invokeSubv, invokeSubv, invokev, invokev, invokev, invokev, isAttached, put_Casesensitive, put, put, putRef, putRef, QueryInterface, safeRelease |
Methods inherited from class com.jacob.com.JacobObject |
---|
debug, getBuildDate, getBuildVersion, isDebugEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean shouldLogEvents
Constructor Detail |
---|
public ActiveXComponent(String programId)
This constructor causes a new Windows object of the requested type to be created. The windows CoCreate() function gets called to create the underlying windows object.
new ActiveXComponent("ScriptControl");
programId
- public ActiveXComponent(Dispatch dispatchToBeWrapped)
dispatchToBeWrapped
- Method Detail |
---|
public Dispatch getObject()
public static ActiveXComponent createNewInstance(String pRequestedProgramId)
Factory that returns a Dispatch object wrapped around the result of a CoCreate() call. This differs from the standard constructor in that it throws no exceptions and returns null on failure.
This will fail for any prog id with a ":" in it.
pRequestedProgramId
-
public static ActiveXComponent connectToActiveInstance(String pRequestedProgramId)
Factory that returns a Dispatch wrapped around the result of a getActiveObject() call. This differs from the standard constructor in that it throws no exceptions and returns null on failure.
This will fail for any prog id with a ":" in it
pRequestedProgramId
-
protected void finalize()
finalize
in class Dispatch
Dispatch.finalize()
public Variant getProperty(String propertyName)
propertyName
-
public ActiveXComponent getPropertyAsComponent(String propertyName)
propertyName
-
public boolean getPropertyAsBoolean(String propertyName)
propertyName
- property we are looking up
public byte getPropertyAsByte(String propertyName)
propertyName
- property we are looking up
public String getPropertyAsString(String propertyName)
propertyName
-
public int getPropertyAsInt(String propertyName)
propertyName
-
public void setProperty(String propertyName, Variant arg)
propertyName
- property namearg
- variant value to be setpublic void setProperty(String propertyName, Dispatch arg)
propertyName
- property namearg
- variant value to be setpublic void setProperty(String propertyName, String propertyValue)
propertyName
- propertyValue
- public void setProperty(String propertyName, boolean propValue)
propertyName
- propValue
- the boolean value we want the prop set topublic void setProperty(String propertyName, byte propValue)
propertyName
- propValue
- the boolean value we want the prop set topublic void setProperty(String propertyName, int propValue)
propertyName
- propValue
- the int value we want the prop to be set to.public void logCallbackEvent(String description, Variant[] args)
description
- event descriptionargs
- args passed in (variants)public ActiveXComponent invokeGetComponent(String callAction)
callAction
-
public ActiveXComponent invokeGetComponent(String callAction, Variant parameter)
callAction
- parameter
-
public ActiveXComponent invokeGetComponent(String callAction, Variant parameter1, Variant parameter2)
callAction
- parameter1
- parameter2
-
public ActiveXComponent invokeGetComponent(String callAction, Variant parameter1, Variant parameter2, Variant parameter3)
callAction
- parameter1
- parameter2
- parameter3
-
public ActiveXComponent invokeGetComponent(String callAction, Variant parameter1, Variant parameter2, Variant parameter3, Variant parameter4)
callAction
- parameter1
- parameter2
- parameter3
- parameter4
-
public Variant invoke(String actionCommand, String parameter)
actionCommand
- parameter
-
public Variant invoke(String actionCommand, boolean parameter)
actionCommand
- parameter
-
public Variant invoke(String actionCommand, int parameter)
actionCommand
- parameter
-
public Variant invoke(String actionCommand, String parameter1, int parameter2)
actionCommand
- parameter1
- parameter2
-
public Variant invoke(String actionCommand, int parameter1, int parameter2)
actionCommand
- parameter1
- parameter2
-
public Variant invoke(String callAction, Variant parameter)
callAction
- parameter
-
public Variant invoke(String callAction, Variant parameter1, Variant parameter2)
callAction
- parameter1
- parameter2
-
public Variant invoke(String callAction, Variant parameter1, Variant parameter2, Variant parameter3)
callAction
- parameter1
- parameter2
- parameter3
-
public Variant invoke(String callAction, Variant parameter1, Variant parameter2, Variant parameter3, Variant parameter4)
callAction
- parameter1
- parameter2
- parameter3
- parameter4
-
public Variant invoke(String callAction)
callAction
-
public Variant invoke(String name, Variant[] args)
name
- args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |