示例#1
0
 /*
  * @see ActionGroup#dispose()
  */
 @Override
 public void dispose() {
   fSelectionProvider.removeSelectionChangedListener(fOpenImplementation);
   fSelectionProvider.removeSelectionChangedListener(fOpenSuperImplementation);
   fSelectionProvider.removeSelectionChangedListener(fOpenAttachedJavadoc);
   fSelectionProvider.removeSelectionChangedListener(fOpenTypeHierarchy);
   fSelectionProvider.removeSelectionChangedListener(fOpenCallHierarchy);
   super.dispose();
 }
 @Override
 public void dispose() {
   if (provider != null) {
     provider.removeSelectionChangedListener(openExternalDartdocAction);
   }
   openExternalDartdocAction = null;
   super.dispose();
 }
 @Override
 public void dispose() {
   if (selProvider != null) {
     selProvider.removeSelectionChangedListener(this);
   }
   disposeActions();
   super.dispose();
 }
 @Override
 public void dispose() {
   fFilterActionGroup.dispose();
   fShowActionGroup.dispose();
   fChangeListener = null;
   ISelectionProvider selectionProvider = fSite.getSelectionProvider();
   selectionProvider.removeSelectionChangedListener(fWorkingSetAssignementAction);
   super.dispose();
 }
示例#5
0
 /**
  * The <code>CompositeEditorSite</code> implementation of this <code>IWorkbenchPartSite</code>
  * method remembers the selection provider, and also hooks a listener on it, which calls <code>
  * handleSelectionChanged</code> when a selection changed event occurs.
  *
  * @see #handleSelectionChanged
  */
 public void setSelectionProvider(ISelectionProvider provider) {
   ISelectionProvider oldSelectionProvider = selectionProvider;
   selectionProvider = provider;
   if (oldSelectionProvider != null) {
     oldSelectionProvider.removeSelectionChangedListener(getSelectionChangedListener());
   }
   if (selectionProvider != null) {
     selectionProvider.addSelectionChangedListener(getSelectionChangedListener());
   }
 }
 /** {@inheritDoc} */
 public void dispose() {
   if (fActions != null) {
     final ISelectionProvider provider = fSite.getSelectionProvider();
     for (Iterator iter = fActions.iterator(); iter.hasNext(); ) {
       Action action = (Action) iter.next();
       if (action instanceof ISelectionChangedListener)
         provider.removeSelectionChangedListener((ISelectionChangedListener) action);
     }
   }
   fActions = null;
   super.dispose();
 }
 /*
  * (non-Javadoc) Method declared in ActionGroup
  */
 @Override
 public void dispose() {
   if (fRegisteredSelectionListeners != null) {
     ISelectionProvider provider = fSite.getSelectionProvider();
     for (Iterator<ISelectionChangedListener> iter = fRegisteredSelectionListeners.iterator();
         iter.hasNext(); ) {
       ISelectionChangedListener listener = iter.next();
       provider.removeSelectionChangedListener(listener);
     }
   }
   if (fQuickAccessHandlerActivation != null && fHandlerService != null) {
     fHandlerService.deactivateHandler(fQuickAccessHandlerActivation);
   }
   fEditor = null;
   //    fCleanUp.dispose();
   super.dispose();
 }
 /*
  * @see IWorkbenchPart#dispose()
  */
 @Override
 public final void dispose() {
   // cancel possible running computation
   fComputeCount++;
   if (fContextActivation != null) {
     IContextService ctxService = (IContextService) getSite().getService(IContextService.class);
     if (ctxService != null) {
       ctxService.deactivateContext(fContextActivation);
     }
   }
   getSite().getWorkbenchWindow().getPartService().removePartListener(fPartListener);
   ISelectionProvider provider = getSelectionProvider();
   if (provider != null) provider.removeSelectionChangedListener(fCopyToClipboardAction);
   JFaceResources.getColorRegistry().removeListener(this);
   fBackgroundColorRGB = null;
   if (fBackgroundColor != null) {
     fBackgroundColor.dispose();
     fBackgroundColor = null;
   }
   internalDispose();
 }
  /**
   * When the active editor changes, this remembers the change and registers with it as a selection
   * provider.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated
   */
  public void setActiveEditor(IEditorPart part) {
    super.setActiveEditor(part);
    activeEditorPart = part;

    // Switch to the new selection provider.
    //
    if (selectionProvider != null) {
      selectionProvider.removeSelectionChangedListener(this);
    }
    if (part == null) {
      selectionProvider = null;
    } else {
      selectionProvider = part.getSite().getSelectionProvider();
      selectionProvider.addSelectionChangedListener(this);

      // Fake a selection changed event to update the menus.
      //
      if (selectionProvider.getSelection() != null) {
        selectionChanged(
            new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
      }
    }
  }
  public void setDelegate(ISelectionProvider delegate) {
    if (delegate == this.delegate) return;

    ISelectionProvider oldDelegate = this.delegate;
    ISelectionProvider newDelegate = delegate;
    this.delegate = delegate;

    if (oldDelegate != null) {
      oldDelegate.removeSelectionChangedListener(listener);
      if (oldDelegate instanceof IPostSelectionProvider) {
        ((IPostSelectionProvider) oldDelegate).removePostSelectionChangedListener(postListener);
      }
    }

    final ISelection newSelection = getSelection();
    if (newDelegate != null) {
      newDelegate.addSelectionChangedListener(listener);
      delegateSelectionChanged(newSelection);

      if (newDelegate instanceof IPostSelectionProvider) {
        ((IPostSelectionProvider) newDelegate).addPostSelectionChangedListener(postListener);
      } else {
        newDelegate.addSelectionChangedListener(postListener);
      }
      Display.getDefault()
          .asyncExec(
              new Runnable() {
                public void run() {
                  postDelegateSelectionChanged(newSelection);
                }
              });
    } else {
      delegateSelectionChanged(newSelection);
      postDelegateSelectionChanged(newSelection);
    }
  }
 /**
  * Removes this instance from the given editor selection listeners.
  *
  * @param dialectEditor the {@link DialectEditor}.
  */
 private void removeSelectionListener(DialectEditor dialectEditor) {
   ISelectionProvider selectionProvider = dialectEditor.getEditorSite().getSelectionProvider();
   selectionProvider.removeSelectionChangedListener(this);
 }
示例#12
0
 /*
  * @see ActionGroup#dispose()
  */
 public void dispose() {
   ISelectionProvider provider = fSite.getSelectionProvider();
   provider.removeSelectionChangedListener(fOpen);
   super.dispose();
 }
 private void disposeAction(ISelectionChangedListener action, ISelectionProvider provider) {
   if (action != null) provider.removeSelectionChangedListener(action);
 }
 public void doRemoveFrom(Object source) {
   ((ISelectionProvider) source).removeSelectionChangedListener(this);
 }
示例#15
0
 /*
  * @see ActionGroup#dispose()
  */
 @Override
 public void dispose() {
   fSelectionProvider.removeSelectionChangedListener(fOpen);
   super.dispose();
 }
示例#16
0
 @Override
 public void dispose() {
   selectionSource.removeSelectionChangedListener(this);
 }