Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.SaveAsDialog


   * @generated
   */
  protected void performSaveAs(IProgressMonitor progressMonitor) {
    Shell shell = getSite().getShell();
    IEditorInput input = getEditorInput();
    SaveAsDialog dialog = new SaveAsDialog(shell);
    IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input)
        .getFile()
        : null;
    if (original != null) {
      dialog.setOriginalFile(original);
    }
    dialog.create();
    IDocumentProvider provider = getDocumentProvider();
    if (provider == null) {
      // editor has been programmatically closed while the dialog was open
      return;
    }
    if (provider.isDeleted(input) && original != null) {
      String message = NLS.bind(
          Messages.Fd2DiagramEditor_SavingDeletedFile, original
              .getName());
      dialog.setErrorMessage(null);
      dialog.setMessage(message, IMessageProvider.WARNING);
    }
    if (dialog.open() == Window.CANCEL) {
      if (progressMonitor != null) {
        progressMonitor.setCanceled(true);
      }
      return;
    }
    IPath filePath = dialog.getResult();
    if (filePath == null) {
      if (progressMonitor != null) {
        progressMonitor.setCanceled(true);
      }
      return;
View Full Code Here


   * <!-- 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));
      }
View Full Code Here

   * <!-- 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));
      }
View Full Code Here

    return true;
  }

  @Override
  public void run() {
    SaveAsDialog dialog = new SaveAsDialog(getWorkbenchPart().getSite().getShell());
    dialog.setOriginalName(Messages.ExportAction_JPEG_ORIGINAL_TITLE);
    dialog.create();
    dialog.setMessage(BeansGraphPlugin.getResourceString("Editor.SaveAsDialog.message")); //$NON-NLS-1$
    dialog.setOriginalName(Messages.ExportAction_PNG_ORIGINAL_TITLE);
    dialog.open();
    IPath path = dialog.getResult();
    if (path != null) {
      IWorkspace workspace = ResourcesPlugin.getWorkspace();
      IFile file = workspace.getRoot().getFile(path);
      String ext = file.getFileExtension();
      if (ext == null || ext.length() == 0
View Full Code Here

    setImageDescriptor(BeansGraphImages.DESC_OBJS_EXPORT_ENABLED);
    setDisabledImageDescriptor(BeansGraphImages.DESC_OBJS_EXPORT_DISABLED);
  }

  public void run() {
    SaveAsDialog dialog = new SaveAsDialog(getWorkbenchPart().getSite().getShell());
    dialog.setOriginalName("graph.jpg");
    dialog.create();
    dialog.setMessage(BeansGraphPlugin.getResourceString("Editor.SaveAsDialog.message"));
    dialog.setOriginalName("graph.png");
    dialog.open();
    IPath path = dialog.getResult();
    if (path != null) {
      IWorkspace workspace = ResourcesPlugin.getWorkspace();
      IFile file = workspace.getRoot().getFile(path);
      String ext = file.getFileExtension();
      if (ext == null
View Full Code Here

  public void doSave(IProgressMonitor monitor) {
  }

  @Override
  public void doSaveAs() {
    SaveAsDialog dialog = new SaveAsDialog(getSite().getShell());
    dialog.setOriginalName("graph.jpg");
    dialog.create();
    dialog.setMessage(BeansGraphPlugin.getResourceString("Editor.SaveAsDialog.message"));
    dialog.setOriginalName("graph.png");
    dialog.open();
    IPath path = dialog.getResult();
    if (path != null) {
      IWorkspace workspace = ResourcesPlugin.getWorkspace();
      IFile file = workspace.getRoot().getFile(path);
      String ext = file.getFileExtension();
      if (ext == null || ext.length() == 0
View Full Code Here

    setImageDescriptor(WebflowImages.DESC_OBJS_EXPORT_ENABLED);
    setDisabledImageDescriptor(WebflowImages.DESC_OBJS_EXPORT_DISABLED);
  }

  public void run() {
    SaveAsDialog dialog = new SaveAsDialog(getWorkbenchPart().getSite()
        .getShell());
    IFile editorFile = ((WebflowEditorInput) this.editor.getEditorInput())
        .getFile();
    String fileName = editorFile.getName();
    fileName = fileName.substring(0, fileName.lastIndexOf("."));
    dialog.setTitle("Export to image");
    dialog.setOriginalFile(editorFile);
    dialog.create();
    dialog.setMessage("Specify a name and location for the image. Either enter .png, .jpg or .bmp extension.");
    dialog.open();
    IPath path = dialog.getResult();
    if (path != null) {
      IWorkspace workspace = ResourcesPlugin.getWorkspace();
      IFile file = workspace.getRoot().getFile(path);
      String ext = file.getFileExtension();
      if (ext == null
View Full Code Here

  public boolean isSaveOnCloseNeeded() {
    return getCommandStack().isDirty();
  }

  public boolean performSaveAs() {
    SaveAsDialog dialog = new SaveAsDialog(getSite().getWorkbenchWindow()
        .getShell());
    dialog.setOriginalFile(((WebflowEditorInput) getEditorInput())
        .getFile());
    dialog.open();
    IPath path = dialog.getResult();

    this.isCurrentlySaving = true;

    if (path == null)
      return false;
View Full Code Here

   *
   * @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 ) );
      }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.dialogs.SaveAsDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.