|
Lines 9-14
Link Here
|
| 9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
| 10 |
* Guy Gurfinkel, guy.g@zend.com - [content assist][api] provide better access to ContentAssistant - https://bugs.eclipse.org/bugs/show_bug.cgi?id=169954 |
10 |
* Guy Gurfinkel, guy.g@zend.com - [content assist][api] provide better access to ContentAssistant - https://bugs.eclipse.org/bugs/show_bug.cgi?id=169954 |
| 11 |
* Anton Leherbauer (Wind River Systems) - [content assist][api] ContentAssistEvent should contain information about auto activation - https://bugs.eclipse.org/bugs/show_bug.cgi?id=193728 |
11 |
* Anton Leherbauer (Wind River Systems) - [content assist][api] ContentAssistEvent should contain information about auto activation - https://bugs.eclipse.org/bugs/show_bug.cgi?id=193728 |
|
|
12 |
* Marcel Bruch, bruch@cs.tu-darmstadt.de - [content assist] Allow to re-sort proposals - https://bugs.eclipse.org/bugs/show_bug.cgi?id=350991 |
| 12 |
*******************************************************************************/ |
13 |
*******************************************************************************/ |
| 13 |
package org.eclipse.jface.text.contentassist; |
14 |
package org.eclipse.jface.text.contentassist; |
| 14 |
|
15 |
|
|
Lines 985-990
public class ContentAssistant implements IContentAssistant, IContentAssistantExt
Link Here
|
| 985 |
*/ |
986 |
*/ |
| 986 |
private boolean fIsColoredLabelsSupportEnabled= false; |
987 |
private boolean fIsColoredLabelsSupportEnabled= false; |
| 987 |
|
988 |
|
|
|
989 |
/** |
| 990 |
* The sorter used to order completion proposals before presented. |
| 991 |
*/ |
| 992 |
private ICompletionProposalSorter fSorter; |
| 993 |
|
| 988 |
|
994 |
|
| 989 |
/** |
995 |
/** |
| 990 |
* Creates a new content assistant. The content assistant is not automatically activated, |
996 |
* Creates a new content assistant. The content assistant is not automatically activated, |
|
Lines 1375-1380
public class ContentAssistant implements IContentAssistant, IContentAssistantExt
Link Here
|
| 1375 |
fContextInfoPopup= fContentAssistSubjectControlAdapter.createContextInfoPopup(this); |
1381 |
fContextInfoPopup= fContentAssistSubjectControlAdapter.createContextInfoPopup(this); |
| 1376 |
fProposalPopup= fContentAssistSubjectControlAdapter.createCompletionProposalPopup(this, controller); |
1382 |
fProposalPopup= fContentAssistSubjectControlAdapter.createCompletionProposalPopup(this, controller); |
| 1377 |
|
1383 |
|
|
|
1384 |
registerSorterWithProposalPopup(); |
| 1385 |
|
| 1378 |
registerHandler(SELECT_NEXT_PROPOSAL_COMMAND_ID, fProposalPopup.createProposalSelectionHandler(CompletionProposalPopup.ProposalSelectionHandler.SELECT_NEXT)); |
1386 |
registerHandler(SELECT_NEXT_PROPOSAL_COMMAND_ID, fProposalPopup.createProposalSelectionHandler(CompletionProposalPopup.ProposalSelectionHandler.SELECT_NEXT)); |
| 1379 |
registerHandler(SELECT_PREVIOUS_PROPOSAL_COMMAND_ID, fProposalPopup.createProposalSelectionHandler(CompletionProposalPopup.ProposalSelectionHandler.SELECT_PREVIOUS)); |
1387 |
registerHandler(SELECT_PREVIOUS_PROPOSAL_COMMAND_ID, fProposalPopup.createProposalSelectionHandler(CompletionProposalPopup.ProposalSelectionHandler.SELECT_PREVIOUS)); |
| 1380 |
|
1388 |
|
|
Lines 2462-2465
public class ContentAssistant implements IContentAssistant, IContentAssistantExt
Link Here
|
| 2462 |
fIsColoredLabelsSupportEnabled= isEnabled; |
2470 |
fIsColoredLabelsSupportEnabled= isEnabled; |
| 2463 |
} |
2471 |
} |
| 2464 |
|
2472 |
|
|
|
2473 |
/** |
| 2474 |
* Sets the sorter used to reorder proposal completions on typing |
| 2475 |
* |
| 2476 |
* @param sorter the sorter that specifies the order how the proposals are presented to the user |
| 2477 |
* @since 3.8 |
| 2478 |
* @see CompletionProposalPopup#setSorter(ICompletionProposalSorter) |
| 2479 |
*/ |
| 2480 |
public void setSorter(ICompletionProposalSorter sorter) { |
| 2481 |
fSorter= sorter; |
| 2482 |
registerSorterWithProposalPopup(); |
| 2483 |
} |
| 2484 |
|
| 2485 |
/** |
| 2486 |
* Registers the current sorter with the proposal popup - if the popup is already available. |
| 2487 |
* Does nothing otherwise. |
| 2488 |
*/ |
| 2489 |
private void registerSorterWithProposalPopup() { |
| 2490 |
if (fProposalPopup != null) { |
| 2491 |
fProposalPopup.setSorter(fSorter); |
| 2492 |
} |
| 2493 |
} |
| 2465 |
} |
2494 |
} |