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


Java SaveAsDialog.OK属性代码示例

本文整理汇总了Java中org.eclipse.ui.dialogs.SaveAsDialog.OK属性的典型用法代码示例。如果您正苦于以下问题:Java SaveAsDialog.OK属性的具体用法?Java SaveAsDialog.OK怎么用?Java SaveAsDialog.OK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.ui.dialogs.SaveAsDialog的用法示例。


在下文中一共展示了SaveAsDialog.OK属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

protected void execute(IAction action)
	throws InvocationTargetException, InterruptedException {
	ISVNProperty svnProperty = getSelectedSvnProperties()[0];

	SaveAsDialog dialog = new SaveAsDialog(getShell());

	if (dialog.open() != SaveAsDialog.OK)
		return;

	IFile file =
		ResourcesPlugin.getWorkspace().getRoot().getFile(
			dialog.getResult());
	try {
		ByteArrayInputStream is =
			new ByteArrayInputStream(svnProperty.getData());
		file.create(is, true, null);
	} catch (CoreException e) {
		throw new InvocationTargetException(e);
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:20,代码来源:SVNPropertySaveAction.java

示例2: doSaveAs

@Override
public void doSaveAs() {
  SaveAsDialog saveas = new SaveAsDialog(getSite().getShell());
  IFile saveAs = getSaveAsFile();
  saveas.setOriginalFile(saveAs);
  saveas.setOriginalName(saveAs.getName());
  if (saveas.open() != SaveAsDialog.OK) {
    return;
  }

  // get the file relatively to the workspace.
  IFile saveFile = calcViewFile(saveas.getResult());
  // TODO: set up a progress monitor
  saveFile(saveFile, null, "saveAs");

  baseName = buildFileInputBaseName(saveFile);
  setPartName(saveFile.getName());

  FileEditorInput effInput = new FileEditorInput(saveFile);
  setInputWithNotify(effInput);
}
 
开发者ID:google,项目名称:depan,代码行数:21,代码来源:ViewEditor.java

示例3: doSaveAs

@Override
public void doSaveAs() {
  SaveAsDialog saveas = new SaveAsDialog(getSite().getShell());
  saveas.setOriginalFile(file);
  saveas.setOriginalName(propInfo.getName());
  if (saveas.open() != SaveAsDialog.OK) {
    return;
  }

  // get the file relatively to the workspace.
  IFile saveFile = WorkspaceTools.calcViewFile(
      saveas.getResult(), RelationSetResources.EXTENSION);
  // TODO: set up a progress monitor
  file = saveFile;
  handleDocumentChange();
  persistDocument(null);
}
 
开发者ID:google,项目名称:depan,代码行数:17,代码来源:RelationDisplayEditor.java

示例4: doSaveAs

@Override
public void doSaveAs() {
  SaveAsDialog saveas = new SaveAsDialog(getSite().getShell());
  saveas.setOriginalFile(file);
  saveas.setOriginalName(matcherInfo.getName());
  if (saveas.open() != SaveAsDialog.OK) {
    return;
  }

  // get the file relatively to the workspace.
  IFile saveFile = WorkspaceTools.calcViewFile(
      saveas.getResult(), GraphEdgeMatcherResources.EXTENSION);
  // TODO: set up a progress monitor
  file = saveFile;
  handleDocumentChange();
  persistDocument(null);
}
 
开发者ID:google,项目名称:depan,代码行数:17,代码来源:EdgeMatcherEditor.java

示例5: doSaveAs

@Override
public void doSaveAs() {
  SaveAsDialog saveas = new SaveAsDialog(getSite().getShell());
  saveas.setOriginalFile(file);
  saveas.setOriginalName(relSetInfo.getName());
  if (saveas.open() != SaveAsDialog.OK) {
    return;
  }

  // get the file relatively to the workspace.
  IFile saveFile = WorkspaceTools.calcViewFile(
      saveas.getResult(), RelationSetResources.EXTENSION);
  // TODO: set up a progress monitor
  file = saveFile;
  handleDocumentChange();
  persistDocument(null);
}
 
开发者ID:google,项目名称:depan,代码行数:17,代码来源:RelationSetDescriptorEditor.java

示例6: handleProjectJarnameBrowse

/**
 * Uses the standard container selection dialog to choose the new value for
 * the container field.
 */

private void handleProjectJarnameBrowse() {
	String jarname = getJarname();
	SaveAsDialog dialog = new SaveAsDialog(getShell());
	String name = jarname;
	if (name == null) {
		name = "fatjar_output.jar";
	}
	IProject project = jproject.getProject();

	IFile iFile = project.getFile(name);

	dialog.setOriginalFile(iFile);
	dialog.setTitle("Select Output Jar-Name"); //$NON-NLS-1$

	if (dialog.open() == SaveAsDialog.OK) {
		IPath saveFile = dialog.getResult();
		if (saveFile != null) {
			String path = saveFile.toString();
			String projectName = jproject.getElementName();
			if (!path.startsWith("/" + projectName + "/")) {
				MessageDialog.openInformation(getShell(), "Fat Jar Select Output",
						"output must be stored in project " + projectName);
			} else {
				if (!"jar".equals(saveFile.getFileExtension().toLowerCase()))
					saveFile = saveFile.addFileExtension("jar");
				saveFile = saveFile.removeFirstSegments(1).removeTrailingSeparator();
				jarnameText.setText(saveFile.toOSString());
			}
		}
	}
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:36,代码来源:FJExportWizardConfigPage.java

示例7: handleProjectJarnameBrowse

/**
 * Uses the standard container selection dialog to
 * choose the new value for the container field.
 */

private void handleProjectJarnameBrowse() {

        String jarname = getJarname();
        SaveAsDialog dialog = new SaveAsDialog(getShell());
        String name = jarname;
        if (name == null) {
                name = "fatjar_output.jar";
        }
        IFile iFile = jproject.getIFile(name);
        
        dialog.setOriginalFile(iFile);
        dialog.setTitle("Select Output Jar-Name"); //$NON-NLS-1$

        if (dialog.open() == SaveAsDialog.OK) {
                IPath saveFile= dialog.getResult();
                if (saveFile != null) {
                        String path = saveFile.toString();
                        String projectName = jproject.getJproject().getElementName();
                        if (!path.startsWith("/" + projectName + "/")) {
                                MessageDialog.openInformation(getShell(), "Fat Jar Select Output", "output must be stored in project " + projectName);
                        }
                        else {
                                if (!"jar".equals(saveFile.getFileExtension().toLowerCase()))
                                        saveFile = saveFile.addFileExtension("jar");
                                saveFile = saveFile.removeFirstSegments(1).removeTrailingSeparator();
                                jarnameText.setText(saveFile.toOSString());
                        }
                }
        }
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:35,代码来源:ConfigPage.java

示例8: handleSaveSettings

private void handleSaveSettings() {

        SaveAsDialog dialog = new SaveAsDialog(getShell());
        String name = BuildFatJar.absPropertiesFilename;
        if (name == null) {
            name = "settings.fatjar";
        }
        int pos = name.lastIndexOf(File.separatorChar);
        if (pos != -1) {
            name = name.substring(pos+1);
        }
        IProject project = jproject.getJproject().getProject();
        
        IFile iFile = project.getFile(name);
        
        
        dialog.setOriginalFile(iFile);
//        dialog.setOriginalName(name);
        dialog.setTitle("Save FatJar Settings"); //$NON-NLS-1$

        if (dialog.open() == SaveAsDialog.OK) {
            IPath saveFile= dialog.getResult();
            if (saveFile != null) {
                String path = saveFile.toString();
                String projectName = jproject.getJproject().getElementName();
                if (!path.startsWith("/" + projectName + "/")) {
                    MessageDialog.openInformation(getShell(), "Fat Jar Save Settings", "settings must be stored in project " + projectName);
                }
                else {
                    if (!"fatjar".equals(saveFile.getFileExtension()))
                        saveFile = saveFile.addFileExtension("fatjar");
                    BuildProperties buildProps = fjew.getBuildProperties();
                    if (buildProps != null) {
                        saveConfig(saveFile, buildProps.toProperties());
                    }
                }
            }
        }
    }
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:39,代码来源:FilesSelectPage.java

示例9: handleExportANT

private void handleExportANT() {

        SaveAsDialog dialog = new SaveAsDialog(getShell());
        String name = "build.xml";

        IProject project = jproject.getJproject().getProject();
        
        IFile iFile = project.getFile(name);
        
        dialog.setOriginalFile(iFile);
//        dialog.setOriginalName(name);
        dialog.setTitle("Export ANT build file"); //$NON-NLS-1$

        if (dialog.open() == SaveAsDialog.OK) {
            IPath saveFile= dialog.getResult();
            if (saveFile != null) {
                String path = saveFile.toString();
                String projectName = jproject.getJproject().getElementName();
                if (!"xml".equals(saveFile.getFileExtension()))
                    saveFile = saveFile.addFileExtension("xml");
                
                boolean ok = true;
                IFile buildFile = project.getWorkspace().getRoot().getFile(saveFile);
                if (buildFile != null) {
                    IStatus status = AguiPlugin.askFileWriteAccess(buildFile);
                    if ((status != null) && !status.isOK()) {
                        ok = false;
                        Shell shell = new Shell();
                        MessageDialog.openError(shell, "Fat Jar Plug-In Error", "Export ANT, write access denied: " + status.toString());
                    }
                }
                if (ok) {
                    SourceInfo[] sourceInfo = getANTBuildInfo();
                    exportANTBuild(saveFile, sourceInfo);
                }
            }
        }
    }
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:38,代码来源:FilesSelectPage.java

示例10: doSaveAsDialog

private IFile doSaveAsDialog() {
  SaveAsDialog saveas = new SaveAsDialog(getSite().getShell());
  IFile saveAs = getSaveAsFile();
  saveas.setOriginalFile(saveAs);
  saveas.setOriginalName(saveAs.getName());
  if (saveas.open() != SaveAsDialog.OK) {
    return null;
  }

  // get the file relatively to the workspace.
  IFile saveFile = WorkspaceTools.calcViewFile(
      saveas.getResult(), NodeListDocument.EXTENSION);

  return saveFile;
}
 
开发者ID:google,项目名称:depan,代码行数:15,代码来源:NodeListEditor.java

示例11: handleWorkspaceBrowse

/**
 * Query the user for a file path and name.
 * 
 * @return the file URI as a string with extension {@code ".klaviz"}.
 */
private String handleWorkspaceBrowse() {
    // TODO a better workspace selection dialog would be good, but it seems
    // such a thing does not exist in Eclipse for some reason
    final SaveAsDialog fileDialog =
            new SaveAsDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
    final int status = fileDialog.open();
    if (status == SaveAsDialog.OK) {
        final IPath filePath = fileDialog.getResult();
        return filePath.removeFileExtension().addFileExtension("klaviz").toString();
    } else {
        return null;
    }
}
 
开发者ID:OpenKieler,项目名称:klassviz,代码行数:18,代码来源:GenerateKlassVizFileHandler.java

示例12: handleSaveSettings

private void handleSaveSettings() {

		SaveAsDialog dialog = new SaveAsDialog(getShell());
		String name = BuildFatJar.absPropertiesFilename;
		if (name == null) {
			name = "settings.fatjar";
		}
		int pos = name.lastIndexOf(File.separatorChar);
		if (pos != -1) {
			name = name.substring(pos + 1);
		}
		IProject project = jproject.getProject();

		IFile iFile = project.getFile(name);

		dialog.setOriginalFile(iFile);
		// dialog.setOriginalName(name);
		dialog.setTitle("Save FatJar Settings"); //$NON-NLS-1$

		if (dialog.open() == SaveAsDialog.OK) {
			IPath saveFile = dialog.getResult();
			if (saveFile != null) {
				String path = saveFile.toString();
				String projectName = jproject.getElementName();
				if (!path.startsWith("/" + projectName + "/")) {
					MessageDialog
							.openInformation(getShell(),
									"Fat Jar Save Settings",
									"settings must be stored in project "
											+ projectName);
				} else {
					if (!"fatjar".equals(saveFile.getFileExtension()))
						saveFile = saveFile.addFileExtension("fatjar");
					Properties props = fjew.getProperties();
					if (props != null) {
						saveConfig(saveFile, props);
					}
				}
			}
		}
	}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:41,代码来源:FJExportWizardFilesSelectPage.java

示例13: handleExportANT

private void handleExportANT() {

		SaveAsDialog dialog = new SaveAsDialog(getShell());
		String name = "build.xml";

		IProject project = jproject.getProject();

		IFile iFile = project.getFile(name);

		dialog.setOriginalFile(iFile);
		// dialog.setOriginalName(name);
		dialog.setTitle("Export ANT build file"); //$NON-NLS-1$

		if (dialog.open() == SaveAsDialog.OK) {
			IPath saveFile = dialog.getResult();
			if (saveFile != null) {
				String path = saveFile.toString();
				String projectName = jproject.getElementName();
				if (!"xml".equals(saveFile.getFileExtension()))
					saveFile = saveFile.addFileExtension("xml");

				boolean ok = true;
				IFile buildFile = project.getWorkspace().getRoot().getFile(
						saveFile);
				if (buildFile != null) {
					IStatus status = AguiPlugin.askFileWriteAccess(buildFile);
					if ((status != null) && !status.isOK()) {
						ok = false;
						Shell shell = new Shell();
						MessageDialog.openError(shell, "Fat Jar Plug-In Error",
								"Export ANT, write access denied: "
										+ status.toString());
					}
				}
				if (ok) {
					SourceInfo[] sourceInfo = getANTBuildInfo();
					exportANTBuild(saveFile, sourceInfo);
				}
			}
		}
	}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:41,代码来源:FJExportWizardFilesSelectPage.java


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