diff options
author | Dani Megert | 2003-09-25 12:35:19 +0000 |
---|---|---|
committer | Dani Megert | 2003-09-25 12:35:19 +0000 |
commit | 5d4617050b9408aedef9c84403f0986154ef0199 (patch) | |
tree | 67f137f211824cd3aff25d36897a4bd7355621cb /org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContextInformationPopup.java | |
parent | 9a1c2bfa05407654e62828139e12c1b4c30c6069 (diff) | |
download | eclipse.platform.text-5d4617050b9408aedef9c84403f0986154ef0199.tar.gz eclipse.platform.text-5d4617050b9408aedef9c84403f0986154ef0199.tar.xz eclipse.platform.text-5d4617050b9408aedef9c84403f0986154ef0199.zip |
Fixed bug 43588: smart cursor positioning does not scroll window
Diffstat (limited to 'org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContextInformationPopup.java')
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContextInformationPopup.java | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContextInformationPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContextInformationPopup.java index 1ef5da15864..d18df69a002 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContextInformationPopup.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContextInformationPopup.java @@ -18,6 +18,7 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.events.VerifyEvent; @@ -80,6 +81,13 @@ class ContextInformationPopup implements IContentAssistListener { private Stack fContextFrameStack= new Stack(); + /** + * Selection listener on the text widget which is active + * while a context information pop up is shown. + * + * @since 3.0 + */ + private SelectionListener fTextWidgetSelectionListener; /** * Creates a new context information popup. @@ -203,7 +211,17 @@ class ContextInformationPopup implements IContentAssistListener { resize(); if (initial) { - if (fContentAssistant.addContentAssistListener(this, ContentAssistant.CONTEXT_INFO_POPUP)) { + if (fContentAssistant.addContentAssistListener(this, ContentAssistant.CONTEXT_INFO_POPUP)) { + if (fViewer.getTextWidget() != null) { + fTextWidgetSelectionListener= new SelectionAdapter() { + /* + * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) + */ + public void widgetSelected(SelectionEvent e) { + validateContextInformation(); + }}; + fViewer.getTextWidget().addSelectionListener(fTextWidgetSelectionListener); + } fContentAssistant.addToLayout(this, fContextInfoPopup, ContentAssistant.LayoutManager.LAYOUT_CONTEXT_INFO_POPUP, frame.fVisibleOffset); fContextInfoPopup.setVisible(true); } @@ -292,6 +310,10 @@ class ContextInformationPopup implements IContentAssistListener { fContentAssistant.removeContentAssistListener(this, ContentAssistant.CONTEXT_INFO_POPUP); + if (fViewer.getTextWidget() != null) + fViewer.getTextWidget().removeSelectionListener(fTextWidgetSelectionListener); + fTextWidgetSelectionListener= null; + fContextInfoPopup.setVisible(false); fContextInfoPopup.dispose(); fContextInfoPopup= null; |