use of org.eclipse.che.ide.api.editor.link.HasLinkedMode in project che by eclipse.
the class JavaCodeAssistProcessor method showProposals.
private void showProposals(final CodeAssistCallback callback, final Proposals respons) {
List<ProposalPresentation> presentations = respons.getProposals();
final List<CompletionProposal> proposals = new ArrayList<>(presentations.size());
HasLinkedMode linkedEditor = editor instanceof HasLinkedMode ? (HasLinkedMode) editor : null;
for (final ProposalPresentation proposal : presentations) {
final CompletionProposal completionProposal = new JavaCompletionProposal(proposal.getIndex(), insertStyle(resources, proposal.getDisplayString()), getIcon(proposal.getImage()), client, respons.getSessionId(), linkedEditor, refactoringUpdater, editorAgent);
proposals.add(completionProposal);
}
callback.proposalComputed(proposals);
}
use of org.eclipse.che.ide.api.editor.link.HasLinkedMode in project che by eclipse.
the class JavaQuickAssistProcessor method showProposals.
private void showProposals(final CodeAssistCallback callback, final Proposals responds, TextEditor editor) {
List<ProposalPresentation> presentations = responds.getProposals();
final List<CompletionProposal> proposals = new ArrayList<>(presentations.size());
HasLinkedMode linkedEditor = editor instanceof HasLinkedMode ? (HasLinkedMode) editor : null;
for (ProposalPresentation proposal : presentations) {
CompletionProposal completionProposal;
String actionId = proposal.getActionId();
if (actionId != null) {
ProposalAction action = proposalActions.get(actionId);
completionProposal = new ActionCompletionProposal(insertStyle(javaResources, proposal.getDisplayString()), actionId, action, JavaCodeAssistProcessor.getIcon(proposal.getImage()));
} else {
completionProposal = new JavaCompletionProposal(proposal.getIndex(), insertStyle(javaResources, proposal.getDisplayString()), JavaCodeAssistProcessor.getIcon(proposal.getImage()), client, responds.getSessionId(), linkedEditor, refactoringUpdater, editorAgent);
}
proposals.add(completionProposal);
}
callback.proposalComputed(proposals);
}
Aggregations