当前位置: 首页>>代码示例>>Java>>正文


Java DirectoryDialog.setText方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:piiiiq,项目名称:Black,代码行数:26,代码来源:blackAction.java

示例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);

}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:32,代码来源:DFSActionImpl.java

示例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();
	}
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:20,代码来源:AguiPreferencePage.java

示例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);
	}
}
 
开发者ID:HuaweiSNC,项目名称:OpsDev,代码行数:21,代码来源:OpsPathPropertyPage.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:33,代码来源:BuildPathDialogAccess.java

示例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);
    }
}
 
开发者ID:HuaweiSNC,项目名称:OpsDev,代码行数:22,代码来源:NewProjectLocationWizardPage.java

示例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;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:ClassPathBlock.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:JavadocConfigurationBlock.java

示例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)
	{
	}
}
 
开发者ID:dev131,项目名称:DropTillLate_Application,代码行数:20,代码来源:InitialView.java

示例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);
	}
}
 
开发者ID:SeoulTech,项目名称:Manal,代码行数:20,代码来源:WizardManalPropertiesPage.java

示例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());
	}

}
 
开发者ID:seyyedshah,项目名称:hawk-ui,代码行数:20,代码来源:HWizardPage.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:30,代码来源:BuildPathDialogAccess.java

示例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();
	}
}
 
开发者ID:kelvinst,项目名称:psf-import,代码行数:25,代码来源:PsfImportWizardFilesSelectionPage.java

示例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();
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:21,代码来源:XEI3MetaDataImportAction.java


注:本文中的org.eclipse.swt.widgets.DirectoryDialog.setText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。