Link Here
|
193 |
} |
193 |
} |
194 |
|
194 |
|
195 |
private final class CommandKeyListener extends KeyAdapter { |
195 |
private final class CommandKeyListener extends KeyAdapter { |
|
|
196 |
private KeySequence fCommandSequence; |
197 |
|
198 |
private CommandKeyListener(KeySequence keySequence) { |
199 |
fCommandSequence= keySequence; |
200 |
} |
201 |
|
196 |
public void keyPressed(KeyEvent e) { |
202 |
public void keyPressed(KeyEvent e) { |
197 |
if (!Helper.okToUse(fProposalShell)) |
203 |
if (!Helper.okToUse(fProposalShell)) |
198 |
return; |
204 |
return; |
Link Here
|
346 |
* @since 3.2 |
352 |
* @since 3.2 |
347 |
*/ |
353 |
*/ |
348 |
private String fEmptyMessage= null; |
354 |
private String fEmptyMessage= null; |
349 |
/** |
|
|
350 |
* The invoking command sequence, possibly <code>null</code>. |
351 |
* |
352 |
* @since 3.2 |
353 |
*/ |
354 |
private KeySequence fCommandSequence= KeySequence.getInstance(); |
355 |
|
355 |
|
356 |
/** |
356 |
/** |
357 |
* Creates a new completion proposal popup for the given elements. |
357 |
* Creates a new completion proposal popup for the given elements. |
Link Here
|
615 |
* @since 3.2 |
615 |
* @since 3.2 |
616 |
*/ |
616 |
*/ |
617 |
private void addCommandSupport(final Control control) { |
617 |
private void addCommandSupport(final Control control) { |
618 |
fCommandSequence= fContentAssistant.getTriggerSequence(); |
618 |
final KeySequence commandSequence= fContentAssistant.getTriggerSequence(); |
619 |
if (!fCommandSequence.isEmpty() && fContentAssistant.isRepeatedInvocationMode()) { |
619 |
if (commandSequence != null && !commandSequence.isEmpty() && fContentAssistant.isRepeatedInvocationMode()) { |
620 |
control.addFocusListener(new FocusListener() { |
620 |
control.addFocusListener(new FocusListener() { |
621 |
private CommandKeyListener fCommandKeyListener; |
621 |
private CommandKeyListener fCommandKeyListener; |
622 |
public void focusGained(FocusEvent e) { |
622 |
public void focusGained(FocusEvent e) { |
623 |
if (Helper.okToUse(control)) { |
623 |
if (Helper.okToUse(control)) { |
624 |
if (fCommandKeyListener == null) { |
624 |
if (fCommandKeyListener == null) { |
625 |
fCommandKeyListener= new CommandKeyListener(); |
625 |
fCommandKeyListener= new CommandKeyListener(commandSequence); |
626 |
fProposalTable.addKeyListener(fCommandKeyListener); |
626 |
fProposalTable.addKeyListener(fCommandKeyListener); |
627 |
} |
627 |
} |
628 |
} |
628 |
} |