Package com.adobe.xfa
Class EventPseudoModel
java.lang.Object
com.adobe.xfa.Obj
com.adobe.xfa.PseudoModel
com.adobe.xfa.EventPseudoModel
- All Implemented Interfaces:
Peer
EventPseudoModel describes the state of an event that is being fired.
Instances are available to scripts as the
$event object.
Users of this class will not typically create instances of this class
directly, but will query the AppModel to find the existing
instance of the "$event" object.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEncapsulates the state of EventPseudoModel. -
Field Summary
Fields inherited from interface com.adobe.xfa.ut.Peer
ATTR_CHANGED, CHILD_ADDED, CHILD_REMOVED, DESCENDENT_ADDED, DESCENDENT_ATTR_CHANGED, DESCENDENT_REMOVED, DESCENDENT_VALUE_CHANGED, PARENT_CHANGED, PERMS_LOCK_CLEARED, PERMS_LOCK_SET, PROTO_ATTR_CHANGED, PROTO_CHILD_ADDED, PROTO_CHILD_REMOVED, PROTO_DESCENDENT_ADDED, PROTO_DESCENDENT_ATTR_CHANGED, PROTO_DESCENDENT_REMOVED, PROTO_DESCENDENT_VALUE_CHANGED, PROTO_VALUE_CHANGED, UPDATED, VALUE_CHANGED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancancelAction(String sAction) Determines whether the specified action has been canceled.booleancancelEvent(String sEvent) Determines whether the specified event has been canceled.voidemit()Fires the event defined by the current event state.booleanDetermines whether the current action event has been canceled.Returns the name of the canceled action.Returns the text typed or pasted into the field.Returns the atomic name of this element's class.Gets the name of this object's class.intReturns how a form field was committed.Returns the current event state object.Returns the full (untruncated) value of the field.booleanReturns whether the arrow key was used to make the selection.booleanReturns whether the modifier key is down during the event.intgetName()Returns the code that identifies the current event.Returns the name of the event as a String.Returns the contentType after the field change.Returns the value after the field change.Returns the contentType of prevText.Returns the value before the field changes.booleanReturns whether this event is happening immediately after the user committed this field.intReturns the end position of the current text selection during a change event.intReturns the start position of the current text selection during a change event.booleangetShift()Returns whether the shift key is down during the event.Returns the SOAP faultcode returned from executing a Web Service connection.Returns the SOAP faultstring returned from executing a Web Service connection.Returns the target object that triggered the event.booleanvoidreset()Resets the event state to all-empty values.voidsendMessenge(ExFull error, int eSeverity) Send message to host so it can be loggedvoidsetCancelAction(boolean bCancelAction, String sSource) voidSets the text typed or pasted into the field.voidsetCommitKey(int nCommitKey) Sets how a form field value was committed.voidsetEventInfo(EventPseudoModel.EventInfo eventInfo) Sets the event state to the state contained within an EventInfo object.voidsetFullText(String sFullText) Sets the full (untruncated) value of the field.voidsetKeyDown(boolean bKeyDown) Sets whether the arrow key was used to make the selection.voidsetModifier(boolean bModifier) Sets whether the modifier key is down during the event.voidsetName(int eName) Sets the code that identifies the current event.voidSets the name of the event using a String.voidsetNewContentType(String sNewContentType) Sets the contentType after the field change.voidsetNewText(String sNewText) Sets the value after the field change.voidsetPrevContentType(String sPrevContentType) Sets the contentType of prevText.voidsetPrevText(String sPrevText) Sets the value before the field changes.voidsetReenter(boolean bReenter) Sets whether this event is happening immediately after the user committed this field.voidsetSelEnd(int nSelEnd) Sets the end position of the current text selection during a change event.voidsetSelStart(int nSelStart) Sets the start position of the current text selection during a change event.voidsetShift(boolean bShift) Sets whether the shift key is down during the event.voidsetSOAPFaultCode(String sSOAPFaultCode) Sets the SOAP faultcode returned from executing a Web Service connection.voidsetSOAPFaultString(String sSOAPFaultString) Sets the SOAP faultstring returned from executing a Web Service connection.voidSets the target object that triggered the event.booleanvalidateUsage(int nVersion, int nAvailability, boolean bUpdateVersion) Validate if the given Version and Availability flags are valid for the current documentbooleanvalidateUsageFailedIsFatal(int nVersion, int nAvailability) Determines if disallowing a version should be considered a fatal error.Methods inherited from class com.adobe.xfa.PseudoModel
getAliasObject, getEventTableMethods inherited from class com.adobe.xfa.Obj
addPeer, addPeeredNode, clearPeers, deafen, getClassTag, getPeer, getScriptMethodInfo, getScriptProperty, getScriptThis, invokeFunction, isDeaf, isMute, isSameClass, isSameClass, isSameClass, mute, notifyPeers, peerRemoved, removePeer, removePeeredNode, setClass, setClassTag, setScriptProperty, unDeafen, unMute, updateFromPeer
-
Constructor Details
-
EventPseudoModel
-
-
Method Details
-
getPrevText
Returns the value before the field changes.- Returns:
- the value before the field changes.
-
setPrevText
Sets the value before the field changes.- Parameters:
sPrevText- the value before the field changes.
-
getPrevContentType
Returns the contentType of prevText. For example, if prevContentType="text/html", then prevText will contain an XHTML fragment.- Returns:
- the contentType of prevText.
-
setPrevContentType
Sets the contentType of prevText.- Parameters:
sPrevContentType- the contentType of prevText.
-
getChange
Returns the text typed or pasted into the field.- Returns:
- the text typed or pasted into the field.
-
setChange
Sets the text typed or pasted into the field.- Parameters:
sChange- the text typed or pasted into the field.
-
getNewText
Returns the value after the field change.- Returns:
- the value after the field change.
-
setNewText
Sets the value after the field change.- Parameters:
sNewText- the value after the field change.
-
getNewContentType
Returns the contentType after the field change.- Returns:
- the contentType after the field change.
-
setNewContentType
Sets the contentType after the field change.- Parameters:
sNewContentType- the contentType after the field change.
-
getFullText
Returns the full (untruncated) value of the field. If the user pastes into a field, the field may truncate the pasted text. Content type is determined by $event.newContentType.- Returns:
- the full (untruncated) value of the field.
-
setFullText
Sets the full (untruncated) value of the field. If the user pastes into a field, the field may truncate the pasted text. Content type is determined by $event.newContentType.- Parameters:
sFullText- the full (untruncated) value of the field.
-
getCommitKey
public int getCommitKey()Returns how a form field was committed.- Returns:
- how a form field was committed.
-
setCommitKey
public void setCommitKey(int nCommitKey) Sets how a form field value was committed.- Parameters:
nCommitKey- how a form field was committed.
-
getKeyDown
public boolean getKeyDown()Returns whether the arrow key was used to make the selection. Available only for listbox and combobox.- Returns:
trueif the arrow key was used to make the selection.
-
setKeyDown
public void setKeyDown(boolean bKeyDown) Sets whether the arrow key was used to make the selection. Available only for listbox and combobox.- Parameters:
bKeyDown-trueif the arrow key was used to make the selection.
-
getModifier
public boolean getModifier()Returns whether the modifier key is down during the event. For the Microsoft Windows platform, the modifier key is CTRL.- Returns:
trueif the modifier key is down during the event.
-
setModifier
public void setModifier(boolean bModifier) Sets whether the modifier key is down during the event. For the Microsoft Windows platform, the modifier key is CTRL.- Parameters:
bModifier-trueif the modifier key is down during the event.
-
getName
public int getName()Returns the code that identifies the current event. The code must be one of the ScriptHandler.ACTIVITY_* values.- Returns:
- the code that identifies the current event.
- See Also:
-
setName
public void setName(int eName) Sets the code that identifies the current event. The code must be one of the ScriptHandler.ACTIVITY_* values.- Parameters:
eName- a code that defines the current event.- See Also:
-
getNameAsString
Returns the name of the event as a String.- Returns:
- the name of the event as a String.
-
setName
Sets the name of the event using a String.- Parameters:
sName- the name of the event.
-
getSelEnd
public int getSelEnd()Returns the end position of the current text selection during a change event.- Returns:
- the end position of the current text selection.
-
setSelEnd
public void setSelEnd(int nSelEnd) Sets the end position of the current text selection during a change event.- Parameters:
nSelEnd- the end position of the current text selection.
-
getSelStart
public int getSelStart()Returns the start position of the current text selection during a change event.- Returns:
- the start position of the current text selection.
-
setSelStart
public void setSelStart(int nSelStart) Sets the start position of the current text selection during a change event.- Parameters:
nSelStart- the start position of the current text selection during a change event.
-
getShift
public boolean getShift()Returns whether the shift key is down during the event.- Returns:
trueif the shift key is down during the event.
-
setShift
public void setShift(boolean bShift) Sets whether the shift key is down during the event.- Parameters:
bShift-trueif the shift key is down during the event.
-
getTarget
Returns the target object that triggered the event.- Returns:
- the target object that triggered the event.
-
setTarget
Sets the target object that triggered the event.- Parameters:
target- the target object that triggered the event.
-
getSOAPFaultCode
Returns the SOAP faultcode returned from executing a Web Service connection.- Returns:
- the SOAP faultcode returned from executing a Weg Service connection.
-
setSOAPFaultCode
Sets the SOAP faultcode returned from executing a Web Service connection.- Parameters:
sSOAPFaultCode- the SOAP faultCode.
-
getSOAPFaultString
Returns the SOAP faultstring returned from executing a Web Service connection.- Returns:
- the SOAP faultstring returned from executing a Web Service connection.
-
setSOAPFaultString
Sets the SOAP faultstring returned from executing a Web Service connection.- Parameters:
sSOAPFaultString- the SOAP faultstring returned from executing a Web Service connection.
-
getReenter
public boolean getReenter()Returns whether this event is happening immediately after the user committed this field.- Returns:
trueif this enter event is happening immediately after the user committed this field.
-
setReenter
public void setReenter(boolean bReenter) Sets whether this event is happening immediately after the user committed this field. Available only during the 'enter' event.- Parameters:
bReenter-trueif this enter event is happening immediately after the user committed this field.
-
getCancelAction
public boolean getCancelAction()Determines whether the current action event has been canceled.- Returns:
trueif the current action event has been canceled.
-
getCanceledAction
Returns the name of the canceled action.- Returns:
- the name of the canceled action.
-
setCancelAction
-
setEventInfo
Sets the event state to the state contained within an EventInfo object.- Parameters:
eventInfo- the new state
-
getEventInfo
Returns the current event state object.- Returns:
- an EventInfo object that represents the state of the current event.
-
reset
public void reset()Resets the event state to all-empty values. -
emit
public void emit()Fires the event defined by the current event state. The caller must ensure that the event's name, target and any other properties defined for that event are set before calling this method. -
cancelAction
Determines whether the specified action has been canceled. If the action was canceled, this method as the side effect of setting the name of the canceled action.- Parameters:
sAction- the name of the action. Must be one of: execute, open, print, sign or submit.- See Also:
-
cancelEvent
Determines whether the specified event has been canceled.- Parameters:
sEvent- the name of the event- Returns:
trueif the event should be executed.
-
isAction
-
getClassAtom
Description copied from class:ObjReturns the atomic name of this element's class.- Overrides:
getClassAtomin classObj- Returns:
- the class name as an interned string.
-
getClassName
Description copied from class:ObjGets the name of this object's class. Overriden by derived classes such as Element that have a local name that may be returned instead.- Overrides:
getClassNamein classPseudoModel- Returns:
- the class name.
-
getScriptTable
- Overrides:
getScriptTablein classPseudoModel
-
sendMessenge
Description copied from class:ObjSend message to host so it can be logged- Overrides:
sendMessengein classObj- Parameters:
error- contains message Id and texteSeverity- the message severity- See Also:
-
validateUsage
public boolean validateUsage(int nVersion, int nAvailability, boolean bUpdateVersion) Description copied from class:ObjValidate if the given Version and Availability flags are valid for the current document- Overrides:
validateUsagein classObj- Parameters:
nVersion- The target XFA VersionnAvailability- The target Availability flags, this indicates for what clients the script is availablebUpdateVersion- indicates if the model version can be updated by the calling code- Returns:
- if true, Version and Availability flags are valid
- See Also:
-
validateUsageFailedIsFatal
public boolean validateUsageFailedIsFatal(int nVersion, int nAvailability) Description copied from class:ObjDetermines if disallowing a version should be considered a fatal error.This method is called after calling
Obj.validateUsage(int, int, boolean)when that method returns false.- Overrides:
validateUsageFailedIsFatalin classObj- Parameters:
nVersion- The target XFA VersionnAvailability- The target Availability flags, this indicates for what clients the script is available- Returns:
- true if disallowing nVersion should be considered a fatal error
- See Also:
-