Java 类org.eclipse.jface.viewers.IPostSelectionProvider 实例源码

项目:texlipse    文件:TexlipseAnnotationUpdater.java   
/**
 * Creates a new TexlipseAnnotationUpdater and adds itself to the TexEditor via
 * <code>addPostSelectionChangedListener</code>
 * @param editor The TexEditor
 */
public TexlipseAnnotationUpdater (AbstractTextEditor editor) {
    //Add this listener to the current editors IPostSelectionListener (lazy update)
    ((IPostSelectionProvider) editor.getSelectionProvider()).addPostSelectionChangedListener(this);
    fEditor = editor;
    fEnabled = TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(
            TexlipseProperties.TEX_EDITOR_ANNOTATATIONS);

    //Add a PropertyChangeListener
    TexlipsePlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new  
            IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent event) {    
            String property = event.getProperty();
            if (TexlipseProperties.TEX_EDITOR_ANNOTATATIONS.equals(property)) {
                boolean enabled = TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(
                                TexlipseProperties.TEX_EDITOR_ANNOTATATIONS);
                fEnabled = enabled;
            }
        }
    });
}
项目:Source    文件:SelectionProviderIntermediate.java   
/**
 * Sets a new selection provider to delegate to. Selection listeners registered with the previous delegate
 * are removed before.
 * 
 * @param newDelegate
 *            new selection provider
 */
public void setSelectionProviderDelegate(ISelectionProvider newDelegate) {
    if (delegate != newDelegate) {
        if (delegate != null) {
            delegate.removeSelectionChangedListener(selectionListener);
            if (delegate instanceof IPostSelectionProvider) {
                ((IPostSelectionProvider)delegate).removePostSelectionChangedListener(
                        postSelectionListener);
            }
        }
        delegate = newDelegate;
        if (newDelegate != null) {
            newDelegate.addSelectionChangedListener(selectionListener);
            if (newDelegate instanceof IPostSelectionProvider) {
                ((IPostSelectionProvider)newDelegate).addPostSelectionChangedListener(
                        postSelectionListener);
            }
            fireSelectionChanged(newDelegate.getSelection());
            firePostSelectionChanged(newDelegate.getSelection());
        }
    }
}
项目:Source    文件:SelectionProviderIntermediate.java   
/**
 * Sets a new selection provider to delegate to. Selection listeners registered with the previous delegate
 * are removed before.
 * 
 * @param newDelegate
 *            new selection provider
 */
public void setSelectionProviderDelegate(ISelectionProvider newDelegate) {
    if (delegate != newDelegate) {
        if (delegate != null) {
            delegate.removeSelectionChangedListener(selectionListener);
            if (delegate instanceof IPostSelectionProvider) {
                ((IPostSelectionProvider)delegate).removePostSelectionChangedListener(
                        postSelectionListener);
            }
        }
        delegate = newDelegate;
        if (newDelegate != null) {
            newDelegate.addSelectionChangedListener(selectionListener);
            if (newDelegate instanceof IPostSelectionProvider) {
                ((IPostSelectionProvider)newDelegate).addPostSelectionChangedListener(
                        postSelectionListener);
            }
            fireSelectionChanged(newDelegate.getSelection());
            firePostSelectionChanged(newDelegate.getSelection());
        }
    }
}
项目:PDFReporter-Studio    文件:MultiPageToolbarEditorSite.java   
/**
 * The <code>MultiPageEditorSite</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.
 * 
 * @param provider
 *          The selection provider.
 * @see MultiPageEditorSite#handleSelectionChanged(SelectionChangedEvent)
 */
public void setSelectionProvider(ISelectionProvider provider) {
    ISelectionProvider oldSelectionProvider = selectionProvider;
    selectionProvider = provider;
    if (oldSelectionProvider != null) {
        oldSelectionProvider.removeSelectionChangedListener(getSelectionChangedListener());
        if (oldSelectionProvider instanceof IPostSelectionProvider) {
            ((IPostSelectionProvider) oldSelectionProvider)
                    .removePostSelectionChangedListener(getPostSelectionChangedListener());
        } else {
            oldSelectionProvider.removeSelectionChangedListener(getPostSelectionChangedListener());
        }
    }
    if (selectionProvider != null) {
        selectionProvider.addSelectionChangedListener(getSelectionChangedListener());
        if (selectionProvider instanceof IPostSelectionProvider) {
            ((IPostSelectionProvider) selectionProvider).addPostSelectionChangedListener(getPostSelectionChangedListener());
        } else {
            selectionProvider.addSelectionChangedListener(getPostSelectionChangedListener());
        }
    }
}
项目:elexis-3-core    文件:DelegatingSelectionProvider.java   
/**
 * Sets a new selection provider to delegate to. Selection listeners registered with the
 * previous delegate are removed before.
 * 
 * @param newDelegate
 *            new selection provider
 */
public void setSelectionProviderDelegate(ISelectionProvider newDelegate){
    if (delegate == newDelegate) {
        return;
    }
    if (delegate != null) {
        delegate.removeSelectionChangedListener(selectionListener);
        if (delegate instanceof IPostSelectionProvider) {
            ((IPostSelectionProvider) delegate)
                .removePostSelectionChangedListener(postSelectionListener);
        }
    }
    delegate = newDelegate;
    if (newDelegate != null) {
        newDelegate.addSelectionChangedListener(selectionListener);
        if (newDelegate instanceof IPostSelectionProvider) {
            ((IPostSelectionProvider) newDelegate)
                .addPostSelectionChangedListener(postSelectionListener);
        }
        fireSelectionChanged(newDelegate.getSelection());
        firePostSelectionChanged(newDelegate.getSelection());
    }
}
项目:team-explorer-everywhere    文件:SwitchingSelectionProvider.java   
/**
 * Sets a new {@link ISelectionProvider} for this
 * {@link SwitchingSelectionProvider}. Any {@link ISelectionChangedListener}
 * s that are registered with this {@link SwitchingSelectionProvider} will
 * receive {@link SelectionChangedEvent}s. The new
 * {@link ISelectionProvider} may be <code>null</code>.
 *
 * @param selectionProvider
 *        a new {@link ISelectionProvider} to use (may be <code>null</code>)
 */
public void setSelectionProvider(final ISelectionProvider selectionProvider) {
    synchronized (currentWrappedProviderLock) {
        if (currentWrappedProvider != null) {
            currentWrappedProvider.removeSelectionChangedListener(selectionChangedListener);
            if (currentWrappedProvider instanceof IPostSelectionProvider) {
                ((IPostSelectionProvider) currentWrappedProvider).removePostSelectionChangedListener(
                    postSelectionChangedListener);
            }
        }

        currentWrappedProvider = selectionProvider;

        if (selectionProvider != null) {
            selectionProvider.addSelectionChangedListener(selectionChangedListener);
            if (selectionProvider instanceof IPostSelectionProvider) {
                ((IPostSelectionProvider) selectionProvider).addPostSelectionChangedListener(
                    postSelectionChangedListener);
            }
        }

        final ISelection selection =
            (selectionProvider != null ? selectionProvider.getSelection() : StructuredSelection.EMPTY);
        selectionChangedListener.fireChildListeners(selection);
        postSelectionChangedListener.fireChildListeners(selection);
    }
}
项目:subclipse    文件:AnnotateView.java   
protected void disconnect() {
    if(editor != null) {
        if (editor.getSelectionProvider() instanceof IPostSelectionProvider) {
            ((IPostSelectionProvider) editor.getSelectionProvider()).removePostSelectionChangedListener(this);
        }
        editor.getSite().getPage().removePartListener(partListener);
        editor = null;
        document = null;
    }
}
项目:ftc    文件:TweakedLinkedModeUI.java   
private void connect() {
    Assert.isNotNull(fCurrentTarget);
    ITextViewer viewer = fCurrentTarget.getViewer();
    Assert.isNotNull(viewer);
    fCurrentTarget.fWidget = viewer.getTextWidget();
    if (fCurrentTarget.fWidget == null)
        leave(ILinkedModeListener.EXIT_ALL);

    if (fCurrentTarget.fKeyListener == null) {
        fCurrentTarget.fKeyListener = new KeyListener();
        ((ITextViewerExtension) viewer).prependVerifyKeyListener(fCurrentTarget.fKeyListener);
    } else
        fCurrentTarget.fKeyListener.setEnabled(true);

    registerAutoEditVetoer(viewer);

    ((IPostSelectionProvider) viewer).addPostSelectionChangedListener(fSelectionListener);

    createAnnotationModel();

    showSelection();

    fCurrentTarget.fShell = fCurrentTarget.fWidget.getShell();
    if (fCurrentTarget.fShell == null)
        leave(ILinkedModeListener.EXIT_ALL);
    fCurrentTarget.fShell.addShellListener(fCloser);

    fAssistant.install(viewer);

    viewer.addTextInputListener(fCloser);

    viewer.getDocument().addDocumentListener(fDocumentListener);
}
项目:ftc    文件:TweakedLinkedModeUI.java   
private void disconnect() {
    Assert.isNotNull(fCurrentTarget);
    ITextViewer viewer = fCurrentTarget.getViewer();
    Assert.isNotNull(viewer);

    viewer.getDocument().removeDocumentListener(fDocumentListener);

    fAssistant.uninstall();
    fAssistant.removeProposalListener(fProposalListener);

    fCurrentTarget.fWidget = null;

    Shell shell = fCurrentTarget.fShell;
    fCurrentTarget.fShell = null;

    if (shell != null && !shell.isDisposed())
        shell.removeShellListener(fCloser);

    // this one is asymmetric: we don't install the model in
    // connect, but leave it to its callers to ensure they
    // have the model installed if they need it
    uninstallAnnotationModel(fCurrentTarget);

    unregisterAutoEditVetoer(viewer);

    // don't remove the verify key listener to let it keep its position
    // in the listener queue
    if (fCurrentTarget.fKeyListener != null)
        fCurrentTarget.fKeyListener.setEnabled(false);

    ((IPostSelectionProvider) viewer).removePostSelectionChangedListener(fSelectionListener);

    redraw();
}
项目:texlipse    文件:TexEditor.java   
/** 
 * Create the part control.
 * 
 * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
 */
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    // enable projection support (for code folder)
    ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
    fProjectionSupport = new ProjectionSupport(projectionViewer,
            getAnnotationAccess(), getSharedColors());
    fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
    fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
    fProjectionSupport.install();

    if (TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.CODE_FOLDING)) {
        projectionViewer.doOperation(ProjectionViewer.TOGGLE);
    }

    fAnnotationUpdater = new TexlipseAnnotationUpdater(this);

    ((IPostSelectionProvider) getSelectionProvider()).addPostSelectionChangedListener(
            new ISelectionChangedListener(){
                public void selectionChanged(SelectionChangedEvent event) {
                    //Delete all StatuslineErrors after selection changes
                    documentModel.removeStatusLineErrorMessage();
                }
            });

    // register documentModel as documentListener
    // in initializeEditor this would cause NPE
    this.getDocumentProvider().getDocument(getEditorInput()).addDocumentListener(this.documentModel);
    this.documentModel.initializeModel();
    this.documentModel.updateNow();

    ISourceViewer sourceViewer = getSourceViewer();
    if (sourceViewer instanceof ITextViewerExtension) {
        if (fBracketInserter == null)
            fBracketInserter = new BracketInserter(getSourceViewer(), this);
        ((ITextViewerExtension) sourceViewer).prependVerifyKeyListener(fBracketInserter);
    }
}
项目:typescript.java    文件:JavaScriptLightWeightEditor.java   
/**
 * Installs this selection changed listener with the given selection
 * provider. If the selection provider is a post selection provider,
 * post selection changed events are the preferred choice, otherwise
 * normal selection changed events are requested.
 *
 * @param selectionProvider
 */
public void install(ISelectionProvider selectionProvider) {
    if (selectionProvider == null)
        return;

    if (selectionProvider instanceof IPostSelectionProvider) {
        IPostSelectionProvider provider = (IPostSelectionProvider) selectionProvider;
        provider.addPostSelectionChangedListener(this);
    } else {
        selectionProvider.addSelectionChangedListener(this);
    }
}
项目:typescript.java    文件:JavaScriptLightWeightEditor.java   
/**
 * Removes this selection changed listener from the given selection
 * provider.
 *
 * @param selectionProvider
 *            the selection provider
 */
public void uninstall(ISelectionProvider selectionProvider) {
    if (selectionProvider == null)
        return;

    if (selectionProvider instanceof IPostSelectionProvider) {
        IPostSelectionProvider provider = (IPostSelectionProvider) selectionProvider;
        provider.removePostSelectionChangedListener(this);
    } else {
        selectionProvider.removeSelectionChangedListener(this);
    }
}
项目:bts    文件:OutlineWithEditorLinker.java   
public void activate(OutlinePage outlinePage) {
    this.outlinePage = outlinePage;
    treeViewer = outlinePage.getTreeViewer();
    treeListener = new TreeListener();
    treeViewer.addPostSelectionChangedListener(treeListener);
    treeViewer.addDoubleClickListener(treeListener);
    textViewer = outlinePage.getSourceViewer();
    textListener = new TextListener();
    ISelectionProvider textSelectionProvider = textViewer.getSelectionProvider();
    if (textSelectionProvider instanceof IPostSelectionProvider)
        ((IPostSelectionProvider) textSelectionProvider).addPostSelectionChangedListener(textListener);
    else
        textSelectionProvider.addSelectionChangedListener(textListener);
}
项目:bts    文件:OutlineWithEditorLinker.java   
public void deactivate() {
    ISelectionProvider textSelectionProvider = textViewer.getSelectionProvider();
    if (textSelectionProvider instanceof IPostSelectionProvider)
        ((IPostSelectionProvider) textSelectionProvider).removePostSelectionChangedListener(textListener);
    else
        textSelectionProvider.removeSelectionChangedListener(textListener);
    textListener = null;
    textViewer = null;
    treeViewer.removePostSelectionChangedListener(treeListener);
    treeViewer.removeDoubleClickListener(treeListener);
    treeViewer = null;
    treeListener = null;
    outlinePage = null;
}
项目:bts    文件:XtextEditor.java   
private void installSelectionChangedListener() {
    selectionChangedListener = new ISelectionChangedListener() {
        public void selectionChanged(final SelectionChangedEvent event) {
            updateStatusLine();
        }
    };
    final ISelectionProvider selectionProvider = getSelectionProvider();
    if (selectionProvider instanceof IPostSelectionProvider) {
        final IPostSelectionProvider postSelectionProvider = (IPostSelectionProvider) selectionProvider;
        postSelectionProvider.addPostSelectionChangedListener(selectionChangedListener);
    } else {
        getSelectionProvider().addSelectionChangedListener(selectionChangedListener);
    }
}
项目:bts    文件:XtextEditor.java   
private void uninstallSelectionChangedListener() {
    ISelectionProvider selectionProvider = getSelectionProvider();
    if (selectionProvider != null) {
        if (selectionProvider instanceof IPostSelectionProvider) {
            final IPostSelectionProvider postSelectionProvider = (IPostSelectionProvider) selectionProvider;
            postSelectionProvider.removePostSelectionChangedListener(selectionChangedListener);
        } else {
            selectionProvider.removeSelectionChangedListener(selectionChangedListener);
        }
    }
}
项目:APICloud-Studio    文件:AnnotateView.java   
protected void disconnect() {
    if(editor != null) {
        if (editor.getSelectionProvider() instanceof IPostSelectionProvider) {
            ((IPostSelectionProvider) editor.getSelectionProvider()).removePostSelectionChangedListener(this);
        }
        editor.getSite().getPage().removePartListener(partListener);
        editor = null;
        document = null;
    }
}
项目:APICloud-Studio    文件:CommonEditorPropertySheetPage.java   
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection)
{
    removePostSelectionListener();
    if (selection instanceof ITextSelection && part instanceof AbstractTextEditor)
    {
        selection = new StructuredSelection(new AdaptableTextSelection(getViewer(), (ITextSelection) selection));
        sourcePart = (AbstractTextEditor) part;
        ((IPostSelectionProvider) sourcePart.getSelectionProvider())
                .addPostSelectionChangedListener(selectionChangedListener);
        sourcePart.getSite().getPage().addPartListener(partListener);
    }
    super.selectionChanged(part, selection);
}
项目:APICloud-Studio    文件:CommonEditorPropertySheetPage.java   
private void removePostSelectionListener()
{
    if (sourcePart != null)
    {
        ((IPostSelectionProvider) sourcePart.getSelectionProvider())
                .removePostSelectionChangedListener(selectionChangedListener);
        sourcePart = null;
    }
}
项目:APICloud-Studio    文件:AbstractThemeableEditor.java   
public void install(ISelectionProvider selectionProvider)
{
    if (selectionProvider == null)
    {
        return;
    }
    if (selectionProvider instanceof IPostSelectionProvider)
    {
        ((IPostSelectionProvider) selectionProvider).addPostSelectionChangedListener(this);
    }
    else
    {
        selectionProvider.addSelectionChangedListener(this);
    }
}
项目:APICloud-Studio    文件:AbstractThemeableEditor.java   
public void uninstall(ISelectionProvider selectionProvider)
{
    if (selectionProvider == null)
    {
        return;
    }
    if (selectionProvider instanceof IPostSelectionProvider)
    {
        ((IPostSelectionProvider) selectionProvider).removePostSelectionChangedListener(this);
    }
    else
    {
        selectionProvider.removeSelectionChangedListener(this);
    }
}
项目:OpenSPIFe    文件:MergeTotalViewer.java   
private void setupSelectionListener(final IPostSelectionProvider postSelectionProvider) {
    final ISelectionChangedListener listener = new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            setSelection(event.getSelection());
        }
    };
    postSelectionProvider.addPostSelectionChangedListener(listener);
    totalComposite.addDisposeListener(new DisposeListener() {
        @Override
        public void widgetDisposed(DisposeEvent e) {
            postSelectionProvider.removePostSelectionChangedListener(listener);
        }
    });
}
项目:OpenSPIFe    文件:EnsembleSelectionProvider.java   
/**
    * Make this EnsembleSelectionProvider to listen to the
    * provided ISelectionProvider for changes. 
    * 
    * @see leave
    * @param provider
    */
public void follow(ISelectionProvider provider) {
    if (provider instanceof IPostSelectionProvider) {
        IPostSelectionProvider postProvider = (IPostSelectionProvider) provider;
        postProvider.addPostSelectionChangedListener(selectionChangedListener);
    } else {
        provider.addSelectionChangedListener(selectionChangedListener);
    }
}
项目:OpenSPIFe    文件:EnsembleSelectionProvider.java   
/**
    * Set this EnsembleSelectionProvider to no longer
    * follow the provided ISelectionProvider.
    * 
    * @see follow
    * @param provider
    */
public void leave(ISelectionProvider provider) {
    provider.removeSelectionChangedListener(selectionChangedListener);
    if (provider instanceof IPostSelectionProvider) {
        IPostSelectionProvider postProvider = (IPostSelectionProvider) provider;
        postProvider.removePostSelectionChangedListener(selectionChangedListener);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaEditor.java   
/**
 * Installs this selection changed listener with the given selection provider. If
 * the selection provider is a post selection provider, post selection changed
 * events are the preferred choice, otherwise normal selection changed events
 * are requested.
 *
 * @param selectionProvider the selection provider
 */
public void install(ISelectionProvider selectionProvider) {
    if (selectionProvider == null)
        return;

    if (selectionProvider instanceof IPostSelectionProvider)  {
        IPostSelectionProvider provider= (IPostSelectionProvider) selectionProvider;
        provider.addPostSelectionChangedListener(this);
    } else  {
        selectionProvider.addSelectionChangedListener(this);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaEditor.java   
/**
 * Removes this selection changed listener from the given selection provider.
 *
 * @param selectionProvider the selection provider
 */
public void uninstall(ISelectionProvider selectionProvider) {
    if (selectionProvider == null)
        return;

    if (selectionProvider instanceof IPostSelectionProvider)  {
        IPostSelectionProvider provider= (IPostSelectionProvider) selectionProvider;
        provider.removePostSelectionChangedListener(this);
    } else  {
        selectionProvider.removeSelectionChangedListener(this);
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaEditor.java   
/**
 * Installs this selection changed listener with the given selection provider. If
 * the selection provider is a post selection provider, post selection changed
 * events are the preferred choice, otherwise normal selection changed events
 * are requested.
 *
 * @param selectionProvider the selection provider
 */
public void install(ISelectionProvider selectionProvider) {
    if (selectionProvider == null)
        return;

    if (selectionProvider instanceof IPostSelectionProvider)  {
        IPostSelectionProvider provider= (IPostSelectionProvider) selectionProvider;
        provider.addPostSelectionChangedListener(this);
    } else  {
        selectionProvider.addSelectionChangedListener(this);
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaEditor.java   
/**
 * Removes this selection changed listener from the given selection provider.
 *
 * @param selectionProvider the selection provider
 */
public void uninstall(ISelectionProvider selectionProvider) {
    if (selectionProvider == null)
        return;

    if (selectionProvider instanceof IPostSelectionProvider)  {
        IPostSelectionProvider provider= (IPostSelectionProvider) selectionProvider;
        provider.removePostSelectionChangedListener(this);
    } else  {
        selectionProvider.removeSelectionChangedListener(this);
    }
}
项目:Environment    文件:ProjectEditorSelectionService.java   
/**
 * Sets a new selection provider to delegate to. Selection listeners
 * registered with the previous delegate are removed before.
 * 
 * @param newDelegate
 *            new selection provider
 */
public void setSelectionProviderDelegate(ISelectionProvider newDelegate)
{
    if (delegate == newDelegate)
    {
        fireSelectionChanged(newDelegate.getSelection());
        firePostSelectionChanged(newDelegate.getSelection());
        return;
    }
    if (delegate != null)
    {
        delegate.removeSelectionChangedListener(selectionListener);
        if (delegate instanceof IPostSelectionProvider)
        {
            ((IPostSelectionProvider) delegate).removePostSelectionChangedListener(postSelectionListener);
        }
    }
    delegate = newDelegate;
    if (newDelegate != null)
    {
        newDelegate.addSelectionChangedListener(selectionListener);
        if (newDelegate instanceof IPostSelectionProvider)
        {
            ((IPostSelectionProvider) newDelegate).addPostSelectionChangedListener(postSelectionListener);
        }
        fireSelectionChanged(newDelegate.getSelection());
        firePostSelectionChanged(newDelegate.getSelection());
    }
}
项目:antlr4ide    文件:RailroadSelectionLinker.java   
public void setXtextEditor(final XtextEditor xtextEditor) {
  if (currentEditor != null) {
    removeTextSelectionListener(currentEditor);
  }
  if (language.equals(xtextEditor.getLanguageName())) {
    currentEditor = xtextEditor;
    ISelectionProvider selectionProvider = xtextEditor.getSelectionProvider();
    if (selectionProvider instanceof IPostSelectionProvider) {
      ((IPostSelectionProvider) selectionProvider)
          .addPostSelectionChangedListener(textSelectionChangeListener);
    } else {
      selectionProvider.addSelectionChangedListener(textSelectionChangeListener);
    }
  }
}
项目:antlr4ide    文件:RailroadSelectionLinker.java   
protected void removeTextSelectionListener(final XtextEditor editor) {
  ISelectionProvider selectionProvider = editor.getSelectionProvider();
  if (selectionProvider != null) {
    if (selectionProvider instanceof IPostSelectionProvider) {
      ((IPostSelectionProvider) selectionProvider)
          .removePostSelectionChangedListener(textSelectionChangeListener);
    } else {
      selectionProvider.removeSelectionChangedListener(textSelectionChangeListener);
    }
  }
}
项目:e4macs    文件:ExecuteCommandHandler.java   
/**
 * Add the selection changed listener
 *  
 * @param selectionProvider
 */
private void addListener(ISelectionProvider selectionProvider, ISelectionChangedListener listener) {
    if (selectionProvider instanceof IPostSelectionProvider)  {
        IPostSelectionProvider provider= (IPostSelectionProvider) selectionProvider;
        provider.addPostSelectionChangedListener(listener);
    } else  {
        selectionProvider.addSelectionChangedListener(listener);
    }
}
项目:e4macs    文件:ExecuteCommandHandler.java   
/**
 * Remove the selection changed listener
 * 
 * @param selectionProvider
 */
private void removeListener(ISelectionProvider selectionProvider, ISelectionChangedListener listener) {
    if (selectionProvider instanceof IPostSelectionProvider)  {
        IPostSelectionProvider provider= (IPostSelectionProvider) selectionProvider;
        provider.removePostSelectionChangedListener(listener);
    } else  {
        selectionProvider.removeSelectionChangedListener(listener);
    }
}
项目:bts    文件:OccurrenceMarker.java   
public void connect(XtextEditor editor, boolean isMarkOccurrences) {
    this.editor = editor;
    ((IPostSelectionProvider) editor.getSelectionProvider())
            .addPostSelectionChangedListener(getSelectionChangedListener());
    this.isMarkOccurrences = isMarkOccurrences;
}
项目:bts    文件:OccurrenceMarker.java   
public void disconnect(XtextEditor editor) {
    ((IPostSelectionProvider) editor.getSelectionProvider())
            .removePostSelectionChangedListener(getSelectionChangedListener());
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaEditor.java   
@Override
public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
    super.addPostSelectionChangedListener(listener);
    if (getSourceViewer() != null && getSourceViewer().getSelectionProvider() instanceof IPostSelectionProvider)
        fPostSelectionListeners.add(listener);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaEditor.java   
@Override
public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
    super.addPostSelectionChangedListener(listener);
    if (getSourceViewer() != null && getSourceViewer().getSelectionProvider() instanceof IPostSelectionProvider)
        fPostSelectionListeners.add(listener);
}