本文整理汇总了Java中org.pentaho.vfs.ui.VfsFileChooserDialog类的典型用法代码示例。如果您正苦于以下问题:Java VfsFileChooserDialog类的具体用法?Java VfsFileChooserDialog怎么用?Java VfsFileChooserDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VfsFileChooserDialog类属于org.pentaho.vfs.ui包,在下文中一共展示了VfsFileChooserDialog类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openFileVFSFile
import org.pentaho.vfs.ui.VfsFileChooserDialog; //导入依赖的package包/类
public void openFileVFSFile() {
FileObject initialFile;
FileObject rootFile;
try {
initialFile = KettleVFS.getFileObject( getLastFileOpened() );
rootFile = initialFile.getFileSystem().getRoot();
} catch ( Exception e ) {
String message = Const.getStackTracker( e );
new ErrorDialog( shell, BaseMessages.getString( PKG, "Spoon.Error" ), message, e );
return;
}
FileObject selectedFile =
getVfsFileChooserDialog( rootFile, initialFile ).open(
shell, null, Const.STRING_TRANS_AND_JOB_FILTER_EXT, Const.getTransformationAndJobFilterNames(),
VfsFileChooserDialog.VFS_DIALOG_OPEN_FILE );
if ( selectedFile != null ) {
setLastFileOpened( selectedFile.getName().getFriendlyURI() );
openFile( selectedFile.getName().getFriendlyURI(), rep != null );
}
}
示例2: onStart
import org.pentaho.vfs.ui.VfsFileChooserDialog; //导入依赖的package包/类
public void onStart( LifeEventHandler handler ) throws LifecycleException {
if ( new File( GoogleDriveFileObject.resolveCredentialsPath() + "/" + resourceBundle.getString( "client.secrets" ) )
.exists() ) {
/*
* Registers the UI for the VFS Browser
* */
final Spoon spoon = Spoon.getInstance();
spoon.getDisplay().asyncExec( new Runnable() {
public void run() {
VfsFileChooserDialog dialog = spoon.getVfsFileChooserDialog( null, null );
GoogleDriveFileChooserDialog
hadoopVfsFileChooserDialog =
new GoogleDriveFileChooserDialog( GoogleDriveFileProvider.SCHEME, GoogleDriveFileProvider.DISPLAY_NAME,
dialog, SWT.NONE );
dialog.addVFSUIPanel( hadoopVfsFileChooserDialog );
}
} );
}
}
示例3: openFileVFSFile
import org.pentaho.vfs.ui.VfsFileChooserDialog; //导入依赖的package包/类
public void openFileVFSFile() {
FileObject initialFile = null;
FileObject rootFile = null;
try {
initialFile = KettleVFS.getFileObject(getLastFileOpened());
rootFile = initialFile.getFileSystem().getRoot();
} catch (IOException e) {
e.printStackTrace();
String message = e.getMessage();
if (e.getCause() != null) {
message = e.getCause().getMessage();
}
MessageBox messageDialog = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
messageDialog.setText(Messages.getString("Spoon.Error"));
messageDialog.setMessage(message);
messageDialog.open();
// bring up a dialog to prompt for userid/password and try again
// lastVfsUsername = "";
// lastVfsPassword = "";
// if (lastFileOpened != null && lastFileOpened.indexOf("@") == -1)
// {
// lastFileOpened = lastFileOpened.substring(0,
// lastFileOpened.indexOf("//")+2) + lastVfsUsername + ":" +
// lastVfsPassword + "@" +
// lastFileOpened.substring(lastFileOpened.indexOf("//")+2);
// }
// openFileVFSFile();
return;
}
VfsFileChooserDialog vfsFileChooser = new VfsFileChooserDialog(rootFile, initialFile);
FileObject selectedFile = vfsFileChooser.open(shell, null, Const.STRING_TRANS_AND_JOB_FILTER_EXT, Const.getTransformationAndJobFilterNames(), VfsFileChooserDialog.VFS_DIALOG_OPEN_FILE);
if (selectedFile != null) {
setLastFileOpened(selectedFile.getName().getFriendlyURI());
openFile(selectedFile.getName().getFriendlyURI(), false);
}
}
示例4: openFileVFSFile
import org.pentaho.vfs.ui.VfsFileChooserDialog; //导入依赖的package包/类
public void openFileVFSFile() {
FileObject initialFile = null;
FileObject rootFile = null;
try {
initialFile = KettleVFS.getFileObject(getLastFileOpened());
rootFile = initialFile.getFileSystem().getRoot();
} catch (Exception e) {
String message = Const.getStackTracker(e);
new ErrorDialog(shell, BaseMessages.getString(PKG, "Spoon.Error"), message, e);
// bring up a dialog to prompt for userid/password and try again
// lastVfsUsername = "";
// lastVfsPassword = "";
// if (lastFileOpened != null && lastFileOpened.indexOf("@") == -1)
// {
// lastFileOpened = lastFileOpened.substring(0,
// lastFileOpened.indexOf("//")+2) + lastVfsUsername + ":" +
// lastVfsPassword + "@" +
// lastFileOpened.substring(lastFileOpened.indexOf("//")+2);
// }
// openFileVFSFile();
return;
}
FileObject selectedFile = getVfsFileChooserDialog(rootFile, initialFile).open(shell, null, Const.STRING_TRANS_AND_JOB_FILTER_EXT, Const
.getTransformationAndJobFilterNames(), VfsFileChooserDialog.VFS_DIALOG_OPEN_FILE);
if (selectedFile != null) {
setLastFileOpened(selectedFile.getName().getFriendlyURI());
openFile(selectedFile.getName().getFriendlyURI(), false);
}
}
示例5: selectFile
import org.pentaho.vfs.ui.VfsFileChooserDialog; //导入依赖的package包/类
protected Optional<String> selectFile( TextVar fileWidget, String[] fileFilters ) {
String curFile = transMeta.environmentSubstitute( fileWidget.getText() );
FileObject root = null;
try {
root = KettleVFS.getFileObject( curFile != null ? curFile : Const.getUserHomeDirectory() );
VfsFileChooserDialog vfsFileChooser = Spoon.getInstance().getVfsFileChooserDialog( root.getParent(), root );
FileObject file =
vfsFileChooser.open(
shell, null, fileFilters, Const.getTransformationFilterNames(),
VfsFileChooserDialog.VFS_DIALOG_OPEN_FILE );
if ( file == null ) {
return Optional.empty();
}
String filePath = getRelativePath( file.getName().toString() );
fileWidget.setText( filePath );
return Optional.ofNullable( filePath );
} catch ( IOException | KettleException e ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "TransExecutorDialog.ErrorLoadingTransformation.DialogTitle" ),
BaseMessages.getString( PKG, "TransExecutorDialog.ErrorLoadingTransformation.DialogMessage" ), e );
}
return Optional.empty();
}
示例6: onStart
import org.pentaho.vfs.ui.VfsFileChooserDialog; //导入依赖的package包/类
@Override
public void onStart( LifeEventHandler handler ) throws LifecycleException {
/*
* Registers the UI for the VFS Browser
*/
final Spoon spoon = spoonSupplier.get();
spoon.getDisplay().asyncExec( new Runnable() {
public void run() {
VfsFileChooserDialog dialog = spoon.getVfsFileChooserDialog( null, null );
RepositoryVfsProviderDialog hadoopVfsFileChooserDialog =
new RepositoryVfsProviderDialog( RepositoryVfsProvider.SCHEME, "Repository VFS", dialog, SWT.NONE );
dialog.addVFSUIPanel( hadoopVfsFileChooserDialog );
}
} );
}
示例7: onStart
import org.pentaho.vfs.ui.VfsFileChooserDialog; //导入依赖的package包/类
public void onStart( LifeEventHandler handler ) throws LifecycleException {
final Spoon spoon = Spoon.getInstance();
spoon.getDisplay().asyncExec( new Runnable() {
public void run() {
VfsFileChooserDialog dialog = spoon.getVfsFileChooserDialog( null, null );
GoogleCloudStorageFileChooserDialog
googleCloudStorageVfsFileChooserDialog =
new GoogleCloudStorageFileChooserDialog( dialog, null, null );
dialog.addVFSUIPanel( googleCloudStorageVfsFileChooserDialog );
}
} );
}
示例8: GoogleCloudStorageFileChooserDialog
import org.pentaho.vfs.ui.VfsFileChooserDialog; //导入依赖的package包/类
public GoogleCloudStorageFileChooserDialog( VfsFileChooserDialog vfsFileChooserDialog, FileObject rootFile,
FileObject initialFile ) {
super( GoogleCloudStorageFileProvider.SCHEME, GoogleCloudStorageFileProvider.SCHEME_NAME, vfsFileChooserDialog,
SWT.NONE );
this.vfsFileChooserDialog = vfsFileChooserDialog;
this.rootFile = rootFile;
this.initialFile = initialFile;
setLayout( new GridLayout() );
}
示例9: GoogleDriveFileChooserDialog
import org.pentaho.vfs.ui.VfsFileChooserDialog; //导入依赖的package包/类
public GoogleDriveFileChooserDialog( String vfsScheme, String vfsSchemeDisplayText,
VfsFileChooserDialog vfsFileChooserDialog, int flags ) {
super( vfsScheme, vfsSchemeDisplayText, vfsFileChooserDialog, flags );
}
示例10: RepositoryVfsProviderDialog
import org.pentaho.vfs.ui.VfsFileChooserDialog; //导入依赖的package包/类
public RepositoryVfsProviderDialog( String vfsScheme, String vfsSchemeDisplayText,
VfsFileChooserDialog vfsFileChooserDialog, int flags ) {
super( vfsScheme, vfsSchemeDisplayText, vfsFileChooserDialog, flags );
}