public Node getJobNode(Node arg0, boolean savePasswords) throws SaveJobException {
try {
if (arg0 != null) {
PdfSelectionTableItem[] items = selectionPanel.getTableRows();
if (items != null && items.length > 0) {
Element firstNode = ((Element) arg0).addElement("first");
firstNode.addAttribute("value", items[0].getInputFile().getAbsolutePath());
if (savePasswords) {
firstNode.addAttribute("password", items[0].getPassword());
}
Element secondNode = ((Element) arg0).addElement("second");
if (items.length > 1) {
secondNode.addAttribute("value", items[1].getInputFile().getAbsolutePath());
if (savePasswords) {
secondNode.addAttribute("password", items[1].getPassword());
}
}
}
Element fileDestination = ((Element) arg0).addElement("destination");
fileDestination.addAttribute("value", destinationTextField.getText());
Element stepDestination = ((Element) arg0).addElement("step");
stepDestination.addAttribute("value", stepTextField.getText());
Element secondStepDestination = ((Element) arg0).addElement("secondstep");
secondStepDestination.addAttribute("value", secondStepTextField.getText());
Element reverseFirst = ((Element) arg0).addElement("reverse_first");
reverseFirst.addAttribute("value", reverseFirstCheckbox.isSelected() ? TRUE : FALSE);
Element reverseSecond = ((Element) arg0).addElement("reverse_second");
reverseSecond.addAttribute("value", reverseSecondCheckbox.isSelected() ? TRUE : FALSE);
Element fileOverwrite = ((Element) arg0).addElement("overwrite");
fileOverwrite.addAttribute("value", overwriteCheckbox.isSelected() ? TRUE : FALSE);
Element fileCompress = ((Element) arg0).addElement("compressed");
fileCompress.addAttribute("value", outputCompressedCheck.isSelected() ? TRUE : FALSE);
Element pdfVersion = ((Element) arg0).addElement("pdfversion");
pdfVersion.addAttribute("value", ((StringItem) versionCombo.getSelectedItem()).getId());
}
return arg0;
} catch (Exception ex) {
throw new SaveJobException(ex);
}