Пример #1
0
 private void updateTargetProductFields() {
   TargetProductSelectorModel model = targetProductSelector.getModel();
   Property property = propertySet.getProperty(ToolAdapterConstants.TOOL_TARGET_PRODUCT_FILE);
   if (!operatorDescriptor.isHandlingOutputName()) {
     Object value = property.getValue();
     if (value != null) {
       File file = operatorDescriptor.resolveVariables(new File(property.getValueAsText()));
       String productName = FileUtils.getFilenameWithoutExtension(file);
       if (fileExtension == null) {
         fileExtension = FileUtils.getExtension(file);
       }
       model.setProductName(productName);
     }
   } else {
     try {
       model.setProductName("Output Product");
       if (property != null) {
         property.setValue(null);
       }
     } catch (ValidationException e) {
       Logger.getLogger(ToolExecutionForm.class.getName()).severe(e.getMessage());
     }
   }
   model.setSaveToFileSelected(false);
   targetProductSelector.getProductDirTextField().setEnabled(false);
 }