Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.ExecutionException


   * @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


   * @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

      openOther(window);
    } else {
            try {
                openView((String) value, window);
            } catch (PartInitException e) {
                throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$
            }
    }

    return null;
  }
View Full Code Here

    try {
      workbench.showPerspective(perspectiveId, activeWorkbenchWindow,
          input);
    } catch (WorkbenchException e) {
      throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$
    }
  }
View Full Code Here

* @since 3.3
*/
public class HandlerUtil {
  private static void noVariableFound(ExecutionEvent event, String name)
      throws ExecutionException {
    throw new ExecutionException("No " + name //$NON-NLS-1$
        + " found while executing " + event.getCommand().getId()); //$NON-NLS-1$
  }
View Full Code Here

        + " found while executing " + event.getCommand().getId()); //$NON-NLS-1$
  }

  private static void incorrectTypeFound(ExecutionEvent event, String name,
      Class expectedType, Class wrongType) throws ExecutionException {
    throw new ExecutionException("Incorrect type for " //$NON-NLS-1$
        + name
        + " found while executing " //$NON-NLS-1$
        + event.getCommand().getId()
        + ", expected " + expectedType.getName() //$NON-NLS-1$
        + " found " + wrongType.getName()); //$NON-NLS-1$
View Full Code Here

  void setEnabledFor(IEvaluationContext context) throws ExecutionException {
    if (enabledWhenExpression != null) {
      try {
        setProxyEnabled(enabledWhenExpression.evaluate(context) == EvaluationResult.TRUE);
      } catch (CoreException e) {
        throw new ExecutionException(e.getMessage(), e);
      }
    }
  }
View Full Code Here

    final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil
        .getActiveWorkbenchWindowChecked(event);

    final Shell shell = activeWorkbenchWindow.getShell();
    if (shell == null) {
      throw new ExecutionException("no shell for active workbench window"); //$NON-NLS-1$
    }

    final PreferenceDialog dialog = PreferencesUtil
        .createPreferenceDialogOn(shell, preferencePageId, null, null);
    dialog.open();
View Full Code Here

                        new Runnable() {
                          public void run() {
                            ExceptionHandler
                                .getInstance()
                                .handleException(
                                    new ExecutionException(
                                        "An exception occurred while executing " //$NON-NLS-1$
                                            + methodToExecute
                                                .getName(),
                                        e
                                            .getTargetException()));
                          }
                        });
                  }
                }
              };

              swingInvokeLater(methodRunnable);
            }
          } catch (final ClassNotFoundException e) {
            // There is no Swing support, so do nothing.

          } catch (final NoSuchMethodException e) {
            // The API has changed, which seems amazingly unlikely.
            throw new Error("Something is seriously wrong here"); //$NON-NLS-1$
          }
        } else if (numParams == 0) {
          // This is a no-argument selectAll method.
          methodToExecute.invoke(focusControl, null);
          focusControl.notifyListeners(SWT.Selection, null);

        } else if (numParams == 1) {
          // This is a single-point selection method.
          final Method textLimitAccessor = focusControl.getClass()
              .getMethod("getTextLimit", NO_PARAMETERS); //$NON-NLS-1$
          final Integer textLimit = (Integer) textLimitAccessor
              .invoke(focusControl, null);
          final Object[] parameters = { new Point(0, textLimit
              .intValue()) };
          methodToExecute.invoke(focusControl, parameters);
          focusControl.notifyListeners(SWT.Selection, null);

        } else {
          /*
           * This means that getMethodToExecute() has been changed,
           * while this method hasn't.
           */
          throw new ExecutionException(
              "Too many parameters on select all", new Exception()); //$NON-NLS-1$

        }

      } catch (IllegalAccessException e) {
        // The method is protected, so do nothing.

      } catch (InvocationTargetException e) {
        throw new ExecutionException(
            "An exception occurred while executing " //$NON-NLS-1$
                + getMethodToExecute(), e.getTargetException());

      } catch (NoSuchMethodException e) {
        // I can't get the text limit. Do nothing.
View Full Code Here

    }

    try {
      return handler.execute(event.getParameters());
    } catch (final org.eclipse.ui.commands.ExecutionException e) {
      throw new ExecutionException(e.getMessage(), e.getCause());
    }
  }
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.