org.eclipse.swt.widgets.FileDialog.getFileName()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.eclipse.swt.widgets.FileDialog.getFileName()方法的一些代码示例,展示了FileDialog.getFileName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileDialog.getFileName()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.FileDialog
类名称:FileDialog
方法名:getFileName

FileDialog.getFileName介绍

[英]Returns the path of the first file that was selected in the dialog relative to the filter path, or an empty string if no such file has been selected.
[中]返回对话框中相对于筛选器路径选择的第一个文件的路径,如果未选择此类文件,则返回空字符串。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  if ( wTrustStorePath.getText() != null ) {
   String fpath = transMeta.environmentSubstitute( wTrustStorePath.getText() );
   dialog.setFileName( fpath );
  }
  if ( dialog.open() != null ) {
   String str = dialog.getFilterPath() + System.getProperty( "file.separator" ) + dialog.getFileName();
   wTrustStorePath.setText( str );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wSqlldr.getText() != null ) {
   dialog.setFileName( wSqlldr.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wSqlldr.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wControlFile.getText() != null ) {
   dialog.setFileName( wControlFile.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wControlFile.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.SAVE );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wControlFile.getText() != null ) {
   dialog.setFileName( wControlFile.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wControlFile.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.SAVE );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*.pem", "*" } );
  if ( wKeyFilename.getText() != null ) {
   dialog.setFileName( transMeta.environmentSubstitute( wKeyFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wKeyFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*.xml;*.XML", "*" } );
  if ( wxmlFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wxmlFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES_XML );
  if ( dialog.open() != null ) {
   wxmlFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wSourceFileFoldername.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wSourceFileFoldername.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wSourceFileFoldername.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*.txt", "*.csv", "*" } );
  if ( wFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.SAVE );
  dialog.setFilterExtensions( new String[] { "*.xml", ".*" } );
  if ( wTargetFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wTargetFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wTargetFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.SAVE );
  dialog.setFilterExtensions( new String[] { "*.txt", "*.csv", "*" } );
  if ( wFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*.xsl;*.XSL", "*.xslt;*.XSLT", "*" } );
  if ( wxslFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wxslFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES_XSL );
  if ( dialog.open() != null ) {
   wxslFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wFilename2.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wFilename2.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wFilename2.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*.pem", "*" } );
  if ( wKeyFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wKeyFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wKeyFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*.pem", "*" } );
  if ( wKeyFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wKeyFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wKeyFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wSourceFileFolder.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wGpgExe.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wGpgExe.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wDestinationFileFolder.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wDestinationFileFolder.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wDestinationFileFolder.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*.txt", "*.csv", "*" } );
  if ( wFormatFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wFormatFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wFormatFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wFilename.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wFilename.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wFilename.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

相关文章