Package com.itextpdf.kernel.pdf.action
Class PdfAnnotationAdditionalActions
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
-
- com.itextpdf.kernel.pdf.action.PdfAnnotationAdditionalActions
-
public class PdfAnnotationAdditionalActions extends PdfObjectWrapper<PdfDictionary>
A wrapper for annotations additional actions dictionaries. See section 12.6.3 Table 197 of ISO 32000-1. An annotation additional actions dictionary defines the event handlers for annotations
-
-
Constructor Summary
Constructors Constructor Description PdfAnnotationAdditionalActions(PdfDictionary pdfObject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<PdfAction>
getAllKnownActions()
Lists everyPdfAction
for all documented events for an annotation's additional actions.PdfAction
getOnEnter()
Returns thePdfAction
for the OnEnter event if there is any, or null.PdfAction
getOnExit()
Returns thePdfAction
for the OnExit event if there is any, or null.PdfAction
getOnFocus()
Returns thePdfAction
for the OnFocus event if there is any, or null.PdfAction
getOnLostFocus()
Returns thePdfAction
for the OnLostFocus event if there is any, or null.PdfAction
getOnMouseDown()
Returns thePdfAction
for the OnMouseDown event if there is any, or null.PdfAction
getOnMouseUp()
Returns thePdfAction
for the OnMouseUp event if there is any, or null.PdfAction
getOnPageClosed()
Returns thePdfAction
for the OnPageClosed event if there is any, or null.PdfAction
getOnPageLostView()
Returns thePdfAction
for the OnPageLostView event if there is any, or null.PdfAction
getOnPageOpened()
Returns thePdfAction
for the OnPageOpened event if there is any, or null.PdfAction
getOnPageVisible()
Returns thePdfAction
for the OnPageVisible event if there is any, or null.PdfAction
getPdfActionForEvent(PdfName eventName)
If exists, returns thePdfAction
for this event, otherwise returns null.protected boolean
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.void
setOnEnter(PdfAction action)
Sets thePdfAction
to perform on the OnEnter event, or removes it when action is null.void
setOnExit(PdfAction action)
Sets thePdfAction
to perform on the OnExit event, or removes it when action is null.void
setOnFocus(PdfAction action)
Sets thePdfAction
to perform on the OnFocus event, or removes it when action is null.void
setOnLostFocus(PdfAction action)
Sets thePdfAction
to perform on the OnLostFocus event, or removes it when action is null.void
setOnMouseDown(PdfAction action)
Sets thePdfAction
to perform on the OnMouseDown event, or removes it when action is null.void
setOnMouseUp(PdfAction action)
Sets thePdfAction
to perform on the OnMouseUp event, or removes it when action is null.void
setOnPageClosed(PdfAction action)
Sets thePdfAction
to perform on the OnPageClosed event, or removes it when action is null.void
setOnPageLostView(PdfAction action)
Sets thePdfAction
to perform on the OnPageLostView event, or removes it when action is null.void
setOnPageOpened(PdfAction action)
Sets thePdfAction
to perform on the OnPageOpened event, or removes it when action is null.void
setOnPageVisible(PdfAction action)
Sets thePdfAction
to perform on the OnPageVisible event, or removes it when action is null.void
setPdfActionForEvent(PdfName event, PdfAction action)
Sets the action for an event, or removes it when the action is null.-
Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
-
-
-
Field Detail
-
Events
private static final PdfName[] Events
-
-
Constructor Detail
-
PdfAnnotationAdditionalActions
public PdfAnnotationAdditionalActions(PdfDictionary pdfObject)
-
-
Method Detail
-
getOnEnter
public PdfAction getOnEnter()
Returns thePdfAction
for the OnEnter event if there is any, or null.- Returns:
PdfAction
or null
-
setOnEnter
public void setOnEnter(PdfAction action)
Sets thePdfAction
to perform on the OnEnter event, or removes it when action is null.- Parameters:
action
- ThePdfAction
to set or null to remove the action
-
getOnExit
public PdfAction getOnExit()
Returns thePdfAction
for the OnExit event if there is any, or null.- Returns:
PdfAction
or null
-
setOnExit
public void setOnExit(PdfAction action)
Sets thePdfAction
to perform on the OnExit event, or removes it when action is null.- Parameters:
action
-PdfAction
The action to set or null to remove the action
-
getOnMouseDown
public PdfAction getOnMouseDown()
Returns thePdfAction
for the OnMouseDown event if there is any, or null.- Returns:
PdfAction
or null
-
setOnMouseDown
public void setOnMouseDown(PdfAction action)
Sets thePdfAction
to perform on the OnMouseDown event, or removes it when action is null.- Parameters:
action
-PdfAction
The action to set or null to remove the action
-
getOnMouseUp
public PdfAction getOnMouseUp()
Returns thePdfAction
for the OnMouseUp event if there is any, or null.- Returns:
PdfAction
or null
-
setOnMouseUp
public void setOnMouseUp(PdfAction action)
Sets thePdfAction
to perform on the OnMouseUp event, or removes it when action is null.- Parameters:
action
-PdfAction
The action to set or null to remove the action
-
getOnFocus
public PdfAction getOnFocus()
Returns thePdfAction
for the OnFocus event if there is any, or null.- Returns:
PdfAction
or null
-
setOnFocus
public void setOnFocus(PdfAction action)
Sets thePdfAction
to perform on the OnFocus event, or removes it when action is null.- Parameters:
action
-PdfAction
The action to set or null to remove the action
-
getOnLostFocus
public PdfAction getOnLostFocus()
Returns thePdfAction
for the OnLostFocus event if there is any, or null.- Returns:
PdfAction
or null
-
setOnLostFocus
public void setOnLostFocus(PdfAction action)
Sets thePdfAction
to perform on the OnLostFocus event, or removes it when action is null.- Parameters:
action
-PdfAction
The action to set or null to remove the action
-
getOnPageOpened
public PdfAction getOnPageOpened()
Returns thePdfAction
for the OnPageOpened event if there is any, or null.- Returns:
PdfAction
or null
-
setOnPageOpened
public void setOnPageOpened(PdfAction action)
Sets thePdfAction
to perform on the OnPageOpened event, or removes it when action is null.- Parameters:
action
-PdfAction
The action to set or null to remove the action
-
getOnPageClosed
public PdfAction getOnPageClosed()
Returns thePdfAction
for the OnPageClosed event if there is any, or null.- Returns:
PdfAction
or null
-
setOnPageClosed
public void setOnPageClosed(PdfAction action)
Sets thePdfAction
to perform on the OnPageClosed event, or removes it when action is null.- Parameters:
action
-PdfAction
The action to set or null to remove the action
-
getOnPageVisible
public PdfAction getOnPageVisible()
Returns thePdfAction
for the OnPageVisible event if there is any, or null.- Returns:
PdfAction
or null
-
setOnPageVisible
public void setOnPageVisible(PdfAction action)
Sets thePdfAction
to perform on the OnPageVisible event, or removes it when action is null.- Parameters:
action
-PdfAction
The action to set or null to remove the action
-
getOnPageLostView
public PdfAction getOnPageLostView()
Returns thePdfAction
for the OnPageLostView event if there is any, or null.- Returns:
PdfAction
or null
-
setOnPageLostView
public void setOnPageLostView(PdfAction action)
Sets thePdfAction
to perform on the OnPageLostView event, or removes it when action is null.- Parameters:
action
-PdfAction
The action to set or null to remove the action
-
getAllKnownActions
public java.util.List<PdfAction> getAllKnownActions()
Lists everyPdfAction
for all documented events for an annotation's additional actions. See section 12.6.3 Table 197 of ISO 32000-1- Returns:
- The list of actions
-
getPdfActionForEvent
public PdfAction getPdfActionForEvent(PdfName eventName)
If exists, returns thePdfAction
for this event, otherwise returns null.
-
setPdfActionForEvent
public void setPdfActionForEvent(PdfName event, PdfAction action)
Sets the action for an event, or removes it when the action is null.- Parameters:
event
- the event to set or remove the action foraction
- thePdfAction
to set or null
-
isWrappedObjectMustBeIndirect
protected boolean isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.
If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.
Return value of this method shouldn't depend on any logic, it should return always true or false.- Specified by:
isWrappedObjectMustBeIndirect
in classPdfObjectWrapper<PdfDictionary>
- Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-
-