本文整理汇总了Java中org.eclipse.swt.widgets.DirectoryDialog.setText方法的典型用法代码示例。如果您正苦于以下问题:Java DirectoryDialog.setText方法的具体用法?Java DirectoryDialog.setText怎么用?Java DirectoryDialog.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.DirectoryDialog
的用法示例。
在下文中一共展示了DirectoryDialog.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveAllAsText
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
public void saveAllAsText() {
if (b.fileindex.size() == 0)
return;
String dir = b.projectFile.getParentFile().getAbsolutePath() + "\\Files\\";
DirectoryDialog getdir = new DirectoryDialog(b);
getdir.setText("ѡ�����Ŀ¼");
String dirpath = getdir.open();
if (dirpath != null && b.fileindex.size() > 0) {
Iterator<String> it = b.fileindex.iterator();
while (it.hasNext()) {
String filename = it.next();
File file = new File(dir + filename);
if (file.exists()) {
String outputname = getShowNameByRealName(filename);
File output = new File(dirpath + "\\" + outputname + ".txt");
ioThread io = new ioThread(b);
String text = io.readBlackFile(file, null).get();
if (!io.writeTextFile(output, text, "utf-8"))
getMessageBox("ת���ļ�", "ת��" + outputname + "ʱʧ�ܣ�");
}
}
getMessageBox("ת���ļ�", "�ѽ���Ŀ�е������ļ�ת������ѡ��Ŀ¼��");
showinExplorer(dirpath, false);
}
}
示例2: uploadDirectoryToDFS
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
/**
* Implement the import action (upload directory from the current machine
* to HDFS)
*
* @param object
* @throws SftpException
* @throws JSchException
* @throws InvocationTargetException
* @throws InterruptedException
*/
private void uploadDirectoryToDFS(IStructuredSelection selection)
throws InvocationTargetException, InterruptedException {
// Ask the user which local directory to upload
DirectoryDialog dialog =
new DirectoryDialog(Display.getCurrent().getActiveShell(), SWT.OPEN
| SWT.MULTI);
dialog.setText("Select the local file or directory to upload");
String dirName = dialog.open();
final File dir = new File(dirName);
List<File> files = new ArrayList<File>();
files.add(dir);
// TODO enable upload command only when selection is exactly one folder
final List<DFSFolder> folders =
filterSelection(DFSFolder.class, selection);
if (folders.size() >= 1)
uploadToDFS(folders.get(0), files);
}
示例3: widgetSelected
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
@Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.OPEN | SWT.SHEET);
if (TextUtils.isNullorEmpty(sdkLocationText.getText())) {
dialog.setText(sdkLocationText.getText());
}
String path = dialog.open();
if (path != null) {
sdkLocationText.setText(path);
if (new File(path).exists()) {
setSdkLocation(path);
} else {
cleanTable();
AguiPlugin.displayError("Error", "Xml format is wrong");
}
} else {
cleanTable();
}
}
示例4: handleOpsapiLocationBrowseButtonPressed
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
private void handleOpsapiLocationBrowseButtonPressed() {
DirectoryDialog dialog = new DirectoryDialog(
opsapiLocationPathField.getShell());
dialog.setText("Select_the_ops_contents_directory");
String dirName = getOpsapiLocationFieldValue();
// ops�������Ĺ��������ط�������֤
if (dirName != null && !dirName.equals("")) {
File path = new File(dirName);
File resourcePath = new File(dirName + File.separator + "resource");
if (path.exists() && resourcePath.exists()
&& !resourcePath.isFile()) {
dialog.setFilterPath(new Path(dirName).toOSString());
}
}
String selectedDirectory = dialog.open();
if (selectedDirectory != null) {
opsCustomapiLocationFieldValue = selectedDirectory;
opsapiLocationPathField.setText(opsCustomapiLocationFieldValue);
}
}
示例5: chooseExternalClassFolderEntries
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
/**
* Shows the UI to select new external class folder entries.
* The dialog returns the selected entry paths or <code>null</code> if the dialog has
* been canceled. The dialog does not apply any changes.
*
* @param shell The parent shell for the dialog.
* @return Returns the new external class folder path or <code>null</code> if the dialog has
* been canceled by the user.
*
* @since 3.4
*/
public static IPath[] chooseExternalClassFolderEntries(Shell shell) {
String lastUsedPath= JavaPlugin.getDefault().getDialogSettings().get(IUIConstants.DIALOGSTORE_LASTEXTJARFOLDER);
if (lastUsedPath == null) {
lastUsedPath= ""; //$NON-NLS-1$
}
DirectoryDialog dialog= new DirectoryDialog(shell, SWT.MULTI);
dialog.setText(NewWizardMessages.BuildPathDialogAccess_ExtClassFolderDialog_new_title);
dialog.setMessage(NewWizardMessages.BuildPathDialogAccess_ExtClassFolderDialog_new_description);
dialog.setFilterPath(lastUsedPath);
String res= dialog.open();
if (res == null) {
return null;
}
File file= new File(res);
if (file.isDirectory())
return new IPath[] { new Path(file.getAbsolutePath()) };
return null;
}
示例6: handleOpsLocationBrowseButtonPressed
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
/**
* user手动选择ops路径是调å–的方法 å¯ä»¥èŽ·å–
* @ToDo opsæœåŠ¡å™¨çš„路径是å¦ç¬¦åˆè§„范的验è¯
*/
private void handleOpsLocationBrowseButtonPressed() {
DirectoryDialog dialog = new DirectoryDialog(opsLocationPathField.getShell());
dialog.setText( "Select the ops contents directory");
String dirName = getOpsLocationFieldValue();
//opsæœåŠ¡å™¨çš„è§„æ ¼åœ¨è¿™ä¸ªåœ°æ–¹è¿›è¡ŒéªŒè¯
if (!dirName.equals("")) { //$NON-NLS-1$
File path = new File(dirName);
if (path.exists())
dialog.setFilterPath(new Path(dirName).toOSString());
}
String selectedDirectory = dialog.open();
if (selectedDirectory!=null) {
opsCustomLocationFieldValue = selectedDirectory;
opsLocationPathField.setText(opsCustomLocationFieldValue);
}
}
示例7: configureExternalClassFolderEntries
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
public static IPath configureExternalClassFolderEntries( Shell shell,
IPath initialEntry )
{
DirectoryDialog dialog = new DirectoryDialog( shell, SWT.SINGLE );
dialog.setText( Messages.getString( "ClassPathBlock_FolderDialog.edit.text" ) ); //$NON-NLS-1$
dialog.setMessage( Messages.getString( "ClassPathBlock_FolderDialog.edit.message" ) ); //$NON-NLS-1$
dialog.setFilterPath( initialEntry.toString( ) );
String res = dialog.open( );
if ( res == null )
{
return null;
}
File file = new File( res );
if ( file.isDirectory( ) )
return new Path( file.getAbsolutePath( ) );
return null;
}
示例8: chooseJavaDocFolder
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
private String chooseJavaDocFolder() {
String initPath= ""; //$NON-NLS-1$
if (fURLResult != null && "file".equals(fURLResult.getProtocol())) { //$NON-NLS-1$
initPath= JavaDocLocations.toFile(fURLResult).getPath();
}
DirectoryDialog dialog= new DirectoryDialog(fShell);
dialog.setText(PreferencesMessages.JavadocConfigurationBlock_javadocFolderDialog_label);
dialog.setMessage(PreferencesMessages.JavadocConfigurationBlock_javadocFolderDialog_message);
dialog.setFilterPath(initPath);
String result= dialog.open();
if (result != null) {
try {
URL url= new File(result).toURI().toURL();
return url.toExternalForm();
} catch (MalformedURLException e) {
JavaPlugin.log(e);
}
}
return null;
}
示例9: chooseExternal
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
private String chooseExternal() {
IPath currPath= new Path(fPathField.getText());
if (currPath.isEmpty()) {
currPath= fEntry.getPath();
} else {
currPath= currPath.removeLastSegments(1);
}
DirectoryDialog dialog= new DirectoryDialog(fShell);
dialog.setMessage(NewWizardMessages.NativeLibrariesDialog_external_message);
dialog.setText(NewWizardMessages.NativeLibrariesDialog_extfiledialog_text);
dialog.setFilterPath(currPath.toOSString());
String res= dialog.open();
if (res != null) {
return res;
}
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:NativeLibrariesConfigurationBlock.java
示例10: openFolderDialog
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
private void openFolderDialog(boolean dropbox)
{
try
{
DirectoryDialog dialog = new DirectoryDialog(shell);
if (dropbox == true)
{
dialog.setText("Choose Dropbox Directory");
text_dropboxPath.setText(dialog.open());
} else
{
dialog.setText("Choose Local Temp Directory");
text_tempPath.setText(dialog.open());
}
} catch (Exception e)
{
}
}
示例11: handleBrowseDecompiledSource
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
private void handleBrowseDecompiledSource() {
//get object which represents the workspace
IWorkspace workspace = ResourcesPlugin.getWorkspace();
//get location of workspace (java.io.File)
File workspaceDirectory = workspace.getRoot().getLocation().toFile();
String workspaceDirPath = null;
if (workspaceDirectory != null) {
workspaceDirPath = workspaceDirectory.getPath();
}
DirectoryDialog dirDialog = new DirectoryDialog(getShell());
dirDialog.setText("Select Output Directory");
dirDialog.setFilterPath(workspaceDirPath);
String selected = dirDialog.open();
System.out.println(selected); // decompiled project
if (selected != null) {
sourcePrjDirectoryText.setText(selected);
}
}
示例12: handleBrowse
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
/**
* Uses the standard container selection dialog to choose the new value for
* the container field.
*/
private void handleBrowse() {
DirectoryDialog dd = new DirectoryDialog(getShell(), SWT.OPEN);
dd.setFilterPath(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile().toString());
dd.setMessage("Select a folder where the index files will be stored");
dd.setText("Select a directory");
String result = dd.open();
if (result!= null){
basePath=result;
folderText.setText(basePath+File.separator+this.getIndexerName());
}
}
示例13: configureExternalClassFolderEntries
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
/**
* Shows the UI to configure an external class folder.
* The dialog returns the configured or <code>null</code> if the dialog has
* been canceled. The dialog does not apply any changes.
*
* @param shell The parent shell for the dialog.
* @param initialEntry The path of the initial archive entry.
* @return Returns the configured external class folder path or <code>null</code> if the dialog has
* been canceled by the user.
*
* @since 3.4
*/
public static IPath configureExternalClassFolderEntries(Shell shell, IPath initialEntry) {
DirectoryDialog dialog= new DirectoryDialog(shell, SWT.SINGLE);
dialog.setText(NewWizardMessages.BuildPathDialogAccess_ExtClassFolderDialog_edit_title);
dialog.setMessage(NewWizardMessages.BuildPathDialogAccess_ExtClassFolderDialog_edit_description);
dialog.setFilterPath(initialEntry.toString());
String res= dialog.open();
if (res == null) {
return null;
}
File file= new File(res);
if (file.isDirectory())
return new Path(file.getAbsolutePath());
return null;
}
示例14: handleSourceBrowseButtonPressed
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
/**
* Open an appropriate source browser so that the user can specify a source
* to import from
*/
protected void handleSourceBrowseButtonPressed() {
String currentSource = this.sourceNameField.getText();
DirectoryDialog dialog = new DirectoryDialog(sourceNameField.getShell(), SWT.SAVE | SWT.SHEET);
dialog.setText("Import from directory");
dialog.setMessage("Select a directory to import from.");
dialog.setFilterPath(getSourceDirectoryName(currentSource));
String selectedDirectory = dialog.open();
if (selectedDirectory != null) {
// Just quit if the directory is not valid
if ((getSourceDirectory(selectedDirectory) == null) || selectedDirectory.equals(currentSource)) {
return;
}
// If it is valid then proceed to populate
setErrorMessage(null);
setSourceName(selectedDirectory);
setTreeviewFocus();
}
}
示例15: run
import org.eclipse.swt.widgets.DirectoryDialog; //导入方法依赖的package包/类
@Override
public void run() {
DirectoryDialog dialog = new DirectoryDialog(UI.shell());
dialog.setText("Master data directory");
dialog.setMessage("Select the EcoSpold 02 directory that contains the "
+ "master data.");
String path = dialog.open();
if (path == null)
return;
File masterDataDir = new File(path);
if (masterDataDir == null || !masterDataDir.isDirectory())
return;
File personFile = new File(masterDataDir, "Persons.xml");
if (personFile.exists())
new PersonUpdate(Database.get(), personFile).run();
File sourceFile = new File(masterDataDir, "Sources.xml");
if (sourceFile.exists())
new SourceUpdate(Database.get(), sourceFile).run();
updateIsicTree();
}