本文整理汇总了Java中org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages类的典型用法代码示例。如果您正苦于以下问题:Java DataTransferMessages类的具体用法?Java DataTransferMessages怎么用?Java DataTransferMessages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataTransferMessages类属于org.eclipse.ui.internal.wizards.datatransfer包,在下文中一共展示了DataTransferMessages类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: collectProjectFilesFromProvider
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Collect the list of .project files that are under directory into files.
*
* @param files
* @param monitor
* The monitor to report to
* @return boolean <code>true</code> if the operation was completed.
*/
private boolean collectProjectFilesFromProvider(final Collection<ProjectRecord> files, final Object entry,
final int level, final IProgressMonitor monitor) {
if (monitor.isCanceled()) { return false; }
monitor.subTask(NLS.bind(DataTransferMessages.WizardProjectsImportPage_CheckingMessage,
structureProvider.getLabel(entry)));
List<?> children = structureProvider.getChildren(entry);
if (children == null) {
children = new ArrayList<Object>(1);
}
final Iterator<?> childrenEnum = children.iterator();
while (childrenEnum.hasNext()) {
final Object child = childrenEnum.next();
if (structureProvider.isFolder(child)) {
collectProjectFilesFromProvider(files, child, level + 1, monitor);
}
final String elementLabel = structureProvider.getLabel(child);
if (elementLabel.equals(IProjectDescription.DESCRIPTION_FILE_NAME)) {
files.add(new ProjectRecord(child, entry, level));
}
}
return true;
}
开发者ID:gama-platform,项目名称:gama,代码行数:32,代码来源:ImportProjectWizardPage.java
示例2: createDirectoryStructureOptions
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Create the buttons for the group that determine if the entire or
* selected directory structure should be created.
* @param optionsGroup
* @param font
*/
protected void createDirectoryStructureOptions(Composite optionsGroup, Font font) {
// create directory structure radios
createDirectoryStructureButton = new Button(optionsGroup, SWT.RADIO
| SWT.LEFT);
createDirectoryStructureButton.setText(DataTransferMessages.FileExport_createDirectoryStructure);
createDirectoryStructureButton.setSelection(false);
createDirectoryStructureButton.setFont(font);
// create directory structure radios
createSelectionOnlyButton = new Button(optionsGroup, SWT.RADIO
| SWT.LEFT);
createSelectionOnlyButton.setText(DataTransferMessages.FileExport_createSelectedDirectories);
createSelectionOnlyButton.setSelection(true);
createSelectionOnlyButton.setFont(font);
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:22,代码来源:AbstractEnsembleProjectExportWizardPage.java
示例3: ensureDirectoryExists
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Attempts to ensure that the specified directory exists on the local file system.
* Answers a boolean indicating success.
*
* @return boolean
* @param directory java.io.File
*/
protected boolean ensureDirectoryExists(File directory) {
if (!directory.exists()) {
if (!queryYesNoQuestion("Directory " + directory.getAbsolutePath()
+ " does not exist. Would you like to create it?")) {
return false;
}
if (!directory.mkdirs()) {
carefullyDisplayErrorDialog(DataTransferMessages.DataTransfer_directoryCreationError);
giveFocusToDestination();
return false;
}
}
return true;
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:24,代码来源:AbstractEnsembleProjectExportWizardPage.java
示例4: createOptionsArea
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Create the area with the extra options.
*
* @param workArea
*/
@SuppressWarnings("unused")
private void createOptionsArea(Composite workArea) {
Composite optionsGroup = new Composite(workArea, SWT.NONE);
optionsGroup.setLayout(new GridLayout());
optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
copyCheckbox = new Button(optionsGroup, SWT.CHECK);
copyCheckbox
.setText(DataTransferMessages.WizardProjectsImportPage_CopyProjectsIntoWorkspace);
copyCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
copyCheckbox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
copyFiles = copyCheckbox.getSelection();
}
});
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:23,代码来源:SPIFePlanIntegrationWizardPage.java
示例5: ensureDirectoryExists
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Attempts to ensure that the specified directory exists on the local file system. Answers a boolean indicating
* success.
* @return boolean
* @param directory
* java.io.File
*/
protected boolean ensureDirectoryExists(File directory) {
if (!directory.exists()) {
if (!queryYesNoQuestion(DataTransferMessages.DataTransfer_createTargetDirectory)) {
return false;
}
if (!directory.mkdirs()) {
displayErrorDialog(DataTransferMessages.DataTransfer_directoryCreationError);
giveFocusToDestination();
return false;
}
}
return true;
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:23,代码来源:WizardFileSystemResourceExportPage2.java
示例6: validateDestinationGroup
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Answer a boolean indicating whether the receivers destination specification widgets currently all contain valid
* values.
*/
protected boolean validateDestinationGroup() {
String destinationValue = getDestinationValue();
if (destinationValue.length() == 0) {
setMessage(destinationEmptyMessage());
return false;
}
String conflictingContainer = getConflictingContainerNameFor(destinationValue);
if (conflictingContainer == null) {
// no error message, but warning may exists
String threatenedContainer = getOverlappingProjectName(destinationValue);
if (threatenedContainer == null)
setMessage(null);
else
setMessage(NLS.bind(DataTransferMessages.FileExport_damageWarning, threatenedContainer), WARNING);
} else {
setErrorMessage(NLS.bind(DataTransferMessages.FileExport_conflictingContainer, conflictingContainer));
giveFocusToDestination();
return false;
}
return true;
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:29,代码来源:WizardFileSystemResourceExportPage2.java
示例7: ensureTargetFileIsValid
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Returns a boolean indicating whether the passed File handle is is valid and available for use.
*/
protected boolean ensureTargetFileIsValid(File targetFile) {
if (targetFile.exists() && targetFile.isDirectory()) {
displayErrorDialog(DataTransferMessages.ZipExport_mustBeFile);
giveFocusToDestination();
return false;
}
if (targetFile.exists()) {
if (targetFile.canWrite()) {
if (!queryYesNoQuestion(DataTransferMessages.ZipExport_alreadyExists)) {
return false;
}
} else {
displayErrorDialog(DataTransferMessages.ZipExport_alreadyExistsError);
giveFocusToDestination();
return false;
}
}
return true;
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:25,代码来源:ExportProjectWizardPage.java
示例8: handleDestinationBrowseButtonPressed
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Open an appropriate destination browser so that the user can specify a source to import from
*/
protected void handleDestinationBrowseButtonPressed() {
FileDialog dialog = new FileDialog(getContainer().getShell(), SWT.SAVE | SWT.SHEET);
dialog.setFilterExtensions(new String[] { "*.hszip", "*" }); //$NON-NLS-1$ //$NON-NLS-2$
dialog.setText(DataTransferMessages.ArchiveExport_selectDestinationTitle);
String currentSourceString = getDestinationValue();
int lastSeparatorIndex = currentSourceString.lastIndexOf(File.separator);
if (lastSeparatorIndex != -1) {
dialog.setFilterPath(currentSourceString.substring(0, lastSeparatorIndex));
}
String selectedFileName = dialog.open();
if (selectedFileName != null) {
setErrorMessage(null);
setDestinationValue(selectedFileName);
if (getWhiteCheckedResources().size() > 0) {
setDescription(null);
}
}
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:23,代码来源:ExportProjectWizardPage.java
示例9: ImportProjectWizard
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Constructor for ExternalProjectImportWizard.
*
* @param initialPath Default path for wizard to import
* @since 3.5
*/
public ImportProjectWizard(String initialPath)
{
super();
this.initialPath = initialPath;
setWindowTitle(DataTransferMessages.DataTransfer_importTitle);
setNeedsProgressMonitor(true);
IDialogSettings workbenchSettings = IDEWorkbenchPlugin.getDefault()
.getDialogSettings();
IDialogSettings wizardSettings = workbenchSettings
.getSection(IMPORT_PROJECT_SECTION);
if (wizardSettings == null) {
wizardSettings = workbenchSettings
.addNewSection(IMPORT_PROJECT_SECTION);
}
setDialogSettings(wizardSettings);
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:24,代码来源:ImportProjectWizard.java
示例10: importFileSystemObjects
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Imports the specified file system objects into the workspace.
* If the import fails, adds a status object to the list to be returned by
* <code>getStatus</code>.
*
* @param filesToImport the list of file system objects to import
* (element type: <code>Object</code>)
* @throws CoreException
* @exception OperationCanceledException if canceled
*/
void importFileSystemObjects(List filesToImport) throws CoreException {
Iterator filesEnum = filesToImport.iterator();
while (filesEnum.hasNext()) {
Object fileSystemObject = filesEnum.next();
if (source == null) {
// We just import what we are given into the destination
IPath sourcePath = new Path(provider
.getFullPath(fileSystemObject)).removeLastSegments(1);
if (provider.isFolder(fileSystemObject) && sourcePath.isEmpty()) {
// If we don't have a parent then we have selected the
// file systems root. Roots can't copied (at least not
// under windows).
errorTable.add(new Status(IStatus.INFO,
PlatformUI.PLUGIN_ID, 0, DataTransferMessages.ImportOperation_cannotCopy,
null));
continue;
}
source = sourcePath.toFile();
}
importRecursivelyFrom(fileSystemObject, POLICY_DEFAULT);
}
}
开发者ID:crapo,项目名称:sadlos2,代码行数:33,代码来源:OwlImportOperation.java
示例11: queryOverwrite
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Queries the user whether the resource with the specified path should be
* overwritten by a file system object that is being imported.
*
* @param resourcePath the workspace path of the resource that needs to be overwritten
* @return <code>true</code> to overwrite, <code>false</code> to not overwrite
* @exception OperationCanceledException if canceled
*/
boolean queryOverwrite(IPath resourcePath)
throws OperationCanceledException {
String overwriteAnswer = overwriteCallback.queryOverwrite(resourcePath
.makeRelative().toString());
if (overwriteAnswer.equals(IOverwriteQuery.CANCEL)) {
throw new OperationCanceledException(DataTransferMessages.DataTransfer_emptyString);
}
if (overwriteAnswer.equals(IOverwriteQuery.NO)) {
return false;
}
if (overwriteAnswer.equals(IOverwriteQuery.NO_ALL)) {
this.overwriteState = OVERWRITE_NONE;
return false;
}
if (overwriteAnswer.equals(IOverwriteQuery.ALL)) {
this.overwriteState = OVERWRITE_ALL;
}
return true;
}
开发者ID:crapo,项目名称:sadlos2,代码行数:33,代码来源:OwlImportOperation.java
示例12: ensureTargetDirectoryIsValid
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* If the target for export does not exist then attempt to create it. Answer a boolean indicating whether the target
* exists (ie.- if it either pre-existed or this method was able to create it)
*/
private boolean ensureTargetDirectoryIsValid(File targetDirectory) {
if (targetDirectory.exists() && !targetDirectory.isDirectory()) {
displayErrorDialog(DataTransferMessages.FileExport_directoryExists);
giveFocusToDestination();
return false;
}
return ensureDirectoryExists(targetDirectory);
}
开发者ID:eclipse,项目名称:n4js,代码行数:14,代码来源:AbstractExportToSingleFileWizardPage.java
示例13: createOptionsGroupButtons
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
@Override
protected void createOptionsGroupButtons(Group optionsGroup) {
Font font = optionsGroup.getFont();
optionsGroup.setLayout(new GridLayout(2, true));
Composite left = new Composite(optionsGroup, SWT.NONE);
left.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false));
left.setLayout(new GridLayout(1, true));
// compress... checkbox
compressContentsCheckbox = new Button(left, SWT.CHECK | SWT.LEFT);
compressContentsCheckbox.setText(DataTransferMessages.ZipExport_compressContents);
compressContentsCheckbox.setFont(font);
}
开发者ID:eclipse,项目名称:n4js,代码行数:16,代码来源:ExportSelectionPage.java
示例14: getProjectLabel
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Gets the label to be used when rendering this project record in the UI.
*
* @return String the label
* @since 3.4
*/
public String getProjectLabel() {
final String path =
projectSystemFile == null ? structureProvider.getLabel(parent) : projectSystemFile.getParent();
return NLS.bind(DataTransferMessages.WizardProjectsImportPage_projectLabel, projectName, path);
}
开发者ID:gama-platform,项目名称:gama,代码行数:13,代码来源:ImportProjectWizardPage.java
示例15: updateProjectsStatus
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
private void updateProjectsStatus() {
projectsList.refresh(true);
final ProjectRecord[] projects = getProjectRecords();
boolean displayConflictWarning = false;
boolean displayInvalidWarning = false;
for (final ProjectRecord project : projects) {
if (project.hasConflicts || project.isInvalid) {
projectsList.setGrayed(project, true);
displayConflictWarning |= project.hasConflicts;
displayInvalidWarning |= project.isInvalid;
} else {
projectsList.setChecked(project, true);
}
}
if (displayConflictWarning && displayInvalidWarning) {
setMessage(DataTransferMessages.WizardProjectsImportPage_projectsInWorkspaceAndInvalid, WARNING);
} else if (displayConflictWarning) {
setMessage(DataTransferMessages.WizardProjectsImportPage_projectsInWorkspace, WARNING);
} else if (displayInvalidWarning) {
setMessage(DataTransferMessages.WizardProjectsImportPage_projectsInvalid, WARNING);
} else {
setMessage("Select a directory or an archive to search for existing GAMA projects.");
}
setPageComplete(projectsList.getCheckedElements().length > 0);
if (selectedProjects.length == 0) {
setMessage(DataTransferMessages.WizardProjectsImportPage_noProjectsToImport, WARNING);
}
}
开发者ID:gama-platform,项目名称:gama,代码行数:32,代码来源:ImportProjectWizardPage.java
示例16: handleLocationDirectoryButtonPressed
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* The browse button has been selected. Select the location.
*/
protected void handleLocationDirectoryButtonPressed() {
final DirectoryDialog dialog = new DirectoryDialog(directoryPathField.getShell(), SWT.SHEET);
dialog.setMessage(DataTransferMessages.WizardProjectsImportPage_SelectDialogTitle);
String dirName = directoryPathField.getText().trim();
if (dirName.length() == 0) {
dirName = previouslyBrowsedDirectory;
}
if (dirName.length() == 0) {
dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace().getRoot().getLocation().toOSString());
} else {
final File path = new File(dirName);
if (path.exists()) {
dialog.setFilterPath(new Path(dirName).toOSString());
}
}
final String selectedDirectory = dialog.open();
if (selectedDirectory != null) {
previouslyBrowsedDirectory = selectedDirectory;
directoryPathField.setText(previouslyBrowsedDirectory);
updateProjectsList(selectedDirectory);
}
}
开发者ID:gama-platform,项目名称:gama,代码行数:31,代码来源:ImportProjectWizardPage.java
示例17: handleLocationArchiveButtonPressed
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* The browse button has been selected. Select the location.
*/
protected void handleLocationArchiveButtonPressed() {
final FileDialog dialog = new FileDialog(archivePathField.getShell(), SWT.SHEET);
dialog.setFilterExtensions(FILE_IMPORT_MASK);
dialog.setText(DataTransferMessages.WizardProjectsImportPage_SelectArchiveDialogTitle);
String fileName = archivePathField.getText().trim();
if (fileName.length() == 0) {
fileName = previouslyBrowsedArchive;
}
if (fileName.length() == 0) {
dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace().getRoot().getLocation().toOSString());
} else {
final File path = new File(fileName).getParentFile();
if (path != null && path.exists()) {
dialog.setFilterPath(path.toString());
}
}
final String selectedArchive = dialog.open();
if (selectedArchive != null) {
previouslyBrowsedArchive = selectedArchive;
archivePathField.setText(previouslyBrowsedArchive);
updateProjectsList(selectedArchive);
}
}
开发者ID:gama-platform,项目名称:gama,代码行数:32,代码来源:ImportProjectWizardPage.java
示例18: handleLocationDirectoryButtonPressed
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* The browse button has been selected. Select the location.
*/
protected void handleLocationDirectoryButtonPressed()
{
DirectoryDialog dialog = new DirectoryDialog(directoryPathField.getShell());
dialog.setMessage(DataTransferMessages.WizardProjectsImportPage_SelectDialogTitle);
String dirName = directoryPathField.getText().trim();
if (dirName.length() == 0)
{
dirName = previouslyBrowsedDirectory;
}
if (dirName.length() == 0)
{
dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace().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);
}
setProjectName();
setPageComplete(directoryPathField.getText() != null);
}
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:41,代码来源:WizardFolderImportPage.java
示例19: AbstractEnsembleProjectExportWizardPage
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Create an instance of this class.
*
* @param selection the selection
*/
public AbstractEnsembleProjectExportWizardPage(IStructuredSelection selection) {
this("fileSystemExportPage1", selection); //$NON-NLS-1$
setTitle(DataTransferMessages.DataTransfer_fileSystemTitle);
setDescription(DataTransferMessages.FileExport_exportLocalFileSystem);
this.currentSelection = selection;
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:12,代码来源:AbstractEnsembleProjectExportWizardPage.java
示例20: createOverwriteExisting
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; //导入依赖的package包/类
/**
* Create the button for checking if we should ask if we are going to
* overwrite existing files.
* @param optionsGroup
* @param font
*/
protected void createOverwriteExisting(Group optionsGroup, Font font) {
// overwrite... checkbox
overwriteExistingFilesCheckbox = new Button(optionsGroup, SWT.CHECK
| SWT.LEFT);
overwriteExistingFilesCheckbox.setText(DataTransferMessages.ExportFile_overwriteExisting);
overwriteExistingFilesCheckbox.setFont(font);
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:14,代码来源:AbstractEnsembleProjectExportWizardPage.java
注:本文中的org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论