private void updateBinningFormModel() { VariableConfig[] variableConfigs = new VariableConfig[variableItems.size()]; for (int i = 0; i < variableItems.size(); i++) { VariableItem variableItem = variableItems.get(i); variableConfigs[i] = variableItem.variableConfig; } try { binningFormModel.setVariableConfigs(variableConfigs); } catch (ValidationException e) { AbstractDialog.showErrorDialog(grid, e.getMessage(), "Aggregator Configuration"); } }
@Override public void showErrorDialog(String message) { final String dialogTitle; final AssistantPage currentPage = getCurrentPage(); if (currentPage != null) { dialogTitle = currentPage.getPageTitle(); } else { dialogTitle = "Unexpected Error"; } AbstractDialog.showErrorDialog(dialog, message, dialogTitle); }
/** * Shows an error dialog on top of this dialog. * * @param errorMessage The message. */ public void showErrorDialog(String errorMessage) { showErrorDialog(errorMessage, getJDialog().getTitle()); }
@Override public void actionPerformed(ActionEvent event) { JFileChooser fileChooser = new JFileChooser(); FileNameExtensionFilter parameterFileFilter = createParameterFileFilter(); fileChooser.addChoosableFileFilter(parameterFileFilter); fileChooser.setFileFilter(parameterFileFilter); fileChooser.setDialogTitle(TITLE); fileChooser.setDialogType(JFileChooser.OPEN_DIALOG); applyCurrentDirectory(fileChooser); int response = fileChooser.showDialog(parentComponent, "Load"); if (JFileChooser.APPROVE_OPTION == response) { try { preserveCurrentDirectory(fileChooser); readFromFile(fileChooser.getSelectedFile()); } catch (Exception e) { Debug.trace(e); AbstractDialog.showErrorDialog(parentComponent, "Could not load parameters.\n" + e.getMessage(), TITLE); } } }
private void saveSettings(Component parent, File settingsFile) { if (settingsFile == null) { settingsFile = getFile(parent, this.settingsFile, false); if (settingsFile == null) { return; } } try { try (FileWriter writer = new FileWriter(settingsFile)) { writer.write(createXStream().toXML(interactor.getModel())); } this.settingsFile = settingsFile; undoContext.getUndoManager().discardAllEdits(); interactor.setModelModified(false); interactor.updateForm(); } catch (IOException e) { String msg = MessageFormat.format("Failed to safe settings:\n{0}", e.getMessage()); AbstractDialog.showErrorDialog(parent, msg, "I/O Error"); } }
profile.store(file); } catch (IOException e) { AbstractDialog.showErrorDialog(this, "Failed to save RGB-profile '" + file.getName() + "':\n" + e.getMessage(),
AbstractDialog.showErrorDialog(this, String.format("Failed to open RGB-profile '%s':\n%s", file.getName(), e.getMessage()), "Open RGB-Image Profile"); AbstractDialog.showErrorDialog(this, String.format("Invalid RGB-Profile '%s'.", file.getName()), "Open RGB-Image Profile"); AbstractDialog.showErrorDialog(this, String.format("The selected RGB-Profile '%s'\nis not applicable to the current product.", profile.getName()),
private void openSettings(Component parent) { if (proceedWithUnsavedChanges()) { File settingsFile = getFile(parent, this.settingsFile, true); if (settingsFile == null) { return; } try { MagicWandModel model = (MagicWandModel) createXStream().fromXML(FileUtils.readText(settingsFile)); this.settingsFile = settingsFile; interactor.assignModel(model); undoContext.getUndoManager().discardAllEdits(); interactor.setModelModified(false); updateState(); } catch (IOException e) { String msg = MessageFormat.format("Failed to open settings:\n{0}", e.getMessage()); AbstractDialog.showErrorDialog(parent, msg, "I/O Error"); } } }
} catch (ParseException e) { String errorMessage = "The source band could not be created.\nThe expression could not be parsed:\n" + e.getMessage(); /*I18N*/ AbstractDialog.showErrorDialog(getParent(), errorMessage, "Error"); return false;
chartPanel.doSaveAs(); } catch (IOException e1) { AbstractDialog.showErrorDialog(chartPanel, "Could not save chart:\n" + e1.getMessage(), "Error");
AbstractDialog.showErrorDialog(contentPanel, MessageFormat.format("Unknown band: ''{0}''", channelSourceName), "Error"); return;
AbstractDialog.showErrorDialog(getParent(), "Failed to compute profile plot.\n" + "An I/O error occurred:" + e.getMessage(), "I/O error");