com.crionics.jpdf.action
Class LaunchAction

java.lang.Object
  extended by PdfObjectContainer
      extended by com.crionics.jpdf.action.AbstractAction
          extended by com.crionics.jpdf.action.LaunchAction

public class LaunchAction
extends AbstractAction

A launch action launches an application or opens or prints a document.

There are optional entries which allow to include platform-specific parameters for launching a designated application. The current PDF specification only allows parameters for the Windows platform.


Field Summary
static int ATT_ARGUMENTS
          Attribute used to identify the parameters to be passed to the application if the entry ATT_FILENAMEdesignate an application and not a document.
static int ATT_DEFAULTDIR
          Attribute used to identify a parameter as the default directory in standard DOS syntax.
static int ATT_FILENAME
          Attribute used to identify a parameter as the file name of the application to be launched or the document to be opened or printed, in standard Windows pathname format.
static int ATT_OPERATION
          Attribute used to identify the operation to launch.
static java.lang.String OP_OPEN
          Operation specifying that the document should be opened.
static java.lang.String OP_PRINT
          Operation specifying that the document should be printed.
 
Method Summary
static LaunchAction createInstance(PdfDocument doc)
          Allows the creation of a new Action into the Specified document.
 java.lang.String getFilename()
          Returns the application to be launched or the document to be opened or printed.
 java.lang.String getWinAttributes(int attribute)
          Allows to recover Windows specific launch attributes (one of the ATT_... ).
 boolean isDisplayedInNewWindow()
          Determines if the related PDF document should be opened in a new window or not.
 void setDisplayedInNewWindow(boolean flag)
          Allows to specify of the related PDF document should be opened in a new window or not.
 void setFilename(java.lang.String filename)
          Sets the application to be launched or the document to be opened or printed.
 void setWinAttributes(int attribute, java.lang.String value)
          Allows to Sets Windows specific launch attributes (one of the ATT_... ).
 
Methods inherited from class com.crionics.jpdf.action.AbstractAction
getNextAction, hasNextAction, setNextAction
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATT_ARGUMENTS

public static final int ATT_ARGUMENTS
Attribute used to identify the parameters to be passed to the application if the entry ATT_FILENAMEdesignate an application and not a document.


ATT_DEFAULTDIR

public static final int ATT_DEFAULTDIR
Attribute used to identify a parameter as the default directory in standard DOS syntax.


ATT_FILENAME

public static final int ATT_FILENAME
Attribute used to identify a parameter as the file name of the application to be launched or the document to be opened or printed, in standard Windows pathname format. If the name string includes a backslash character (\), the backslash must itself be preceded by a backslash.


ATT_OPERATION

public static final int ATT_OPERATION
Attribute used to identify the operation to launch. When using this attribute used the associated (OP_...) operations.


OP_OPEN

public static final java.lang.String OP_OPEN
Operation specifying that the document should be opened.


OP_PRINT

public static final java.lang.String OP_PRINT
Operation specifying that the document should be printed.

Method Detail

createInstance

public static LaunchAction createInstance(PdfDocument doc)
                                   throws PdfException,
                                          java.io.IOException
Allows the creation of a new Action into the Specified document.

The usage of this method requires the acquision of the Module jPDF Creator or jPDF Template

Parameters:
doc - The Document into which the Action should be created.
Returns:
The action created.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getFilename

public java.lang.String getFilename()
                             throws PdfException,
                                    java.io.IOException
Returns the application to be launched or the document to be opened or printed. This entry may return null if the information is to be recovered via getWinAttributes(int)

Returns:
The filename of the application/document to be launched, opened or printed, or null if specified via getWinAttributes(int).
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getWinAttributes

public java.lang.String getWinAttributes(int attribute)
                                  throws PdfException,
                                         java.io.IOException
Allows to recover Windows specific launch attributes (one of the ATT_... ).

Parameters:
attribute - The attribute to recover (one of the ATT_... ).
Returns:
A string containing the attibute (see the description of one of the ATT_... parameters), or null if the attribute is not set.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

isDisplayedInNewWindow

public boolean isDisplayedInNewWindow()
                               throws PdfException,
                                      java.io.IOException
Determines if the related PDF document should be opened in a new window or not. This value is meaningless if this action is not related to a PDF document, but to an application.

Returns:
true if the document will be Opened in a new window, false otherwise.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setDisplayedInNewWindow

public void setDisplayedInNewWindow(boolean flag)
                             throws PdfException,
                                    java.io.IOException
Allows to specify of the related PDF document should be opened in a new window or not. This value is meaningless if this action is not related to a PDF document, but to an application.

Parameters:
flag - true to open the document in a new window, false otherwise.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setFilename

public void setFilename(java.lang.String filename)
                 throws PdfException,
                        java.io.IOException
Sets the application to be launched or the document to be opened or printed.

Parameters:
filename - The filename of the application/document to be launched, opened or printed.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setWinAttributes

public void setWinAttributes(int attribute,
                             java.lang.String value)
                      throws PdfException,
                             java.io.IOException
Allows to Sets Windows specific launch attributes (one of the ATT_... ). Note that apart from the ATT_FILENAMEattribute which is required, all the others are optionals.

Parameters:
attribute - The attribute to set (one of the ATT_... ).
value - A string containing the attibute value to set (see the description of one of the ATT_... parameters), or null
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.


Copyright © 1999-2007 Crionics. All Rights Reserved.