private void showOpenInAppInfo() { final String message = MessageFormat.format( "The target product has successfully been created and opened in {0}.\n\n" + "Actual processing of source to target data will be performed only on demand,\n" + "for example, if the target product is saved or an image view is opened.", appContext.getApplicationName() ); showSuppressibleInformationDialog(message, "openInAppInfo"); }
private void updateExpressionComponents() { final boolean useExpressionSelected = useExpressionCheckBox.isSelected(); editExpressionButton.setEnabled(useExpressionSelected && activeProduct != null); String toolTip = null; if (activeProduct == null) { toolTip = String.format("Editor can only be used with a product opened in %s.", appContext.getApplicationName()); } editExpressionButton.setToolTipText(toolTip); expressionArea.setEnabled(useExpressionSelected); expressionNoteLabel.setEnabled(useExpressionSelected); expressionAsFilterButton.setEnabled(useExpressionSelected); exportExpressionResultButton.setEnabled(useExpressionSelected); }
private void showSaveAndOpenInAppInfo(long saveTime) { File productFile = getTargetProductSelector().getModel().getProductFile(); final String message = MessageFormat.format( "The target product has been successfully written to\n" + "{0}\n" + "and has been opened in {1}.\n" + "Total time spend for processing: {2}\n", formatFile(productFile), appContext.getApplicationName(), formatDuration(saveTime) ); showSuppressibleInformationDialog(message, "saveAndOpenInAppInfo"); }
private void updateRunButton() { AbstractButton button = getButton(ID_APPLY); boolean save = targetProductSelector.getModel().isSaveToFileSelected(); boolean open = targetProductSelector.getModel().isOpenInAppSelected(); String toolTipText = ""; boolean enabled = true; if (save && open) { toolTipText = "Save target product and open it in " + getAppContext().getApplicationName(); } else if (save) { toolTipText = "Save target product"; } else if (open) { toolTipText = "Open target product in " + getAppContext().getApplicationName(); } else { enabled = false; } button.setToolTipText(toolTipText); button.setEnabled(enabled); }
"A product with the name ''{0}'' is already opened in {1}.\n\n" + "Do you want to continue?", productName, appContext.getApplicationName() ); final int answer = JOptionPane.showConfirmDialog(getJDialog(), message,
protected SingleTargetProductDialog(AppContext appContext, String title, int buttonMask, String helpID, TargetProductSelectorModel model, boolean alwaysWriteOutput) { super(appContext.getApplicationWindow(), title, buttonMask, helpID); this.appContext = appContext; targetProductSelector = new TargetProductSelector(model, alwaysWriteOutput); String homeDirPath = SystemUtils.getUserHomeDir().getPath(); String saveDir = appContext.getPreferences().getPropertyString(BasicApp.PROPERTY_KEY_APP_LAST_SAVE_DIR, homeDirPath); targetProductSelector.getModel().setProductDir(new File(saveDir)); if (!alwaysWriteOutput) { targetProductSelector.getOpenInAppCheckBox().setText("Open in " + appContext.getApplicationName()); } targetProductSelector.getModel().getValueContainer().addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("saveToFileSelected") || evt.getPropertyName().equals("openInAppSelected")) { updateRunButton(); } } }); AbstractButton button = getButton(ID_APPLY); button.setText("Run"); button.setMnemonic('R'); updateRunButton(); }