+ GettextResource.gettext(config.getI18nResourceBundle(), "Split by bookmarks level")
+ ":</b> "
+ GettextResource.gettext(config.getI18nResourceBundle(),
"Split the document at pages referred by bookmarks of the given level") + ".</li>"
+ "</ul></body></html>";
checksHelpLabel = new JHelpLabel(helpText, true);
splitOptionsPanel.add(checksHelpLabel);
// END_SPLIT_SECTION
// RADIO_LISTENERS
/* This listeners enable or disable text field based on what you select */
radioListener = new RadioListener(this, nPagesTextField, thisPageTextField, splitSizeCombo, bLevelCombo);
burstRadio.setActionCommand(RadioListener.DISABLE_ALL);
burstRadio.addActionListener(radioListener);
everyNRadio.setActionCommand(RadioListener.ENABLE_FIRST);
everyNRadio.addActionListener(radioListener);
evenRadio.setActionCommand(RadioListener.DISABLE_ALL);
evenRadio.addActionListener(radioListener);
oddRadio.setActionCommand(RadioListener.DISABLE_ALL);
oddRadio.addActionListener(radioListener);
thisPageRadio.setActionCommand(RadioListener.ENABLE_SECOND);
thisPageRadio.addActionListener(radioListener);
sizeRadio.setActionCommand(RadioListener.ENABLE_THIRD);
sizeRadio.addActionListener(radioListener);
bookmarksLevel.setActionCommand(RadioListener.ENABLE_FOURTH);
bookmarksLevel.addActionListener(radioListener);
// END_RADIO_LISTENERS
// DESTINATION_PANEL
destinationPanelLayout = new SpringLayout();
destinationPanel.setLayout(destinationPanelLayout);
destinationPanel.setBorder(BorderFactory.createTitledBorder(GettextResource.gettext(config
.getI18nResourceBundle(), "Destination folder")));
add(destinationPanel);
// END_DESTINATION_PANEL
// DESTINATION_RADIOS
sameAsSourceRadio.setText(GettextResource.gettext(config.getI18nResourceBundle(), "Same as source"));
destinationPanel.add(sameAsSourceRadio);
chooseAFolderRadio.setSelected(true);
chooseAFolderRadio.setText(GettextResource.gettext(config.getI18nResourceBundle(), "Choose a folder"));
destinationPanel.add(chooseAFolderRadio);
// END_DESTINATION_RADIOS
// RADIOGROUP
splitOptionsRadioGroup = new ButtonGroup();
splitOptionsRadioGroup.add(burstRadio);
splitOptionsRadioGroup.add(everyNRadio);
splitOptionsRadioGroup.add(evenRadio);
splitOptionsRadioGroup.add(oddRadio);
splitOptionsRadioGroup.add(thisPageRadio);
splitOptionsRadioGroup.add(sizeRadio);
splitOptionsRadioGroup.add(bookmarksLevel);
final ButtonGroup outputRadioGroup = new ButtonGroup();
outputRadioGroup.add(sameAsSourceRadio);
outputRadioGroup.add(chooseAFolderRadio);
// END_RADIOGROUP
destinationPanel.add(destinationFolderText);
destinationPanel.add(overwriteCheckbox);
destinationPanel.add(outputCompressedCheck);
outputCompressedCheck.addItemListener(new CompressCheckBoxItemListener(versionCombo));
outputCompressedCheck.setSelected(true);
destinationPanel.add(versionCombo);
destinationPanel.add(outputVersionLabel);
browseDestButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = SharedJFileChooser.getInstance(SharedJFileChooserType.NO_FILTER,
JFileChooser.DIRECTORIES_ONLY, destinationFolderText.getText());
if (fileChooser.showOpenDialog(browseDestButton.getParent()) == JFileChooser.APPROVE_OPTION) {
File chosenFile = fileChooser.getSelectedFile();
if (chosenFile != null) {
destinationFolderText.setText(chosenFile.getAbsolutePath());
}
}
}
});
destinationPanel.add(browseDestButton);
// HELP_LABEL_DESTINATION
String helpTextDest = "<html><body><b>"
+ GettextResource.gettext(config.getI18nResourceBundle(), "Destination output directory")
+ "</b>"
+ "<p>"
+ GettextResource.gettext(config.getI18nResourceBundle(),
"Use the same output folder as the input file or choose a folder.")
+ "</p>"
+ "<p>"
+ GettextResource.gettext(config.getI18nResourceBundle(),
"To choose a folder browse or enter the full path to the destination output directory.")
+ "</p>"
+ "<p>"
+ GettextResource.gettext(config.getI18nResourceBundle(),
"Check the box if you want to overwrite the output files if they already exist.")
+ "</p>"
+ "<p>"
+ GettextResource.gettext(config.getI18nResourceBundle(),
"Check the box if you want compressed output files.") + " "
+ GettextResource.gettext(config.getI18nResourceBundle(), "PDF version 1.5 or above.") + "</p>" + "<p>"
+ GettextResource.gettext(config.getI18nResourceBundle(), "Set the pdf version of the ouput document.")
+ "</p>" + "</body></html>";
destinationHelpLabel = new JHelpLabel(helpTextDest, true);
destinationPanel.add(destinationHelpLabel);
// END_HELP_LABEL_DESTINATION
// S_PANEL
outputOptionsPanel.setBorder(BorderFactory.createTitledBorder(GettextResource.gettext(config
.getI18nResourceBundle(), "Output options")));
outputPanelLayout = new SpringLayout();
outputOptionsPanel.setLayout(outputPanelLayout);
add(outputOptionsPanel);
outPrefixLabel.setText(GettextResource.gettext(config.getI18nResourceBundle(), "Output file names prefix:"));
outputOptionsPanel.add(outPrefixLabel);
outPrefixText.setPreferredSize(new Dimension(180, 20));
outputOptionsPanel.add(outPrefixText);
// END_S_PANEL
// HELP_LABEL_PREFIX
String helpTextPrefix = "<html><body><b>"
+ GettextResource.gettext(config.getI18nResourceBundle(), "Output files prefix")
+ "</b>"
+ "<p> "
+ GettextResource
.gettext(
config.getI18nResourceBundle(),
"If it contains \"[CURRENTPAGE]\", \"[TIMESTAMP]\", \"[FILENUMBER]\" or \"[BOOKMARK_NAME]\" it performs variable substitution.")
+ "</p>"
+ "<p> "
+ GettextResource.gettext(config.getI18nResourceBundle(),
"Ex. prefix_[BASENAME]_[CURRENTPAGE] generates prefix_FileName_005.pdf.")
+ "</p>"
+ "<br><p> "
+ GettextResource
.gettext(config.getI18nResourceBundle(),
"If it doesn't contain \"[CURRENTPAGE]\", \"[TIMESTAMP]\" or \"[FILENUMBER]\" it generates oldstyle output file names.")
+ "</p>" + "<br><p> " + GettextResource.gettext(config.getI18nResourceBundle(), "Available variables")
+ ": [CURRENTPAGE], [TIMESTAMP], [BASENAME], [FILENUMBER], [BOOKMARK_NAME].</p>" + "</body></html>";
prefixHelpLabel = new JHelpLabel(helpTextPrefix, true);
outputOptionsPanel.add(prefixHelpLabel);
// END_HELP_LABEL_PREFIX
// RUN_BUTTON
// listener
runButton.addActionListener(new RunButtonActionListener(this));