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(); }
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(); }
private void switchPosition(LinkedPosition pos, boolean select, boolean showProposals) { Assert.isNotNull(pos); if (pos.equals(fFramePosition)) return; if (fFramePosition != null && fCurrentTarget != null) fPositionListener.linkingFocusLost(fFramePosition, fCurrentTarget); // undo endCompoundChangeIfNeeded(); redraw(); // redraw current position being left - usually not needed IDocument oldDoc= fFramePosition == null ? null : fFramePosition.getDocument(); IDocument newDoc= pos.getDocument(); switchViewer(oldDoc, newDoc, pos); fFramePosition= pos; if (select) select(); if (fFramePosition == fExitPosition && !fIterator.isCycling()) leave(ILinkedModeListener.NONE); else { redraw(); // redraw new position ensureAnnotationModelInstalled(); } if (showProposals) triggerContentAssist(); if (fFramePosition != fExitPosition && fDoContextInfo) triggerContextInfo(); if (fFramePosition != null && fCurrentTarget != null) fPositionListener.linkingFocusGained(fFramePosition, fCurrentTarget); }
private void switchPosition(LinkedPosition pos, boolean select, boolean showProposals) { Assert.isNotNull(pos); if (pos.equals(fFramePosition)) return; if (fFramePosition != null && fCurrentTarget != null) fPositionListener.linkingFocusLost(fFramePosition, fCurrentTarget); // undo endCompoundChangeIfNeeded(); redraw(); // redraw current position being left - usually not needed IDocument oldDoc= fFramePosition == null ? null : fFramePosition.getDocument(); IDocument newDoc= pos.getDocument(); switchViewer(oldDoc, newDoc, pos); fFramePosition= pos; if (select) select(); if (fFramePosition == fExitPosition && !fIterator.isCycling()) leave(ILinkedModeListener.NONE); else { redraw(); // redraw new position ensureAnnotationModelInstalled(); } if (showProposals) triggerContentAssist(); if (fFramePosition != fExitPosition && fDoContextInfo) triggerContextInfo(); if (fFramePosition != null && fCurrentTarget != null) fPositionListener.linkingFocusGained(fFramePosition, fCurrentTarget); }