Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2006-10-13 10:43:13 +0000
committerDani Megert2006-10-13 10:43:13 +0000
commit0188ecf0ceaff877aee88b7041c143ddea27b93e (patch)
tree4a1f0370808847d523c12789cac230138e5baad1
parent41b0f6fd2a6e412105a9ab69c75ae949210762b4 (diff)
downloadeclipse.platform.text-0188ecf0ceaff877aee88b7041c143ddea27b93e.tar.gz
eclipse.platform.text-0188ecf0ceaff877aee88b7041c143ddea27b93e.tar.xz
eclipse.platform.text-0188ecf0ceaff877aee88b7041c143ddea27b93e.zip
Backported fix for bug 159699 - reviewed by Dirk.r322_v20061013
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java18
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java6
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContentAssistantExtension3.java2
3 files changed, 13 insertions, 13 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
index 7e0c2e119..12d3c44a8 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
@@ -187,6 +187,12 @@ class CompletionProposalPopup implements IContentAssistListener {
}
private final class CommandKeyListener extends KeyAdapter {
+ private KeySequence fCommandSequence;
+
+ private CommandKeyListener(KeySequence keySequence) {
+ fCommandSequence= keySequence;
+ }
+
public void keyPressed(KeyEvent e) {
if (!Helper.okToUse(fProposalShell))
return;
@@ -340,12 +346,6 @@ class CompletionProposalPopup implements IContentAssistListener {
* @since 3.2
*/
private String fEmptyMessage= null;
- /**
- * The invoking command sequence, possibly <code>null</code>.
- *
- * @since 3.2
- */
- private KeySequence fCommandSequence= KeySequence.getInstance();
/**
* Creates a new completion proposal popup for the given elements.
@@ -585,14 +585,14 @@ class CompletionProposalPopup implements IContentAssistListener {
* @since 3.2
*/
private void addCommandSupport(final Control control) {
- fCommandSequence= fContentAssistant.getTriggerSequence();
- if (!fCommandSequence.isEmpty() && fContentAssistant.isRepeatedInvocationMode()) {
+ final KeySequence commandSequence= fContentAssistant.getTriggerSequence();
+ if (commandSequence != null && !commandSequence.isEmpty() && fContentAssistant.isRepeatedInvocationMode()) {
control.addFocusListener(new FocusListener() {
private CommandKeyListener fCommandKeyListener;
public void focusGained(FocusEvent e) {
if (Helper.okToUse(control)) {
if (fCommandKeyListener == null) {
- fCommandKeyListener= new CommandKeyListener();
+ fCommandKeyListener= new CommandKeyListener(commandSequence);
fProposalTable.addKeyListener(fCommandKeyListener);
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java
index 194bc44d0..5c89b4af8 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java
@@ -811,7 +811,7 @@ public class ContentAssistant implements IContentAssistant, IContentAssistantExt
*
* @since 3.2
*/
- private KeySequence fTriggerSequence= KeySequence.getInstance();
+ private KeySequence fTriggerSequence;
/**
@@ -2122,13 +2122,13 @@ public class ContentAssistant implements IContentAssistant, IContentAssistantExt
* @since 3.2
*/
public void setRepeatedInvocationTrigger(KeySequence sequence) {
- Assert.isNotNull(sequence);
fTriggerSequence= sequence;
}
/**
* Returns the repeated invocation key sequence.
- * @return the repeated invocation key sequence
+ *
+ * @return the repeated invocation key sequence or <code>null</code>, if none
* @since 3.2
*/
KeySequence getTriggerSequence() {
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContentAssistantExtension3.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContentAssistantExtension3.java
index 3df202317..22cef8bd8 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContentAssistantExtension3.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContentAssistantExtension3.java
@@ -27,7 +27,7 @@ public interface IContentAssistantExtension3 {
* Sets the key sequence to listen for in repeated invocation mode. If the key sequence is
* encountered, a step in the repetition iteration is triggered.
*
- * @param sequence the key sequence to listen for in repeated invocation mode
+ * @param sequence the key sequence used for the repeated invocation mode or <code>null</code> if none
*/
public void setRepeatedInvocationTrigger(KeySequence sequence);
}

Back to the top