Source:
<code>private void addRefContentProposalToText(final Text textField) { KeyStroke stroke = UIUtils <START> .getKeystrokeOfBestActiveBindingFor("org.eclipse.ui.edit.text.contentAssist.proposals"); END> if (stroke != null) UIUtils.addBulbDecorator(textField, NLS.bind( UIText.FetchGerritChangePage_ContentAssistTooltip, stroke.format())); IContentProposalProvider cp = new IContentProposalProvider() { public IContentProposal[] getProposals(String contents, int position) { List<IContentProposal> resultList = new ArrayList<IContentProposal>(); String patternString = contents; while (patternString.length() > 0 && patternString.charAt(0) == ' ') patternString = patternString.substring(1); patternString = Pattern.quote(patternString); patternString = patternString.replaceAll("\\x2A", ".*"); if (!patternString.endsWith(".*")) patternString = patternString + ".*"; Pattern pattern; try { pattern = Pattern.compile(patternString, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { pattern = null; } List<Change> proposals; try { proposals = getRefsForContentAssist(); } catch (InvocationTargetException e) { Activator.handleError(e.getMessage(), e, false); return null; } catch (InterruptedException e) { return null; } if (proposals != null) for (final Change ref : proposals) { if (pattern != null && !pattern.matcher( ref.getChangeNumber().toString()) .matches()) continue; IContentProposal propsal = new ChangeContentProposal( ref); resultList.add(propsal); } return resultList.toArray(new IContentProposal[resultList .size()]); } }; ContentProposalAdapter adapter = new ContentProposalAdapter(textField, new TextContentAdapter(), cp, stroke, null); adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); }</code><technical_language>IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST (also in other places)</technical_language>

Target:
private void addRefContentProposalToText(final Text textField) { KeyStroke stroke = UIUtils .getKeystrokeOfBestActiveBindingFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST); if (stroke != null) UIUtils.addBulbDecorator(textField, NLS.bind( UIText.FetchGerritChangePage_ContentAssistTooltip, stroke.format())); IContentProposalProvider cp = new IContentProposalProvider() { public IContentProposal[] getProposals(String contents, int position) { List<IContentProposal> resultList = new ArrayList<IContentProposal>(); String patternString = contents; while (patternString.length() > 0 && patternString.charAt(0) == ' ') patternString = patternString.substring(1); patternString = Pattern.quote(patternString); patternString = patternString.replaceAll("\\x2A", ".*"); if (!patternString.endsWith(".*")) patternString = patternString + ".*"; Pattern pattern; try { pattern = Pattern.compile(patternString, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { pattern = null; } List<Change> proposals; try { proposals = getRefsForContentAssist(); } catch (InvocationTargetException e) { Activator.handleError(e.getMessage(), e, false); return null; } catch (InterruptedException e) { return null; } if (proposals != null) for (final Change ref : proposals) { if (pattern != null && !pattern.matcher( ref.getChangeNumber().toString()) .matches()) continue; IContentProposal propsal = new ChangeContentProposal( ref); resultList.add(propsal); } return resultList.toArray(new IContentProposal[resultList .size()]); } }; ContentProposalAdapter adapter = new ContentProposalAdapter(textField, new TextContentAdapter(), cp, stroke, null); adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); }