本文整理了Java中org.eclipse.swt.widgets.FileDialog.setText()
方法的一些代码示例,展示了FileDialog.setText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileDialog.setText()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.FileDialog
类名称:FileDialog
方法名:setText
暂无
代码示例来源:origin: pentaho/pentaho-kettle
/**
* local method to be able to use Spoon localization messages.
* @return
*/
public FileDialog getExportFileDialog() {
FileDialog dialog = new FileDialog( shell, SWT.SAVE | SWT.SINGLE );
dialog.setText( BaseMessages.getString( PKG, "Spoon.SelectAnXMLFileToExportTo.Message" ) );
return dialog;
}
代码示例来源:origin: caoxinyu/RedisClient
private void export() {
FileDialog dialog = new FileDialog(shell, SWT.SAVE);
dialog.setText(i18nFile.getText(I18nFile.EXPORTREDIS));
String[] filterExt = { "*.*" };
dialog.setFilterExtensions(filterExt);
String file = dialog.open();
if (file != null) {
File exportFile = new File(file);
boolean ok = false;
boolean exist = exportFile.exists();
if (exist)
ok = MessageDialog.openConfirm(shell,
i18nFile.getText(I18nFile.FILEEXIST),
i18nFile.getText(I18nFile.FILEREPLACE));
if (!exist || ok) {
for (Item item : itemsSelected) {
TreeItem treeItem;
ContainerKeyInfo cinfo = new ContainerKeyInfo();
if (item instanceof TreeItem) {
treeItem = (TreeItem) item;
} else {
treeItem = getTreeItemByTableItem((TableItem) item);
}
parseContainer(treeItem, cinfo);
exportOne(cinfo, file, item);
}
}
}
}
代码示例来源:origin: caoxinyu/RedisClient
private void importFile() {
TreeItem treeItem;
ContainerKeyInfo cinfo = new ContainerKeyInfo();
if (itemsSelected[0] instanceof TreeItem) {
treeItem = (TreeItem) itemsSelected[0];
} else {
treeItem = getTreeItemByTableItem((TableItem) itemsSelected[0]);
}
parseContainer(treeItem, cinfo);
FileDialog dialog = new FileDialog(shell, SWT.OPEN);
dialog.setText(i18nFile.getText(I18nFile.IMPORTREDIS));
String[] filterExt = { "*.*" };
dialog.setFilterExtensions(filterExt);
String file = dialog.open();
if (file != null) {
ImportService service = new ImportService(file, cinfo.getId(),
cinfo.getDb());
try {
service.importFile();
} catch (IOException e) {
throw new RuntimeException(e.getMessage());
}
dbContainerTreeItemSelected(treeItem, true);
}
}
代码示例来源:origin: pentaho/pentaho-kettle
dialog.setText( BaseMessages.getString( PKG, "PentahoReportingOutputDialog.ExtractParameters.FileDialog" ) );
dialog.setFilterExtensions( new String[] { "*.prpt;*.PRPT", "*" } );
if ( lastFilename != null ) {
代码示例来源:origin: pentaho/pentaho-kettle
public void importDirectoryToRepository() {
FileDialog dialog = new FileDialog( shell, SWT.OPEN | SWT.MULTI );
dialog.setText( BaseMessages.getString( PKG, "Spoon.SelectAnXMLFileToImportFrom.Message" ) );
if ( dialog.open() == null ) {
return;
代码示例来源:origin: pentaho/pentaho-kettle
while ( Utils.isEmpty( zipFilename ) ) {
FileDialog dialog = new FileDialog( shell, SWT.SAVE );
dialog.setText( BaseMessages.getString( PKG, "Spoon.ExportResourceSelectZipFile" ) );
dialog.setFilterExtensions( new String[] { "*.zip;*.ZIP", "*" } );
dialog.setFilterNames( new String[] {
代码示例来源:origin: pentaho/pentaho-kettle
while ( Utils.isEmpty( zipFilename ) ) {
FileDialog dialog = new FileDialog( shell, SWT.SAVE );
dialog.setText( BaseMessages.getString( PKG, "Spoon.ExportResourceSelectZipFile" ) );
dialog.setFilterExtensions( new String[] { "*.zip;*.ZIP", "*" } );
dialog.setFilterNames( new String[] {
代码示例来源:origin: be.yildiz-games/module-window-swt
public FileDialog createOpenFileDialog(String title) {
FileDialog fd = new FileDialog(this.shell, SWT.OPEN);
fd.setText(title);
return fd;
}
代码示例来源:origin: stackoverflow.com
FileDialog fd = new FileDialog(shell, SWT.OPEN);
fd.setText("Open file");
fd.setFilterPath("C:/");
String[] filterExt = { "*.txt", "*.doc", ".rtf", "*.*" };
fd.setFilterExtensions(filterExt);
String file= fd.open();
System.out.println(file);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
/**
* Handles selections of the browse button.
*/
protected void handleBrowseButtonSelected() {
final FileDialog dialog= new FileDialog(fDictionaryPath.getShell(), SWT.OPEN);
dialog.setText(PreferencesMessages.SpellingPreferencePage_filedialog_title);
dialog.setFilterPath(fDictionaryPath.getText());
final String path= dialog.open();
if (path != null)
fDictionaryPath.setText(path);
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
/**
* Handles selections of the browse button.
*/
protected void handleBrowseButtonSelected() {
final FileDialog dialog= new FileDialog(fDictionaryPath.getShell(), SWT.OPEN | SWT.SHEET);
dialog.setText(PreferencesMessages.SpellingPreferencePage_filedialog_title);
dialog.setFilterPath(fDictionaryPath.getText());
final String path= dialog.open();
if (path != null)
fDictionaryPath.setText(path);
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
/**
* Handles selections of the browse button.
*/
protected void handleBrowseButtonSelected() {
final FileDialog dialog= new FileDialog(fDictionaryPath.getShell(), SWT.OPEN);
dialog.setText(PreferencesMessages.SpellingPreferencePage_filedialog_title);
dialog.setFilterPath(fDictionaryPath.getText());
final String path= dialog.open();
if (path != null)
fDictionaryPath.setText(path);
}
代码示例来源:origin: org.eclipse.equinox.security/ui
public void widgetSelected(SelectionEvent e) {
FileDialog dialog = new FileDialog(getShell());
dialog.setText(SecUIMessages.fileSelectTitle);
dialog.setFilterExtensions(exportExtensions);
String tmp = fileText.getText();
if (tmp != null)
dialog.setFileName(tmp);
String result = dialog.open();
if (result != null)
fileText.setText(result);
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.security.ui
public void widgetSelected(SelectionEvent e) {
FileDialog dialog = new FileDialog(getShell());
dialog.setText(SecUIMessages.fileSelectTitle);
dialog.setFilterExtensions(exportExtensions);
String tmp = fileText.getText();
if (tmp != null)
dialog.setFileName(tmp);
String result = dialog.open();
if (result != null)
fileText.setText(result);
}
});
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui
public void widgetSelected(SelectionEvent e) {
FileDialog fileDialog = new FileDialog(pomFileNameButton.getShell());
fileDialog.setText(Messages.MavenInstallFileArtifactWizardPage_file_title);
fileDialog.setFileName(pomFileNameText.getText());
String res = fileDialog.open();
if(res != null) {
updatePOMFileName(res);
}
}
});
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui
public void widgetSelected(SelectionEvent e) {
FileDialog fileDialog = new FileDialog(artifactFileNameButton.getShell());
fileDialog.setText(Messages.MavenInstallFileArtifactWizardPage_file_title);
fileDialog.setFileName(artifactFileNameText.getText());
String name = fileDialog.open();
if(name != null) {
updateFileName(name);
}
}
});
代码示例来源:origin: BiglySoftware/BiglyBT
private static String askForRetargetedFilename(DiskManagerFileInfo fileInfo) {
// parg - removed SAVE option as this prevents the selection of existing read-only media when re-targetting | SWT.SAVE);
// tux - without SWT.SAVE on OSX, user can't choose a new file. RO seems to work on OSX with SWT.SAVE
int flag = Constants.isOSX ? SWT.SAVE : SWT.NONE;
FileDialog fDialog = new FileDialog(Utils.findAnyShell(), SWT.SYSTEM_MODAL | flag );
File existing_file = fileInfo.getFile(true);
fDialog.setFilterPath(existing_file.getParent());
fDialog.setFileName(existing_file.getName());
fDialog.setText(MessageText.getString("FilesView.rename.choose.path"));
return fDialog.open();
}
代码示例来源:origin: org.eclipse/org.eclipse.ltk.ui.refactoring
protected void handleBrowseExternalLocation() {
final FileDialog file= new FileDialog(getShell(), SWT.OPEN);
file.setText(ScriptingMessages.CreateRefactoringScriptWizardPage_browse_destination);
file.setFilterNames(new String[] { ScriptingMessages.ScriptLocationControl_filter_name_script, ScriptingMessages.ScriptLocationControl_filter_name_wildcard});
file.setFilterExtensions(new String[] { ScriptingMessages.ScriptLocationControl_filter_extension_script, ScriptingMessages.ScriptLocationControl_filter_extension_wildcard});
String path= file.open();
if (path != null) {
if (!path.endsWith(ScriptingMessages.CreateRefactoringScriptWizardPage_script_extension))
path= path + ScriptingMessages.CreateRefactoringScriptWizardPage_script_extension;
fExternalLocationControl.setText(path);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui
public void widgetSelected(SelectionEvent e) {
FileDialog dialog = new FileDialog(LifecycleMappingPreferencePage.this.getShell(), SWT.NONE);
dialog.setText(Messages.LifecycleMappingPreferencePage_ChooseNewLocation);
dialog.setFilterExtensions(new String[] {"*.xml", "*.*"}); //$NON-NLS-1$ //$NON-NLS-2$
String res = dialog.open();
if(res == null) {
return;
}
mappingFileTextBox.setText(dialog.getFilterPath() + "/" + dialog.getFileName()); //$NON-NLS-1$
}
});
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui
public void widgetSelected(SelectionEvent e) {
FileDialog dialog = new FileDialog(getShell());
dialog.setText(Messages.LocalArchetypeCatalogDialog_dialog_title);
String location = dialog.open();
if(location != null) {
catalogLocationCombo.setText(location);
update();
}
}
});
内容来源于网络,如有侵权,请联系作者删除!