sramazzina commented on a change in pull request #806:
URL: https://github.com/apache/incubator-hop/pull/806#discussion_r633426243



##########
File path: 
plugins/transforms/propertyoutput/src/main/java/org/apache/hop/pipeline/transforms/propertyoutput/PropertyOutputDialog.java
##########
@@ -606,34 +607,13 @@ public void widgetDefaultSelected( SelectionEvent e ) {
 
     wTransformName.addSelectionListener( lsDef );
 
-    wbFilename.addSelectionListener( new SelectionAdapter() {
-      public void widgetSelected( SelectionEvent e ) {
-        FileDialog dialog = new FileDialog( shell, SWT.SAVE );
-        dialog.setFilterExtensions( new String[] { "*.txt", "*.TXT", "*" } );
-        if ( wFilename.getText() != null ) {
-          dialog.setFileName( variables.resolve( wFilename.getText() ) );
-        }
-        dialog.setFilterNames( new String[] {
-          BaseMessages.getString( PKG, "System.FileType.TextFiles" ),
-          BaseMessages.getString( PKG, "System.FileType.CSVFiles" ),
-          BaseMessages.getString( PKG, "System.FileType.AllFiles" ) } );
-        if ( dialog.open() != null ) {
-          String extension = wExtension.getText();
-          if ( extension != null
-            && dialog.getFileName() != null && dialog.getFileName().endsWith( 
"." + extension ) ) {
-            // The extension is filled in and matches the end
-            // of the selected file => Strip off the extension.
-            String fileName = dialog.getFileName();
-            wFilename.setText( dialog.getFilterPath()
-              + System.getProperty( "file.separator" )
-              + fileName.substring( 0, fileName.length() - ( 
extension.length() + 1 ) ) );
-          } else {
-            wFilename.setText( dialog.getFilterPath()
-              + System.getProperty( "file.separator" ) + dialog.getFileName() 
);
-          }
-        }
-      }
-    } );
+    wbFilename.addListener( SWT.Selection, e-> BaseDialog.presentFileDialog( 
shell, wFilename, variables,
+            new String[] { "*.txt", "*.csv", "*" },
+            new String[] { BaseMessages.getString( PKG, 
"System.FileType.TextFiles" ),
+                    BaseMessages.getString( PKG, "System.FileType.CSVFiles" ),
+                    BaseMessages.getString( PKG, "System.FileType.AllFiles" ) 
},
+            true )
+    );

Review comment:
       I know and you are right. But, as you said, that was the original 
setting used int the system dialog. If you want I can open a ticket and take 
care about that.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to