Package org.eclipse.gmf.runtime.diagram.ui.resources.editor.document

Examples of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider


        .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.DispelDiagramEditor_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;
    }
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = workspaceRoot.getFile(filePath);
    final IEditorInput newInput = new FileEditorInput(file);
    // Check if the editor is already open
    IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
        .getEditorMatchingStrategy();
    IEditorReference[] editorRefs = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editorRefs.length; i++) {
      if (matchingStrategy.matches(editorRefs[i], newInput)) {
        MessageDialog.openWarning(shell,
            Messages.DispelDiagramEditor_SaveAsErrorTitle,
            Messages.DispelDiagramEditor_SaveAsErrorMessage);
        return;
      }
    }
    boolean success = false;
    try {
      provider.aboutToChange(newInput);
      getDocumentProvider(newInput).saveDocument(progressMonitor,
          newInput,
          getDocumentProvider().getDocument(getEditorInput()), true);
      success = true;
    } catch (CoreException x) {
      IStatus status = x.getStatus();
      if (status == null || status.getSeverity() != IStatus.CANCEL) {
        ErrorDialog.openError(shell,
            Messages.DispelDiagramEditor_SaveErrorTitle,
            Messages.DispelDiagramEditor_SaveErrorMessage,
            x.getStatus());
      }
    } finally {
      provider.changed(newInput);
      if (success) {
        setInput(newInput);
      }
    }
    if (progressMonitor != null) {
View Full Code Here


        : 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(
              eu.admire.visual.pmml.neuralnetwork._40.diagram.part.Messages.PMMLNeuralNetworkDiagramEditor_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;
    }
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = workspaceRoot.getFile(filePath);
    final IEditorInput newInput = new FileEditorInput(file);
    // Check if the editor is already open
    IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
        .getEditorMatchingStrategy();
    IEditorReference[] editorRefs = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editorRefs.length; i++) {
      if (matchingStrategy.matches(editorRefs[i], newInput)) {
        MessageDialog
            .openWarning(
                shell,
                eu.admire.visual.pmml.neuralnetwork._40.diagram.part.Messages.PMMLNeuralNetworkDiagramEditor_SaveAsErrorTitle,
                eu.admire.visual.pmml.neuralnetwork._40.diagram.part.Messages.PMMLNeuralNetworkDiagramEditor_SaveAsErrorMessage);
        return;
      }
    }
    boolean success = false;
    try {
      provider.aboutToChange(newInput);
      getDocumentProvider(newInput).saveDocument(progressMonitor,
          newInput,
          getDocumentProvider().getDocument(getEditorInput()), true);
      success = true;
    } catch (CoreException x) {
      IStatus status = x.getStatus();
      if (status == null || status.getSeverity() != IStatus.CANCEL) {
        ErrorDialog
            .openError(
                shell,
                eu.admire.visual.pmml.neuralnetwork._40.diagram.part.Messages.PMMLNeuralNetworkDiagramEditor_SaveErrorTitle,
                eu.admire.visual.pmml.neuralnetwork._40.diagram.part.Messages.PMMLNeuralNetworkDiagramEditor_SaveErrorMessage,
                x.getStatus());
      }
    } finally {
      provider.changed(newInput);
      if (success) {
        setInput(newInput);
      }
    }
    if (progressMonitor != null) {
View Full Code Here

        : 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(
              eu.admire.visual.pmml._40.diagram.part.Messages.PMMLDiagramEditor_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;
    }
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = workspaceRoot.getFile(filePath);
    final IEditorInput newInput = new FileEditorInput(file);
    // Check if the editor is already open
    IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
        .getEditorMatchingStrategy();
    IEditorReference[] editorRefs = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editorRefs.length; i++) {
      if (matchingStrategy.matches(editorRefs[i], newInput)) {
        MessageDialog
            .openWarning(
                shell,
                eu.admire.visual.pmml._40.diagram.part.Messages.PMMLDiagramEditor_SaveAsErrorTitle,
                eu.admire.visual.pmml._40.diagram.part.Messages.PMMLDiagramEditor_SaveAsErrorMessage);
        return;
      }
    }
    boolean success = false;
    try {
      provider.aboutToChange(newInput);
      getDocumentProvider(newInput).saveDocument(progressMonitor,
          newInput,
          getDocumentProvider().getDocument(getEditorInput()), true);
      success = true;
    } catch (CoreException x) {
      IStatus status = x.getStatus();
      if (status == null || status.getSeverity() != IStatus.CANCEL) {
        ErrorDialog
            .openError(
                shell,
                eu.admire.visual.pmml._40.diagram.part.Messages.PMMLDiagramEditor_SaveErrorTitle,
                eu.admire.visual.pmml._40.diagram.part.Messages.PMMLDiagramEditor_SaveErrorMessage,
                x.getStatus());
      }
    } finally {
      provider.changed(newInput);
      if (success) {
        setInput(newInput);
      }
    }
    if (progressMonitor != null) {
View Full Code Here

        .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.DispelDiagramEditor_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;
    }
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = workspaceRoot.getFile(filePath);
    final IEditorInput newInput = new FileEditorInput(file);
    // Check if the editor is already open
    IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
        .getEditorMatchingStrategy();
    IEditorReference[] editorRefs = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editorRefs.length; i++) {
      if (matchingStrategy.matches(editorRefs[i], newInput)) {
        MessageDialog.openWarning(shell,
            Messages.DispelDiagramEditor_SaveAsErrorTitle,
            Messages.DispelDiagramEditor_SaveAsErrorMessage);
        return;
      }
    }
    boolean success = false;
    try {
      provider.aboutToChange(newInput);
      getDocumentProvider(newInput).saveDocument(progressMonitor,
          newInput,
          getDocumentProvider().getDocument(getEditorInput()), true);
      success = true;
    } catch (CoreException x) {
      IStatus status = x.getStatus();
      if (status == null || status.getSeverity() != IStatus.CANCEL) {
        ErrorDialog.openError(shell,
            Messages.DispelDiagramEditor_SaveErrorTitle,
            Messages.DispelDiagramEditor_SaveErrorMessage,
            x.getStatus());
      }
    } finally {
      provider.changed(newInput);
      if (success) {
        setInput(newInput);
      }
    }
    if (progressMonitor != null) {
View Full Code Here

        : 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(
              eu.admire.visual.pmml.treemodel._40.diagram.part.Messages.PMMLTreeModelDiagramEditor_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;
    }
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = workspaceRoot.getFile(filePath);
    final IEditorInput newInput = new FileEditorInput(file);
    // Check if the editor is already open
    IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
        .getEditorMatchingStrategy();
    IEditorReference[] editorRefs = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editorRefs.length; i++) {
      if (matchingStrategy.matches(editorRefs[i], newInput)) {
        MessageDialog
            .openWarning(
                shell,
                eu.admire.visual.pmml.treemodel._40.diagram.part.Messages.PMMLTreeModelDiagramEditor_SaveAsErrorTitle,
                eu.admire.visual.pmml.treemodel._40.diagram.part.Messages.PMMLTreeModelDiagramEditor_SaveAsErrorMessage);
        return;
      }
    }
    boolean success = false;
    try {
      provider.aboutToChange(newInput);
      getDocumentProvider(newInput).saveDocument(progressMonitor,
          newInput,
          getDocumentProvider().getDocument(getEditorInput()), true);
      success = true;
    } catch (CoreException x) {
      IStatus status = x.getStatus();
      if (status == null || status.getSeverity() != IStatus.CANCEL) {
        ErrorDialog
            .openError(
                shell,
                eu.admire.visual.pmml.treemodel._40.diagram.part.Messages.PMMLTreeModelDiagramEditor_SaveErrorTitle,
                eu.admire.visual.pmml.treemodel._40.diagram.part.Messages.PMMLTreeModelDiagramEditor_SaveErrorMessage,
                x.getStatus());
      }
    } finally {
      provider.changed(newInput);
      if (success) {
        setInput(newInput);
      }
    }
    if (progressMonitor != null) {
View Full Code Here

        : 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(
              eu.admire.visual.pmml.radviz._40.diagram.part.Messages.PMMLDiagramEditor_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;
    }
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = workspaceRoot.getFile(filePath);
    final IEditorInput newInput = new FileEditorInput(file);
    // Check if the editor is already open
    IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
        .getEditorMatchingStrategy();
    IEditorReference[] editorRefs = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editorRefs.length; i++) {
      if (matchingStrategy.matches(editorRefs[i], newInput)) {
        MessageDialog
            .openWarning(
                shell,
                eu.admire.visual.pmml.radviz._40.diagram.part.Messages.PMMLDiagramEditor_SaveAsErrorTitle,
                eu.admire.visual.pmml.radviz._40.diagram.part.Messages.PMMLDiagramEditor_SaveAsErrorMessage);
        return;
      }
    }
    boolean success = false;
    try {
      provider.aboutToChange(newInput);
      getDocumentProvider(newInput).saveDocument(progressMonitor,
          newInput,
          getDocumentProvider().getDocument(getEditorInput()), true);
      success = true;
    } catch (CoreException x) {
      IStatus status = x.getStatus();
      if (status == null || status.getSeverity() != IStatus.CANCEL) {
        ErrorDialog
            .openError(
                shell,
                eu.admire.visual.pmml.radviz._40.diagram.part.Messages.PMMLDiagramEditor_SaveErrorTitle,
                eu.admire.visual.pmml.radviz._40.diagram.part.Messages.PMMLDiagramEditor_SaveErrorMessage,
                x.getStatus());
      }
    } finally {
      provider.changed(newInput);
      if (success) {
        setInput(newInput);
      }
    }
    if (progressMonitor != null) {
View Full Code Here

        .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.DispelDiagramEditor_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;
    }
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = workspaceRoot.getFile(filePath);
    final IEditorInput newInput = new FileEditorInput(file);
    // Check if the editor is already open
    IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
        .getEditorMatchingStrategy();
    IEditorReference[] editorRefs = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editorRefs.length; i++) {
      if (matchingStrategy.matches(editorRefs[i], newInput)) {
        MessageDialog.openWarning(shell,
            Messages.DispelDiagramEditor_SaveAsErrorTitle,
            Messages.DispelDiagramEditor_SaveAsErrorMessage);
        return;
      }
    }
    boolean success = false;
    try {
      provider.aboutToChange(newInput);
      getDocumentProvider(newInput).saveDocument(progressMonitor,
          newInput,
          getDocumentProvider().getDocument(getEditorInput()), true);
      success = true;
    } catch (CoreException x) {
      IStatus status = x.getStatus();
      if (status == null || status.getSeverity() != IStatus.CANCEL) {
        ErrorDialog.openError(shell,
            Messages.DispelDiagramEditor_SaveErrorTitle,
            Messages.DispelDiagramEditor_SaveErrorMessage,
            x.getStatus());
      }
    } finally {
      provider.changed(newInput);
      if (success) {
        setInput(newInput);
      }
    }
    if (progressMonitor != null) {
View Full Code Here

        .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.CismodelDiagramEditor_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;
    }
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = workspaceRoot.getFile(filePath);
    final IEditorInput newInput = new FileEditorInput(file);
    // Check if the editor is already open
    IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
        .getEditorMatchingStrategy();
    IEditorReference[] editorRefs = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editorRefs.length; i++) {
      if (matchingStrategy.matches(editorRefs[i], newInput)) {
        MessageDialog.openWarning(shell,
            Messages.CismodelDiagramEditor_SaveAsErrorTitle,
            Messages.CismodelDiagramEditor_SaveAsErrorMessage);
        return;
      }
    }
    boolean success = false;
    try {
      provider.aboutToChange(newInput);
      getDocumentProvider(newInput).saveDocument(progressMonitor,
          newInput,
          getDocumentProvider().getDocument(getEditorInput()), true);
      success = true;
    } catch (CoreException x) {
      IStatus status = x.getStatus();
      if (status == null || status.getSeverity() != IStatus.CANCEL) {
        ErrorDialog.openError(shell,
            Messages.CismodelDiagramEditor_SaveErrorTitle,
            Messages.CismodelDiagramEditor_SaveErrorMessage,
            x.getStatus());
      }
    } finally {
      provider.changed(newInput);
      if (success) {
        setInput(newInput);
      }
    }
    if (progressMonitor != null) {
View Full Code Here

        .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.CismodelDiagramEditor_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;
    }
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = workspaceRoot.getFile(filePath);
    final IEditorInput newInput = new FileEditorInput(file);
    // Check if the editor is already open
    IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
        .getEditorMatchingStrategy();
    IEditorReference[] editorRefs = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editorRefs.length; i++) {
      if (matchingStrategy.matches(editorRefs[i], newInput)) {
        MessageDialog.openWarning(shell,
            Messages.CismodelDiagramEditor_SaveAsErrorTitle,
            Messages.CismodelDiagramEditor_SaveAsErrorMessage);
        return;
      }
    }
    boolean success = false;
    try {
      provider.aboutToChange(newInput);
      getDocumentProvider(newInput).saveDocument(progressMonitor,
          newInput,
          getDocumentProvider().getDocument(getEditorInput()), true);
      success = true;
    } catch (CoreException x) {
      IStatus status = x.getStatus();
      if (status == null || status.getSeverity() != IStatus.CANCEL) {
        ErrorDialog.openError(shell,
            Messages.CismodelDiagramEditor_SaveErrorTitle,
            Messages.CismodelDiagramEditor_SaveErrorMessage,
            x.getStatus());
      }
    } finally {
      provider.changed(newInput);
      if (success) {
        setInput(newInput);
      }
    }
    if (progressMonitor != null) {
View Full Code Here

        .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(es.upm.dit.gsi.eclipse.jadex.diagram.eclipseJadex.diagram.part.Messages.JadexAgentsDiagramEditor_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;
    }
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = workspaceRoot.getFile(filePath);
    final IEditorInput newInput = new FileEditorInput(file);
    // Check if the editor is already open
    IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
        .getEditorMatchingStrategy();
    IEditorReference[] editorRefs = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editorRefs.length; i++) {
      if (matchingStrategy.matches(editorRefs[i], newInput)) {
        MessageDialog
            .openWarning(
                shell,
                es.upm.dit.gsi.eclipse.jadex.diagram.eclipseJadex.diagram.part.Messages.JadexAgentsDiagramEditor_SaveAsErrorTitle,
                es.upm.dit.gsi.eclipse.jadex.diagram.eclipseJadex.diagram.part.Messages.JadexAgentsDiagramEditor_SaveAsErrorMessage);
        return;
      }
    }
    boolean success = false;
    try {
      provider.aboutToChange(newInput);
      getDocumentProvider(newInput).saveDocument(progressMonitor,
          newInput,
          getDocumentProvider().getDocument(getEditorInput()), true);
      success = true;
    } catch (CoreException x) {
      IStatus status = x.getStatus();
      if (status == null || status.getSeverity() != IStatus.CANCEL) {
        ErrorDialog
            .openError(
                shell,
                es.upm.dit.gsi.eclipse.jadex.diagram.eclipseJadex.diagram.part.Messages.JadexAgentsDiagramEditor_SaveErrorTitle,
                es.upm.dit.gsi.eclipse.jadex.diagram.eclipseJadex.diagram.part.Messages.JadexAgentsDiagramEditor_SaveErrorMessage,
                x.getStatus());
      }
    } finally {
      provider.changed(newInput);
      if (success) {
        setInput(newInput);
      }
    }
    if (progressMonitor != null) {
View Full Code Here

TOP

Related Classes of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider

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.