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

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

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

FileDialog.getFilterPath介绍

[英]Returns the directory path that the dialog will use, or an empty string if this is not set. File names in this path will appear in the dialog, filtered according to the filter extensions.
[中]返回对话框将使用的目录路径,如果未设置,则返回空字符串。此路径中的文件名将显示在对话框中,并根据过滤器扩展名进行过滤。

代码示例

代码示例来源: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 ( 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.OPEN );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wLogFile.getText() != null ) {
   dialog.setFileName( wLogFile.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wLogFile.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 ( wLogFile.getText() != null ) {
   dialog.setFileName( wLogFile.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wLogFile.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 ( wPsqlPath.getText() != null ) {
   dialog.setFileName( wPsqlPath.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wPsqlPath.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 ( wDataFile.getText() != null ) {
   dialog.setFileName( wDataFile.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wDataFile.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 ( wDataFile.getText() != null ) {
   dialog.setFileName( wDataFile.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wDataFile.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 ( wLogFile.getText() != null ) {
   dialog.setFileName( wLogFile.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wLogFile.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 ( wBadFile.getText() != null ) {
   dialog.setFileName( wBadFile.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wBadFile.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 ( wDiscardFile.getText() != null ) {
   dialog.setFileName( wDiscardFile.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wDiscardFile.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 ( wGploadPath.getText() != null ) {
   dialog.setFileName( wGploadPath.getText() );
  }
  dialog.setFilterNames( ALL_FILETYPES );
  if ( dialog.open() != null ) {
   wGploadPath.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[] { "*" } );
  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 ( 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() );
  }
 }
} );

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

public void widgetSelected( SelectionEvent e ) {
  FileDialog dialog = new FileDialog( shell, SWT.OPEN );
  dialog.setFilterExtensions( new String[] { "*" } );
  if ( wGPGLocation.getText() != null ) {
   dialog.setFileName( transMeta.environmentSubstitute( wGPGLocation.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wGPGLocation.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 ( wSourceFileFolder.getText() != null ) {
   dialog.setFileName( jobMeta.environmentSubstitute( wSourceFileFolder.getText() ) );
  }
  dialog.setFilterNames( FILETYPES );
  if ( dialog.open() != null ) {
   wSourceFileFolder.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
  }
 }
} );

相关文章