Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.ExecutionException


        IWorkbenchPage page = PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow().getActivePage();
        page.openEditor(editorInput, getEditorID());
        return CommandResult.newOKCommandResult();
      } catch (Exception ex) {
        throw new ExecutionException("Can't open diagram", ex);
      }
    }
View Full Code Here


     */
    protected Diagram intializeNewDiagram() throws ExecutionException {
      Diagram d = ViewService.createDiagram(getDiagramDomainElement(),
          getDiagramKind(), getPreferencesHint());
      if (d == null) {
        throw new ExecutionException("Can't create diagram of '"
            + getDiagramKind() + "' kind");
      }
      diagramFacet.setDiagramLink(d);
      assert diagramFacet.eResource() != null;
      diagramFacet.eResource().getContents().add(d);
      EObject container = diagramFacet.eContainer();
      while (container instanceof View) {
        ((View) container).persist();
        container = container.eContainer();
      }
      try {
        new WorkspaceModifyOperation() {
          protected void execute(IProgressMonitor monitor)
              throws CoreException, InvocationTargetException,
              InterruptedException {
            try {
              for (Iterator it = diagramFacet.eResource()
                  .getResourceSet().getResources().iterator(); it
                  .hasNext();) {
                Resource nextResource = (Resource) it.next();
                if (nextResource.isLoaded()
                    && !getEditingDomain().isReadOnly(
                        nextResource)) {
                  nextResource
                      .save(eu.admire.visual.pmml._40.diagram.part.PMMLDiagramEditorUtil
                          .getSaveOptions());
                }
              }
            } catch (IOException ex) {
              throw new InvocationTargetException(ex,
                  "Save operation failed");
            }
          }
        }.run(null);
      } catch (InvocationTargetException e) {
        throw new ExecutionException("Can't create diagram of '"
            + getDiagramKind() + "' kind", e);
      } catch (InterruptedException e) {
        throw new ExecutionException("Can't create diagram of '"
            + getDiagramKind() + "' kind", e);
      }
      return d;
    }
View Full Code Here

   * @generated
   */
  protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
      IAdaptable info) throws ExecutionException {
    if (!canExecute()) {
      throw new ExecutionException(
          "Invalid arguments in create link command"); //$NON-NLS-1$
    }

    org.dmg.pmml._40.ConType newElement = org.dmg.pmml._40._40Factory.eINSTANCE
        .createConType();
View Full Code Here

   * @generated
   */
  protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
      IAdaptable info) throws ExecutionException {
    if (!canExecute()) {
      throw new ExecutionException(
          "Invalid arguments in create link command"); //$NON-NLS-1$
    }

    org.dmg.pmml._40.NeuralOutputType newElement = org.dmg.pmml._40._40Factory.eINSTANCE
        .createNeuralOutputType();
View Full Code Here

   * @generated
   */
  protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
      IAdaptable info) throws ExecutionException {
    if (!canExecute()) {
      throw new ExecutionException(
          "Invalid arguments in reorient link command"); //$NON-NLS-1$
    }
    if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
      return reorientSource();
    }
View Full Code Here

                }
            } else {
                sLogger.warn("The project needs to be parsed first.");
            }
        } catch (EvolizerException ee) {
            throw new ExecutionException(ee.getMessage());
        }

        return null;
    }
View Full Code Here

                Job mainJob = new FamixParserJob(selectedJavaElements);
                mainJob.setUser(true);
                mainJob.schedule();
            }
        } catch (EvolizerException ee) {
            throw new ExecutionException(ee.getMessage());
        }


        return null;
    }
View Full Code Here

        try {
          ObjectInputStream ois = new ObjectInputStream(new FileInputStream(ruleFile));
          object = ois.readObject();

        } catch (Exception e) {
          throw new ExecutionException("Failure to read file: " + ruleFile, e);
        }

        if (!(object instanceof RenamerRule)) {
          throw new ExecutionException("The object that was read was not a RenamerRule");
        }

        RenamerRule rule = (RenamerRule) object;

        // add the file to the recently loaded file set
        Activator.getDefault().getRecentlyLoadedRules().add(ruleFile);

        RenamerRuleEditorInput input = getEditorInput(rule, ruleFile);
        String editorID = getEditorID(rule);

        try {
          page.openEditor(input, editorID);
        } catch (PartInitException e) {
          throw new ExecutionException("Failed to open editor.", e);
        }
      }
    }
  }
View Full Code Here

      String msg = "Creating new Content failed";

      MessageDialog.showUnexpectedErrorMessage(msg, logger, e);

      throw new ExecutionException(msg, e);

    }
    logger.debug("exiting execute");
    return null;
  }
View Full Code Here

    } else {
      // error handling: Unexpected case no IStructuredSelection
      String msg = "Selected Element is not an instance of IStructuredSelection";

      MessageDialog.showUnexpectedErrorMessage(msg, logger, null);
      throw new ExecutionException(msg);
    }
    view.selectEntry();
    logger.debug("exiting execute");
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.commands.ExecutionException

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.