Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.ExecutionException


    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);
      try {
        new WorkspaceModifyOperation() {

          protected void execute(IProgressMonitor monitor)
          throws CoreException, InvocationTargetException,
          InterruptedException {
            try {
              for (
                  Iterator<Resource> it =
                    diagramFacet.eResource()
                    .getResourceSet().getResources()
                    .iterator();
                  it.hasNext();
              ) {
                Resource nextResource = it.next();
                if (nextResource.isLoaded()
                    && !getEditingDomain().isReadOnly(
                        nextResource)) {
                  nextResource.save(UMLDiagramEditorUtil
                      .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
        );
View Full Code Here


   
    try {
      XVRUtils.setActiveHTML(HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection());
    } catch (CoreException e) {
      e.printStackTrace();
      throw new ExecutionException(e.getMessage());
    }
   
    /*IViewPart v = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("org.xvr.xvrengine.view.navigator");
    ((CommonNavigator)v).getCommonViewer().refresh();*/
    XVRUtils.refreshNavigator();
 
View Full Code Here

    IProjectDescription desc;
    try {
      desc = prj.getDescription();
    } catch (CoreException e) {
      e.printStackTrace();
      throw new ExecutionException("Error while retrieving the project description: " + e.getMessage());
    }
   
    ICommand[] commands = desc.getBuildSpec();
    boolean found = false;
    ICommand builder = null;
    ArrayList<ICommand> list = new ArrayList<ICommand>();
   
    for (int i = 0; i < commands.length; ++i){
      if ((found = commands[i].getBuilderName().equals(XVRBuilder.BUILDER_ID)))
        builder = commands[i];
      else
        list.add(commands[i]);
    }
    if(!found)
      throw new ExecutionException("Builder not found while setting main file");
   
   
    Map<String, String> arg = builder.getArguments();
   
    IResource res = (IResource)((IAdaptable) element).getAdapter(IResource.class);
View Full Code Here

            try {
              res.setHidden(true);
              XVRUtils.refreshNavigator();
            } catch (CoreException e) {
              e.printStackTrace();
              throw new ExecutionException("Hide failed on " + res.getName());
            }
          }
      }
       
    }
View Full Code Here

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IStructuredSelection selection = XVRUtils.getSelectionFromEvent(event);
    if(selection == null)
      throw new ExecutionException("Empty selection");

    BasicNewFolderResourceWizard wizard = new BasicNewFolderResourceWizard();
    wizard.init(HandlerUtil.getActiveWorkbenchWindow(event).getWorkbench(), selection);
    WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), wizard);
    dialog.open();
View Full Code Here

      IWizardRegistry wizardRegistry = getWizardRegistry();
      IWizardDescriptor wizardDescriptor = wizardRegistry
          .findWizard(wizardId);
      if (wizardDescriptor == null) {
        throw new ExecutionException("unknown wizard: " + wizardId); //$NON-NLS-1$
      }

      try {
        IWorkbenchWizard wizard = wizardDescriptor.createWizard();
        wizard.init(PlatformUI.getWorkbench(), getSelectionToUse(event));
       
        if (wizardDescriptor.canFinishEarly() && !wizardDescriptor.hasPages()) {
          wizard.performFinish();
          return null;
        }
       
        Shell parent = activeWindow.getShell();
        WizardDialog dialog = new WizardDialog(parent, wizard);
        dialog.create();
        dialog.open();

      } catch (CoreException ex) {
        throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$
      }

    }

    return null;
View Full Code Here

  public Object execute(ExecutionEvent event) throws ExecutionException {
    try {
      XVRUtils.getXVRLaunchConfiguration().launch(ILaunchManager.RUN_MODE, new NullProgressMonitor(), false);
    } catch (CoreException e) {
      e.printStackTrace();
      throw new ExecutionException("Error while launching the project.", e);
    }
    return null;
  }
View Full Code Here

  public Object execute(ExecutionEvent event) throws ExecutionException {
    NewS3DWizard wizard = new NewS3DWizard();
   
    IStructuredSelection selection = XVRUtils.getSelectionFromEvent(event);
    if(selection == null)
      throw new ExecutionException("Empty selection");

    wizard.init(HandlerUtil.getActiveWorkbenchWindow(event).getWorkbench(), selection);
    WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), wizard);
    dialog.open();
    return null;
View Full Code Here

        _hasCommitted = false;
        _hasCleanState = false;
      }
      return result;
    }
    throw new ExecutionException("Cannot execute"); //$NON-NLS-1$
  }
View Full Code Here

        _hasExecuted = false;
        _hasCleanState = false;
      }
      return result;
    }
    throw new ExecutionException("Cannot execute"); //$NON-NLS-1$
  }
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.