Example #1
0
 private void updateParamOutputFormat(final Request request) {
   final Parameter parameter = request.getParameter(OUTPUT_FORMAT_PARAM_NAME);
   if (parameter != null) {
     final String format = parameter.getValueAsText();
     final ProductIOPlugInManager instance = ProductIOPlugInManager.getInstance();
     final String[] allowedformats = instance.getAllProductWriterFormatStrings();
     if (ArrayUtils.isMemberOf(format, allowedformats)) {
       getParamGroup().getParameter(OUTPUT_FORMAT_PARAM_NAME).setValue(format, null);
     }
   }
 }
Example #2
0
 private boolean validateUserInput() {
   if (isEnvisatFormatSelected()) {
     final ProductReader productReader = form.getSourceProduct().getProductReader();
     boolean isEnvisatSource = false;
     if (productReader != null) {
       final String[] formatNames = productReader.getReaderPlugIn().getFormatNames();
       isEnvisatSource =
           ArrayUtils.getElementIndex(EnvisatConstants.ENVISAT_FORMAT_NAME, formatNames) != -1;
     }
     if (!isEnvisatSource) {
       final String msg =
           "If "
               + EnvisatConstants.ENVISAT_FORMAT_NAME
               + " is selected as output format, "
               + "the source product must be in the same format.";
       JOptionPane.showMessageDialog(
           this.getContent(), msg, "Invalid Settings", JOptionPane.ERROR_MESSAGE);
       return false;
     }
   }
   return true;
 }