1 31 package org.pdfbox.pdmodel.interactive.action.type; 32 33 import java.io.IOException ; 34 35 import org.pdfbox.cos.COSDictionary; 36 37 import org.pdfbox.pdmodel.common.filespecification.PDFileSpecification; 38 39 46 public class PDActionLaunch extends PDAction 47 { 48 49 52 public static final String SUB_TYPE = "Launch"; 53 54 57 public PDActionLaunch() 58 { 59 super(); 60 setSubType( SUB_TYPE ); 61 } 62 63 68 public PDActionLaunch( COSDictionary a ) 69 { 70 super( a ); 71 } 72 73 84 public PDFileSpecification getFile() throws IOException 85 { 86 return PDFileSpecification.createFS( getCOSDictionary().getDictionaryObject( "F" ) ); 87 } 88 89 98 public void setFile( PDFileSpecification fs ) 99 { 100 getCOSDictionary().setItem( "F", fs ); 101 } 102 103 108 public PDWindowsLaunchParams getWinLaunchParams() 109 { 110 COSDictionary win = (COSDictionary)action.getDictionaryObject( "Win" ); 111 PDWindowsLaunchParams retval = null; 112 if( win != null ) 113 { 114 retval = new PDWindowsLaunchParams( win ); 115 } 116 return retval; 117 } 118 119 124 public void setWinLaunchParams( PDWindowsLaunchParams win ) 125 { 126 action.setItem( "Win", win ); 127 } 128 129 137 public String getF() 138 { 139 return action.getString( "F" ); 140 } 141 142 150 public void setF( String f ) 151 { 152 action.setString( "F", f ); 153 } 154 155 160 public String getD() 161 { 162 return action.getString( "D" ); 163 } 164 165 170 public void setD( String d ) 171 { 172 action.setString( "D", d ); 173 } 174 175 184 public String getO() 185 { 186 return action.getString( "O" ); 187 } 188 189 198 public void setO( String o ) 199 { 200 action.setString( "O", o ); 201 } 202 203 209 public String getP() 210 { 211 return action.getString( "P" ); 212 } 213 214 220 public void setP( String p ) 221 { 222 action.setString( "P", p ); 223 } 224 225 234 public boolean shouldOpenInNewWindow() 235 { 236 return action.getBoolean( "NewWindow", true ); 237 } 238 239 244 public void setOpenInNewWindow( boolean value ) 245 { 246 action.setBoolean( "NewWindow", value ); 247 } 248 } | Popular Tags |