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