コード例 #1
0
  /** @see IActionDelegate#run(IAction) */
  public void run(final IAction action) {
    if (fBreakpoint != null) {
      IShellProvider provider;
      if (fPart != null) {
        provider = fPart.getSite();
      } else {
        provider =
            new IShellProvider() {
              public Shell getShell() {
                final IWorkbench workbench = PlatformUI.getWorkbench();
                final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
                return (window == null) ? null : window.getShell();
              }
            };
      }
      final PropertyDialogAction propertyAction =
          new PropertyDialogAction(
              provider,
              new ISelectionProvider() {
                public void addSelectionChangedListener(final ISelectionChangedListener listener) {}

                public ISelection getSelection() {
                  return new StructuredSelection(fBreakpoint);
                }

                public void removeSelectionChangedListener(
                    final ISelectionChangedListener listener) {}

                public void setSelection(final ISelection selection) {}
              });
      propertyAction.run();
    }
  }
コード例 #2
0
  /* (non-Javadoc)
   * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
   */
  public void run(IAction action) {
    PropertyDialogAction propertyAction =
        new PropertyDialogAction(
            getActivePart().getSite(),
            new ISelectionProvider() {
              public void addSelectionChangedListener(ISelectionChangedListener listener) {}

              public ISelection getSelection() {
                return new StructuredSelection(getBreakpoint());
              }

              public void removeSelectionChangedListener(ISelectionChangedListener listener) {}

              public void setSelection(ISelection selection) {}
            });
    propertyAction.run();
  }