2 * Licensed to the Apache Software Foundation (ASF) under one or more
\r
3 * contributor license agreements. See the NOTICE file distributed with
\r
4 * this work for additional information regarding copyright ownership.
\r
5 * The ASF licenses this file to You under the Apache License, Version 2.0
\r
6 * (the "License"); you may not use this file except in compliance with
\r
7 * the License. You may obtain a copy of the License at
\r
9 * http://www.apache.org/licenses/LICENSE-2.0
\r
11 * Unless required by applicable law or agreed to in writing, software
\r
12 * distributed under the License is distributed on an "AS IS" BASIS,
\r
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 * See the License for the specific language governing permissions and
\r
15 * limitations under the License.
\r
17 package org.apache.pdfbox.pdmodel.interactive.action.type;
\r
19 import org.apache.pdfbox.cos.COSBase;
\r
20 import org.apache.pdfbox.cos.COSDictionary;
\r
22 import org.apache.pdfbox.pdmodel.common.COSObjectable;
\r
25 * Launch paramaters for the windows OS.
\r
27 * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
\r
28 * @version $Revision: 1.2 $
\r
30 public class PDWindowsLaunchParams implements COSObjectable
\r
33 * The open operation for the launch.
\r
35 public static final String OPERATION_OPEN = "open";
\r
37 * The print operation for the lanuch.
\r
39 public static final String OPERATION_PRINT = "print";
\r
42 * The params dictionary.
\r
44 protected COSDictionary params;
\r
47 * Default constructor.
\r
49 public PDWindowsLaunchParams()
\r
51 params = new COSDictionary();
\r
57 * @param p The params dictionary.
\r
59 public PDWindowsLaunchParams( COSDictionary p )
\r
65 * Convert this standard java object to a COS object.
\r
67 * @return The cos object that matches this Java object.
\r
69 public COSBase getCOSObject()
\r
75 * Convert this standard java object to a COS object.
\r
77 * @return The cos object that matches this Java object.
\r
79 public COSDictionary getCOSDictionary()
\r
85 * The file to launch.
\r
87 * @return The executable/document to launch.
\r
89 public String getFilename()
\r
91 return params.getString( "F" );
\r
95 * Set the file to launch.
\r
97 * @param file The executable/document to launch.
\r
99 public void setFilename( String file )
\r
101 params.setString( "F", file );
\r
105 * The dir to launch from.
\r
107 * @return The dir of the executable/document to launch.
\r
109 public String getDirectory()
\r
111 return params.getString( "D" );
\r
115 * Set the dir to launch from.
\r
117 * @param dir The dir of the executable/document to launch.
\r
119 public void setDirectory( String dir )
\r
121 params.setString( "D", dir );
\r
125 * Get the operation to perform on the file. This method will not return null,
\r
126 * OPERATION_OPEN is the default.
\r
128 * @return The operation to perform for the file.
\r
129 * @see PDWindowsLaunchParams#OPERATION_OPEN
\r
130 * @see PDWindowsLaunchParams#OPERATION_PRINT
\r
132 public String getOperation()
\r
134 return params.getString( "O", OPERATION_OPEN );
\r
138 * Set the operation to perform..
\r
140 * @param op The operation to perform on the file.
\r
142 public void setOperation( String op )
\r
144 params.setString( "D", op );
\r
148 * A parameter to pass the executable.
\r
150 * @return The parameter to pass the executable.
\r
152 public String getExecuteParam()
\r
154 return params.getString( "P" );
\r
158 * Set the parameter to pass the executable.
\r
160 * @param param The parameter for the executable.
\r
162 public void setExecuteParam( String param )
\r
164 params.setString( "P", param );
\r