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


Java SaveAsDialog.setOriginalName方法代码示例

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


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

示例1: opeSaveAsDialog

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
private IFile opeSaveAsDialog() {
	logger.debug("opeSaveAsDialog - Opening SaveAs dialog box.");
	SaveAsDialog obj = new SaveAsDialog(Display.getDefault().getActiveShell());
	IFile file=null;
	if (getEditorInput().getName().endsWith(".job"))
	{
		obj.setOriginalName(getEditorInput().getName());
	}
	else
		obj.setOriginalName(getEditorInput().getName() + ".job");
	oldFileName=getEditorInput().getName();
	obj.open();
	if (obj.getReturnCode() == 0) {
		validateLengthOfJobName(obj);
	}
	if(obj.getResult()!=null&&obj.getReturnCode()!=1) {
		IPath filePath = obj.getResult().removeFileExtension().addFileExtension("job");
		file= ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
	}
	
	return file;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:ELTGraphicalEditor.java

示例2: validateLengthOfJobName

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 * 
 * Validates length of job name
 * 
 * @param {@link SaveAsDialog}
 */
public void validateLengthOfJobName(SaveAsDialog saveAsDialog) {
	String jobName=saveAsDialog.getResult().removeFileExtension().lastSegment();
	while(jobName.length()>50)
	{
		jobName=saveAsDialog.getResult().removeFileExtension().lastSegment();
		if(jobName.length()>50)
		{
			MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_ERROR | SWT.OK);
			messageBox.setText("Error");
			messageBox.setMessage("File Name Too Long");
			if(messageBox.open()==SWT.OK)
			{
				saveAsDialog.setOriginalName(jobName+".job");
				IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(saveAsDialog.getResult());
				saveAsDialog.setOriginalFile(file);
				saveAsDialog.open();
				if(saveAsDialog.getReturnCode()==1)
					break;
			}
		}
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:29,代码来源:ELTGraphicalEditor.java

示例3: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
@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,代码行数:22,代码来源:ViewEditor.java

示例4: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
@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,代码行数:18,代码来源:RelationDisplayEditor.java

示例5: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
@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,代码行数:18,代码来源:EdgeMatcherEditor.java

示例6: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
@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,代码行数:18,代码来源:RelationSetDescriptorEditor.java

示例7: run

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
@Override
public void run() {
	TreeSelection s = (TreeSelection) treeViewer.getSelection();
	TreePath[] p = s.getPaths();

	for (int i = 0; i < p.length; i++) {
		Object obj = p[i].getLastSegment();
		if (obj instanceof MDataAdapter) {
			SaveAsDialog saveAsDialog = new SaveAsDialog(Display.getDefault().getActiveShell());
			saveAsDialog.setOriginalName(((MDataAdapter) obj).getValue().getName().replace(" ", "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
			saveAsDialog.open();
			IPath path = saveAsDialog.getResult();
			if (path != null)
				saveFile(obj, path);
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:ExportDataAdapterAction.java

示例8: doSaveAsDialog

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
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,代码行数:16,代码来源:NodeListEditor.java

示例9: querySaveAsFilePath

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
private IPath querySaveAsFilePath() {
  SaveAsDialog dialog = new SaveAsDialog( getSite().getShell() );
  IEditorInput editorInput = getEditorInput();
  IFile originalFile = ResourceUtil.getFile( editorInput );
  if( originalFile != null ) {
    dialog.setOriginalFile( originalFile );
  } else {
    dialog.setOriginalName( editorInput.getName() );
  }
  int dialogResult = dialog.open();
  return dialogResult == Window.OK ? dialog.getResult() : null;
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:13,代码来源:ImageViewerEditor.java

示例10: preDownload

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
@Override
protected boolean preDownload(AFileResource fres) {
	SaveAsDialog saveAsDialog = new SaveAsDialog(Display.getDefault().getActiveShell());
	saveAsDialog.setOriginalName(AExporter.getNewFileName(fres.getValue(), "." + fres.getDefaultFileExtension()));
	if (saveAsDialog.open() == Dialog.OK) {
		path = saveAsDialog.getResult();
		return true;
	}
	return false;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:DownloadFileAction.java


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