當前位置: 首頁>>代碼示例>>Java>>正文


Java DirectoryDialog.setMessage方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.DirectoryDialog.setMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java DirectoryDialog.setMessage方法的具體用法?Java DirectoryDialog.setMessage怎麽用?Java DirectoryDialog.setMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.DirectoryDialog的用法示例。


在下文中一共展示了DirectoryDialog.setMessage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: chooseTestClassesDirectory

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
/**
    * Open the dialog to chose a directory for the test case classes.
    */
protected void chooseTestClassesDirectory() {
	// Initialize the dialog.
	DirectoryDialog dialog = new DirectoryDialog(this.shell);
	dialog.setMessage("Please chose a directory for the test case classes.");
	// Check if the test cases directory exists.
	File file = new File(this.testClassesDirectoryText.getText());
	if (file.exists() && file.isDirectory()) {
		// Set as the start directory.
		dialog.setFilterPath(this.testClassesDirectoryText.getText());
	}

	// Open the dialog and process its result.
	String path = dialog.open();
	if (path != null) {
		// First of all replace double backslashes against slashes.
		path = path.replace("\\\\", "\\");

		// Convert backslashes to slashes.
		path = path.replace("\\", "/");

		// Set it as the text.
		this.testClassesDirectoryText.setText(path);
	}
}
 
開發者ID:wwu-pi,項目名稱:tap17-muggl-javaee,代碼行數:28,代碼來源:OptionsComposite.java

示例2: showDirectoryDialog

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
public static String showDirectoryDialog(String filePath, String message) {
	String fileName = null;

	if (filePath != null && !"".equals(filePath.trim())) {
		File file = new File(filePath.trim());
		fileName = file.getPath();
	}

	DirectoryDialog dialog = new DirectoryDialog(PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getShell(), SWT.NONE);

	dialog.setMessage(ResourceString.getResourceString(message));

	dialog.setFilterPath(fileName);

	return dialog.open();
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:18,代碼來源:ERDiagramActivator.java

示例3: getDirectory

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
protected File getDirectory(final File startingDirectory) {
	final DirectoryDialog fileDialog = new DirectoryDialog(getShell(), SWT.OPEN | SWT.SHEET);
	if (dialogMessage != null && dialogMessage.get() != null) {
		fileDialog.setMessage(dialogMessage.get());
	}
	if (startingDirectory != null) {
		fileDialog.setFilterPath(startingDirectory.getPath());
	}
	else if (filterPath != null) {
		fileDialog.setFilterPath(filterPath.getPath());
	}
	String dir = fileDialog.open();
	if (dir != null) {
		dir = dir.trim();
		if (dir.length() > 0) {
			return new File(dir);
		}
	}
	return null;
}
 
開發者ID:Albertus82,項目名稱:JFaceUtils,代碼行數:21,代碼來源:EnhancedDirectoryFieldEditor.java

示例4: getNewInputObject

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
@Override
protected String getNewInputObject() {
	final DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SHEET);
	if (dirChooserLabelText != null && dirChooserLabelText.get() != null) {
		dialog.setMessage(dirChooserLabelText.get());
	}
	if (lastPath != null && new File(lastPath).exists()) {
		dialog.setFilterPath(lastPath);
	}
	String dir = dialog.open();
	if (dir != null) {
		dir = dir.trim();
		if (dir.length() == 0) {
			return null;
		}
		lastPath = dir;
	}
	return dir;
}
 
開發者ID:Albertus82,項目名稱:JFaceUtils,代碼行數:20,代碼來源:LocalizedPathEditor.java

示例5: getDataDirectory

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
public static Path getDataDirectory() {
	String url = Activator.getCMakePath();
	if (url == null)
	{
		// create a dialog with ok and cancel buttons and a question icon
		DirectoryDialog dialog = new DirectoryDialog(Display.getDefault().getActiveShell(), SWT.ICON_QUESTION | SWT.OK| SWT.CANCEL);
		dialog.setText("Unable to find CMakeEnvironment");
		dialog.setMessage("Please specify path to the CMakeEnvironment");

		// open dialog and await user selection
		String returnCode = dialog.open();
		if(returnCode != null)
		{
			Activator.getDefault().getPreferenceStore().setValue("USE_CMAKE_PATH", returnCode);
		}
	}
		
	return new File(url).toPath();
}
 
開發者ID:USESystemEngineeringBV,項目名稱:cmake-eclipse-helper,代碼行數:20,代碼來源:PluginDataIO.java

示例6: 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

示例7: 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,代碼行數:30,代碼來源:BuildPathDialogAccess.java

示例8: handleLocationBrowseButtonPressed

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
/**
 * Open an appropriate directory browser
 */
private void handleLocationBrowseButtonPressed( )
{
	DirectoryDialog dialog = new DirectoryDialog( locationPathField.getShell( ) );
	dialog.setMessage( LABEL_SELECT_A_DIRECTORY );

	String dirName = getFileLocationFullPath( ).toOSString( );
	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 )
	{
		customLocationFieldValue = selectedDirectory;
		locationPathField.setText( customLocationFieldValue );
	}
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:26,代碼來源:NewReportPageSupport.java

示例9: changeControlPressed

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
public void changeControlPressed(DialogField field) {
	final DirectoryDialog dialog= new DirectoryDialog(getShell());
	dialog.setMessage(NewWizardMessages.AddSourceFolderWizardPage_directory_message);
	String directoryName = fLinkLocation.getText().trim();
	if (directoryName.length() == 0) {
		String prevLocation= JavaPlugin.getDefault().getDialogSettings().get(DIALOGSTORE_LAST_EXTERNAL_LOC);
		if (prevLocation != null) {
			directoryName= prevLocation;
		}
	}

	if (directoryName.length() > 0) {
		final File path = new File(directoryName);
		if (path.exists())
			dialog.setFilterPath(directoryName);
	}
	final String selectedDirectory = dialog.open();
	if (selectedDirectory != null) {
		fLinkLocation.setText(selectedDirectory);
		fRootDialogField.setText(selectedDirectory.substring(selectedDirectory.lastIndexOf(File.separatorChar) + 1));
		JavaPlugin.getDefault().getDialogSettings().put(DIALOGSTORE_LAST_EXTERNAL_LOC, selectedDirectory);
		if (fAdapter != null) {
			fAdapter.dialogFieldChanged(fRootDialogField);
		}
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:27,代碼來源:AddSourceFolderWizardPage.java

示例10: 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

示例11: chooseExtFolder

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
private IPath chooseExtFolder() {
	IPath currPath= getFilePath();
	if (currPath.segmentCount() == 0) {
		currPath= fEntry.getPath();
	}
	if (ArchiveFileFilter.isArchivePath(currPath, true)) {
		currPath= currPath.removeLastSegments(1);
	}

	DirectoryDialog dialog= new DirectoryDialog(getShell());
	dialog.setMessage(NewWizardMessages.SourceAttachmentBlock_extfolderdialog_message);
	dialog.setText(NewWizardMessages.SourceAttachmentBlock_extfolderdialog_text);
	dialog.setFilterPath(currPath.toOSString());
	String res= dialog.open();
	if (res != null) {
		return Path.fromOSString(res).makeAbsolute();
	}
	return null;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:20,代碼來源:SourceAttachmentBlock.java

示例12: handleBrowseButtonPressed

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
private void handleBrowseButtonPressed() {
	final DirectoryDialog dialog = new DirectoryDialog(
			directoryPathField.getShell(), SWT.SHEET);
	dialog.setMessage("Select search directory");

	String dirName = directoryPathField.getText().trim();
	if (dirName.isEmpty()) {
		dirName = previouslyBrowsedDirectory;
	}

	if (dirName.isEmpty()) {
		dialog.setFilterPath(ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString());
	} else {
		File path = new File(dirName);
		if (path.exists()) {
			dialog.setFilterPath(new Path(dirName).toOSString());
		}
	}
	
	String selectedDirectory = dialog.open();
	if (selectedDirectory != null) {
		previouslyBrowsedDirectory = selectedDirectory;
		directoryPathField.setText(previouslyBrowsedDirectory);
		updateProjectsList(selectedDirectory);
	}
}
 
開發者ID:eclipse,項目名稱:thym,代碼行數:27,代碼來源:HybridProjectImportPage.java

示例13: handleLocationBrowseButtonPressed

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
/**
 *  Open an appropriate directory browser
 */
private void handleLocationBrowseButtonPressed() {
    DirectoryDialog dialog = new DirectoryDialog(schemalocationPathField.getShell());
    dialog.setMessage( "Select the project contents directory" );

    String dirName = getProjectLocationFieldValue();
    if (!dirName.equals("")) { 
        File path = new File(dirName);
        if (path.exists())
            dialog.setFilterPath(new Path(dirName).toOSString());
    }

    String selectedDirectory = dialog.open();
    if (selectedDirectory != null) {
        customLocationFieldValue = selectedDirectory;
        schemalocationPathField.setText(customLocationFieldValue);
        setSchemaPath(schemalocationPathField.getText());
    }
}
 
開發者ID:HuaweiSNC,項目名稱:OpsDev,代碼行數:22,代碼來源:NewProjectNameAndLocationWizardPage.java

示例14: addFolder

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
private void addFolder() {
	DirectoryDialog dialog = new DirectoryDialog(shell, SWT.NONE);
	dialog.setMessage("Select a folder to mount in RepDev");
	String dir;

	if ((dir = dialog.open()) != null) {
		boolean exists = false;

		for (TreeItem current : tree.getItems()) {
			if (current.getData() instanceof String && ((String) current.getData()).equals(dir))
				exists = true;
		}

		if (!exists) {
			TreeItem item = new TreeItem(tree, SWT.NONE);
			item.setText(dir.substring(dir.lastIndexOf("\\")));
			item.setImage(RepDevMain.smallFolderImage);
			item.setData(dir);
			new TreeItem(item, SWT.NONE).setText("Loading...");
			Config.getMountedDirs().add(dir);
		}
	}
}
 
開發者ID:jakepoz,項目名稱:RepDev,代碼行數:24,代碼來源:MainShell.java

示例15: handleLocationBrowseButtonPressed

import org.eclipse.swt.widgets.DirectoryDialog; //導入方法依賴的package包/類
/**
 *  Open an appropriate directory browser
 */
private void handleLocationBrowseButtonPressed() {
    DirectoryDialog dialog = new DirectoryDialog(locationPathField.getShell());
    dialog.setMessage("Select the project contents directory.");

    String dirName = getProjectLocationFieldValue();
    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) {
        customLocationFieldValue = selectedDirectory;
        locationPathField.setText(customLocationFieldValue);
    }
}
 
開發者ID:fabioz,項目名稱:Pydev,代碼行數:22,代碼來源:NewProjectNameAndLocationWizardPage.java


注:本文中的org.eclipse.swt.widgets.DirectoryDialog.setMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。