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


Java SaveAsDialog.getResult方法代码示例

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


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

示例1: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 * This also changes the editor's input.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void doSaveAs ()
{
    SaveAsDialog saveAsDialog = new SaveAsDialog ( getSite ().getShell () );
    saveAsDialog.open ();
    IPath path = saveAsDialog.getResult ();
    if ( path != null )
    {
        IFile file = ResourcesPlugin.getWorkspace ().getRoot ().getFile ( path );
        if ( file != null )
        {
            doSaveAs ( URI.createPlatformResourceURI ( file.getFullPath ().toString (), true ), new FileEditorInput ( file ) );
        }
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:ProtocolEditor.java

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

示例3: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
@Override
public void doSaveAs() {
	URI chartURI = getChartURI(true);
	SaveAsDialog dlg = new SaveAsDialog(getSite().getShell());
	dlg.setOriginalFile(EMFUtils.getFile(chartURI));
	if (dlg.open() == Window.OK) {
		IPath path = dlg.getResult();
		URI newChartURI = EMFUtils.getURI(path);
		try {
			Resource resource = timelineModel.eResource();
			resource.setURI(newChartURI);
			resource.save(null);
			dirtyMonitor.resetDirty();
			setChartURI(newChartURI);
			setInput(new FileEditorInput(EMFUtils.getFile(newChartURI)));
			setPartName(newChartURI.lastSegment());
		} catch (IOException e) {
			LogUtil.error(e);
		}
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:22,代码来源:ChartEditor.java

示例4: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 * This also changes the editor's input.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void doSaveAs() {
	SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
	saveAsDialog.open();
	IPath path = saveAsDialog.getResult();
	if (path != null) {
		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
		if (file != null) {
			doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
		}
	}
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:19,代码来源:NfpEditor.java

示例5: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 * This also changes the editor's input.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated
 */
@Override
public void doSaveAs() {
    SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
    saveAsDialog.open();
    IPath path = saveAsDialog.getResult();
    if (path != null) {
        IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
        if (file != null) {
            doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
        }
    }
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:20,代码来源:GenconfEditor.java

示例6: handleProjectJarnameBrowse

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

示例7: handleProjectJarnameBrowse

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

示例8: handleSaveSettings

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

示例9: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 * @see org.eclipse.ui.ISaveablePart#doSaveAs()
 */
public void doSaveAs() {
    // Retrieves the file input.
    IEditorInput editorInput = this.getEditorInput();
    IFile ifile = null;
    if (editorInput instanceof IFileEditorInput) {
        ifile = ((IFileEditorInput) editorInput).getFile();
    }
    // ask user for file
    SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
    if (ifile != null) {
        saveAsDialog.setOriginalFile(ifile);
    }
    saveAsDialog.open();
    IPath path = saveAsDialog.getResult();
    if (path != null) {
        IFile ifileNew = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
        if (ifileNew != null) {
            IProgressMonitor progressMonitor = getEditorSite().getActionBars().getStatusLineManager()
                    .getProgressMonitor();
            // save now
            doSave(progressMonitor, ifileNew, null);
            // refresh editor to new file
            setInput(new FileEditorInput(ifileNew));
        }
    }
}
 
开发者ID:anb0s,项目名称:eclox,代码行数:30,代码来源:Editor.java

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

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

示例12: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
   * This also changes the editor's input.
   * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
   * @generated
   */
@Override
public void doSaveAs() {
     SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
     saveAsDialog.open();
     IPath path = saveAsDialog.getResult();
     if (path != null) {
        IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
        if (file != null) {
           doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
        }
     }
  }
 
开发者ID:lbroudoux,项目名称:eip-designer,代码行数:19,代码来源:EipEditor.java

示例13: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 * This also changes the editor's input.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void doSaveAs() {
	SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
	saveAsDialog.open();
	IPath path = saveAsDialog.getResult();
	if (path != null) {
		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
		if (file != null) {
			doSaveAs(URI.createPlatformResourceURI(file.getFullPath()
					.toString(), true), new FileEditorInput(file));
		}
	}
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:20,代码来源:DiEditor.java

示例14: handleDescriptionFileBrowseButtonPressed

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 *	Open an appropriate destination browser so that the user can specify a source
 *	to import from
 */
protected void handleDescriptionFileBrowseButtonPressed() {
	SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell());
	dialog.create();
	dialog.getShell().setText(JarPackagerMessages.JarOptionsPage_saveAsDialog_title);
	dialog.setMessage(JarPackagerMessages.JarOptionsPage_saveAsDialog_message);
	dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation()));
	if (dialog.open() == Window.OK) {
		IPath path= dialog.getResult();
		path= path.removeFileExtension().addFileExtension(JarPackagerUtil.DESCRIPTION_EXTENSION);
		fDescriptionFileText.setText(path.toString());
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:JarOptionsPage.java

示例15: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 * This also changes the editor's input. <!-- begin-user-doc --> <!--
 * end-user-doc -->
 * 
 * @generated
 */
@Override
public void doSaveAs() {
	SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
	saveAsDialog.open();
	IPath path = saveAsDialog.getResult();
	if (path != null) {
		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
		if (file != null) {
			doSaveAs(URI.createPlatformResourceURI(file.getFullPath()
				.toString(), true), new FileEditorInput(file));
		}
	}
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:20,代码来源:ConfigEditor.java


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