本文整理汇总了Java中org.eclipse.swt.widgets.DirectoryDialog.getFilterPath方法的典型用法代码示例。如果您正苦于以下问题:Java DirectoryDialog.getFilterPath方法的具体用法?Java DirectoryDialog.getFilterPath怎么用?Java DirectoryDialog.getFilterPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.DirectoryDialog
的用法示例。
在下文中一共展示了DirectoryDialog.getFilterPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSelectionAdapter
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
public static final SelectionAdapter getSelectionAdapter(final Shell shell, final Text destination)
{
// Listen to the Browse... button
return new SelectionAdapter()
{
public void widgetSelected(SelectionEvent e)
{
DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN);
if (destination.getText()!=null)
{
String fpath = destination.getText();
//String fpath = StringUtil.environmentSubstitute(destination.getText());
dialog.setFilterPath( fpath );
}
if (dialog.open()!=null)
{
String str= dialog.getFilterPath();
destination.setText(str);
}
}
};
}
示例2: getSelectionAdapter
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
public static final SelectionAdapter getSelectionAdapter( final Shell shell, final Text destination ) {
// Listen to the Browse... button
return new SelectionAdapter() {
public void widgetSelected( SelectionEvent e ) {
DirectoryDialog dialog = new DirectoryDialog( shell, SWT.OPEN );
if ( destination.getText() != null ) {
String fpath = destination.getText();
// String fpath = StringUtil.environmentSubstitute(destination.getText());
dialog.setFilterPath( fpath );
}
if ( dialog.open() != null ) {
String str = dialog.getFilterPath();
destination.setText( str );
}
}
};
}
示例3: widgetSelected
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
/**
* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.open();
String filterPath = dialog.getFilterPath();
if (null == filterPath || filterPath.isEmpty()) {
return;
}
text.setText(filterPath);
setOkState();
}
示例4: exportCurrentSong
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
protected void exportCurrentSong() {
DirectoryDialog dialog = new DirectoryDialog(shell);
dialog.open();
//
String path = dialog.getFilterPath();
app.exportSongTo(path);
}