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 everyPdfActionfor all documented events for an annotation's additional actions.PdfActiongetOnEnter()Returns thePdfActionfor the OnEnter event if there is any, or null.PdfActiongetOnExit()Returns thePdfActionfor the OnExit event if there is any, or null.PdfActiongetOnFocus()Returns thePdfActionfor the OnFocus event if there is any, or null.PdfActiongetOnLostFocus()Returns thePdfActionfor the OnLostFocus event if there is any, or null.PdfActiongetOnMouseDown()Returns thePdfActionfor the OnMouseDown event if there is any, or null.PdfActiongetOnMouseUp()Returns thePdfActionfor the OnMouseUp event if there is any, or null.PdfActiongetOnPageClosed()Returns thePdfActionfor the OnPageClosed event if there is any, or null.PdfActiongetOnPageLostView()Returns thePdfActionfor the OnPageLostView event if there is any, or null.PdfActiongetOnPageOpened()Returns thePdfActionfor the OnPageOpened event if there is any, or null.PdfActiongetOnPageVisible()Returns thePdfActionfor the OnPageVisible event if there is any, or null.PdfActiongetPdfActionForEvent(PdfName eventName)If exists, returns thePdfActionfor this event, otherwise returns null.protected booleanisWrappedObjectMustBeIndirect()Defines if the object behind this wrapper must be an indirect object in the resultant document.voidsetOnEnter(PdfAction action)Sets thePdfActionto perform on the OnEnter event, or removes it when action is null.voidsetOnExit(PdfAction action)Sets thePdfActionto perform on the OnExit event, or removes it when action is null.voidsetOnFocus(PdfAction action)Sets thePdfActionto perform on the OnFocus event, or removes it when action is null.voidsetOnLostFocus(PdfAction action)Sets thePdfActionto perform on the OnLostFocus event, or removes it when action is null.voidsetOnMouseDown(PdfAction action)Sets thePdfActionto perform on the OnMouseDown event, or removes it when action is null.voidsetOnMouseUp(PdfAction action)Sets thePdfActionto perform on the OnMouseUp event, or removes it when action is null.voidsetOnPageClosed(PdfAction action)Sets thePdfActionto perform on the OnPageClosed event, or removes it when action is null.voidsetOnPageLostView(PdfAction action)Sets thePdfActionto perform on the OnPageLostView event, or removes it when action is null.voidsetOnPageOpened(PdfAction action)Sets thePdfActionto perform on the OnPageOpened event, or removes it when action is null.voidsetOnPageVisible(PdfAction action)Sets thePdfActionto perform on the OnPageVisible event, or removes it when action is null.voidsetPdfActionForEvent(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 thePdfActionfor the OnEnter event if there is any, or null.- Returns:
PdfActionor null
-
setOnEnter
public void setOnEnter(PdfAction action)
Sets thePdfActionto perform on the OnEnter event, or removes it when action is null.- Parameters:
action- ThePdfActionto set or null to remove the action
-
getOnExit
public PdfAction getOnExit()
Returns thePdfActionfor the OnExit event if there is any, or null.- Returns:
PdfActionor null
-
setOnExit
public void setOnExit(PdfAction action)
Sets thePdfActionto perform on the OnExit event, or removes it when action is null.- Parameters:
action-PdfActionThe action to set or null to remove the action
-
getOnMouseDown
public PdfAction getOnMouseDown()
Returns thePdfActionfor the OnMouseDown event if there is any, or null.- Returns:
PdfActionor null
-
setOnMouseDown
public void setOnMouseDown(PdfAction action)
Sets thePdfActionto perform on the OnMouseDown event, or removes it when action is null.- Parameters:
action-PdfActionThe action to set or null to remove the action
-
getOnMouseUp
public PdfAction getOnMouseUp()
Returns thePdfActionfor the OnMouseUp event if there is any, or null.- Returns:
PdfActionor null
-
setOnMouseUp
public void setOnMouseUp(PdfAction action)
Sets thePdfActionto perform on the OnMouseUp event, or removes it when action is null.- Parameters:
action-PdfActionThe action to set or null to remove the action
-
getOnFocus
public PdfAction getOnFocus()
Returns thePdfActionfor the OnFocus event if there is any, or null.- Returns:
PdfActionor null
-
setOnFocus
public void setOnFocus(PdfAction action)
Sets thePdfActionto perform on the OnFocus event, or removes it when action is null.- Parameters:
action-PdfActionThe action to set or null to remove the action
-
getOnLostFocus
public PdfAction getOnLostFocus()
Returns thePdfActionfor the OnLostFocus event if there is any, or null.- Returns:
PdfActionor null
-
setOnLostFocus
public void setOnLostFocus(PdfAction action)
Sets thePdfActionto perform on the OnLostFocus event, or removes it when action is null.- Parameters:
action-PdfActionThe action to set or null to remove the action
-
getOnPageOpened
public PdfAction getOnPageOpened()
Returns thePdfActionfor the OnPageOpened event if there is any, or null.- Returns:
PdfActionor null
-
setOnPageOpened
public void setOnPageOpened(PdfAction action)
Sets thePdfActionto perform on the OnPageOpened event, or removes it when action is null.- Parameters:
action-PdfActionThe action to set or null to remove the action
-
getOnPageClosed
public PdfAction getOnPageClosed()
Returns thePdfActionfor the OnPageClosed event if there is any, or null.- Returns:
PdfActionor null
-
setOnPageClosed
public void setOnPageClosed(PdfAction action)
Sets thePdfActionto perform on the OnPageClosed event, or removes it when action is null.- Parameters:
action-PdfActionThe action to set or null to remove the action
-
getOnPageVisible
public PdfAction getOnPageVisible()
Returns thePdfActionfor the OnPageVisible event if there is any, or null.- Returns:
PdfActionor null
-
setOnPageVisible
public void setOnPageVisible(PdfAction action)
Sets thePdfActionto perform on the OnPageVisible event, or removes it when action is null.- Parameters:
action-PdfActionThe action to set or null to remove the action
-
getOnPageLostView
public PdfAction getOnPageLostView()
Returns thePdfActionfor the OnPageLostView event if there is any, or null.- Returns:
PdfActionor null
-
setOnPageLostView
public void setOnPageLostView(PdfAction action)
Sets thePdfActionto perform on the OnPageLostView event, or removes it when action is null.- Parameters:
action-PdfActionThe action to set or null to remove the action
-
getAllKnownActions
public java.util.List<PdfAction> getAllKnownActions()
Lists everyPdfActionfor 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 thePdfActionfor 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- thePdfActionto 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:
isWrappedObjectMustBeIndirectin classPdfObjectWrapper<PdfDictionary>- Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-
-