Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.ExecutionException


  public Object execute(ExecutionEvent event) throws ExecutionException {
    try {
      WorkbenchUtils.openWizardOnCurrentEditorInput(WGADesignerPlugin.getDefault().getWorkbench(), de.innovationgate.eclipse.wgadesigner.ResourceIDs.WIZARD_EXPORT_WGAPLUGIN_TO_REMOTE_SERVER);
      return null;
    } catch (CoreException e) {
      throw new ExecutionException("Unable to open export wizard.", e);
    }
  }
View Full Code Here


   
    public static final String PARAM_TMLFilePath = "de.innovationgate.eclipse.ids.commands.OpenModuleInBrowser.paramTMLFilePath";
   
    public Object execute(ExecutionEvent event) throws ExecutionException {
        if (TomcatUtils.getInstance().getCurrentRuntime() == null) {
            throw new ExecutionException("The runtime is not started.");
        }
       
        String param = event.getParameter(PARAM_TMLFilePath);
        if (param != null) {
            Path path = new Path(param);
            IFile tmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
            String dbkey = OpenModulInBrowser.determineContentStoreOfFile(tmlFile);
            if (dbkey == null) {
                throw new ExecutionException("None of the web applications of the current runtime are connected to this design resource.");
            }
            OpenModulInBrowser.openBrowser(dbkey, tmlFile);
        }
        return null;
    }
View Full Code Here

  public Object execute(ExecutionEvent event) throws ExecutionException {
    try {
      WorkbenchUtils.openWizardOnCurrentEditorInput(Plugin.getDefault().getWorkbench(), ResourceIDs.WIZARD_EXPORT_WGA_PLUGIN_LOCAL);
      return null;
    } catch (CoreException e) {
      throw new ExecutionException("Unable to open export wizard.", e);
    }
  }
View Full Code Here

  public Object execute(ExecutionEvent event) throws ExecutionException {
    try {
      WorkbenchUtils.openWizardOnCurrentEditorInput(Plugin.getDefault().getWorkbench(), ResourceIDs.WIZARD_EXPORT_WGA_DESIGN_LOCAL);
      return null;
    } catch (CoreException e) {
      throw new ExecutionException("Unable to open export wizard.", e);
    }
  }
View Full Code Here

        {
            IEditorInput editorInput = editorPart.getEditorInput();

            if (!(editorInput instanceof IFileEditorInput))
            {
                throw new ExecutionException("Editor input must be a file");
            }
            IFileEditorInput fileInput = (IFileEditorInput) editorInput;

            try
            {
                // Save the editor content (if dirty)
                IRunnableWithProgress saveOperation = new IRunnableWithProgress()
                {
                    public void run(IProgressMonitor monitor)
                        throws InvocationTargetException, InterruptedException
                    {
                        if (editorPart.isDirty())
                        {
                            if (MessageDialog.openQuestion(
                                shell,
                                "Save File",
                                "The file contents must be saved before the command can be executed. Do you wish to save now?"))
                            {
                                editorPart.doSave(monitor);
                            }
                            else
                            {
                                throw new InterruptedException();
                            }
                        }
                    }
                };
                new ProgressMonitorDialog(shell).run(false, true, saveOperation);

                // Execute on the file
                IFile file = fileInput.getFile();
                getResourceCommandHandler().execute(new IResource[] { file }, event);
            }
            catch (InvocationTargetException e)
            {
                throw new ExecutionException("Error saving file", e.getTargetException());
            }
            catch (InterruptedException e)
            {
                // Exit the command silently
            }
View Full Code Here

        } else {
            // Use the given parameter.
            final IResource resource = (IResource) event
                    .getObjectParameterForExecution(PARAM_ID_FILE_PATH);
            if (!(resource instanceof IFile)) {
                throw new ExecutionException("filePath parameter must identify a file"); //$NON-NLS-1$
            }
            files.add((IFile) resource);
        }

        if (!files.isEmpty()) {

            final IWorkbenchWindow window = PlatformUI.getWorkbench()
                    .getActiveWorkbenchWindow();
            if (window == null) {
                throw new ExecutionException("no active workbench window"); //$NON-NLS-1$
            }

            final IWorkbenchPage page = window.getActivePage();
            if (page == null) {
                throw new ExecutionException("no active workbench page"); //$NON-NLS-1$
            }

            try {
                for (final IFile file : files) {
                    IDE.openEditor(page, file, true);
                }
            } catch (final PartInitException e) {
                throw new ExecutionException("error opening file in editor", e); //$NON-NLS-1$
            }
        }

        return null;
    }
View Full Code Here

                    final IErlModule module = (IErlModule) o;
                    view.interpretOrDeinterpret(module, false);
                }
            }
        } else {
            throw new ExecutionException("bad command id");
        }
        return null;
    }
View Full Code Here

        if (callback != null) {
          if (result == null || result.equals(Boolean.TRUE)) {
            callback.postExecuteSuccess(action, Boolean.TRUE);
          } else {
            callback.postExecuteFailure(action,
                new ExecutionException(action.getText()
                    + " returned failure.")); //$NON-NLS-1$
          }
        }

        if (resultListener!=null) {
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$
    }
    return super.doExecuteWithResult(monitor, info);
  }
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

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.