/** Update the output location as appropriate. */ public void updateOutputLocation() { if (outputPathChangeEnabled && outputPathUserSpecified) { // The user can and did influence output path. Keep whatever was the previous setting, unless // it is a special value like "<No Files Selected>" or "<No Title>" - wipe that one. if (outputPathSpecial) { outputPathSpecial = false; } validateOutputPath(output.getText()); } else { // Automatically populate the file path final List<ClientFileSearch> fileSearches = getFileSearches(); if (files == null || (fileSearches == null) || (fileSearches.isEmpty())) { if (!outputPathChangeEnabled) { output.setText("<No Files Selected>"); outputPathSpecial = true; } else { output.setText(""); } outputValidationPanel.removeValidationsFor(output); outputPath = null; } else if ((getTitleText() == null) || getTitleText().equals("")) { if (!outputPathChangeEnabled) { output.setText("<No Title>"); outputPathSpecial = true; } else { output.setText(""); } outputValidationPanel.removeValidationsFor(output); outputPath = null; } else { outputPathSpecial = false; outputPath = getOutputPathFromFileTable(fileSearches); output.setText(outputPath); validateOutputPath(outputPath); } } }
/** @return Contents of the Title field, trimmed. */ private String getTitleText() { return title.getText() == null ? null : title.getText().trim(); }