类org.eclipse.ui.dialogs.SaveAsDialog源码实例Demo

下面列出了怎么用org.eclipse.ui.dialogs.SaveAsDialog的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: neoscada   文件: ProtocolEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码2 项目: neoscada   文件: ChartEditor.java
/**
 * This also changes the editor's input.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated
 */
@Override
public void doSaveAs ()
{
    final SaveAsDialog saveAsDialog = new SaveAsDialog ( getSite ().getShell () );
    saveAsDialog.open ();
    final IPath path = saveAsDialog.getResult ();
    if ( path != null )
    {
        final IFile file = ResourcesPlugin.getWorkspace ().getRoot ().getFile ( path );
        if ( file != null )
        {
            doSaveAs ( URI.createPlatformResourceURI ( file.getFullPath ()
                    .toString (), true ), new FileEditorInput ( file ) );
        }
    }
}
 
源代码3 项目: neoscada   文件: DetailViewEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码4 项目: neoscada   文件: VisualInterfaceEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码5 项目: neoscada   文件: DeploymentEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码6 项目: neoscada   文件: SetupEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码7 项目: neoscada   文件: ProfileEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码8 项目: neoscada   文件: OsgiEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码9 项目: neoscada   文件: WorldEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码10 项目: neoscada   文件: MemoryEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码11 项目: neoscada   文件: RecipeEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码12 项目: neoscada   文件: InfrastructureEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码13 项目: neoscada   文件: SecurityEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码14 项目: neoscada   文件: GlobalizeEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码15 项目: neoscada   文件: ComponentEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码16 项目: neoscada   文件: ItemEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码17 项目: neoscada   文件: ConfigurationEditor.java
/**
 * 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 ) );
        }
    }
}
 
源代码18 项目: depan   文件: ViewEditor.java
@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);
}
 
源代码19 项目: depan   文件: RelationDisplayEditor.java
@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);
}
 
源代码20 项目: depan   文件: EdgeMatcherEditor.java
@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);
}
 
源代码21 项目: depan   文件: RelationSetDescriptorEditor.java
@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);
}
 
源代码22 项目: APICloud-Studio   文件: SVNPropertySaveAction.java
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);
	}
}
 
源代码23 项目: scava   文件: CrossflowEditor.java
/**
 * 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));
		}
	}
}
 
源代码24 项目: M2Doc   文件: GenconfEditor.java
/**
 * 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));
        }
    }
}
 
/**
 * 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));
		}
	}
}
 
源代码26 项目: depan   文件: NodeListEditor.java
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;
}
 
源代码27 项目: eclipse-extras   文件: ImageViewerEditor.java
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;
}
 
源代码28 项目: eip-designer   文件: EipEditor.java
/**
   * 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));
        }
     }
  }
 
/**
 *	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());
	}
}
 
/**
 *	Open an appropriate dialog so that the user can specify a manifest
 *	to save
 */
protected void handleNewManifestFileBrowseButtonPressed() {
	// Use Save As dialog to select a new file inside the workspace
	SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell());
	dialog.create();
	dialog.getShell().setText(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_title);
	dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_message);
	dialog.setOriginalFile(createFileHandle(fJarPackage.getManifestLocation()));
	if (dialog.open() == Window.OK) {
		fJarPackage.setManifestLocation(dialog.getResult());
		fNewManifestFileText.setText(dialog.getResult().toString());
	}
}
 
 类所在包
 同包方法