Source:
private void addRefContentProposalToText(final Text textField) { KeyStroke stroke; try { stroke = KeyStroke.getInstance("CTRL+SPACE"); UIUtils.addBulbDecorator(textField, NLS.bind( UIText.GerritConfigurationPage_BranchTooltipHover, stroke.format())); } catch (ParseException e1) { Activator.handleError(e1.getMessage(), e1, false); stroke = null; } 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; } Set<String> proposals = new TreeSet<String>(); try { Set<String> remotes = repository.getRefDatabase() .getRefs(Constants.R_REMOTES).keySet(); for (String remote : remotes) { int slashIndex = remote.indexOf('/'); if (slashIndex > 0 && slashIndex < remote.length() - 1) proposals .add(remote.substring(remote.indexOf('/') + 1)); } } catch (IOException e) { } for (final String proposal : proposals) { if (pattern != null && !pattern.matcher(proposal).matches()) continue; IContentProposal propsal = new BranchContentProposal( proposal); 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); }

Target:
private void addRefContentProposalToText(final Text textField) { KeyStroke stroke; try { stroke = KeyStroke.getInstance("CTRL+SPACE"); UIUtils.addBulbDecorator(textField, NLS.bind( UIText.GerritConfigurationPage_BranchTooltipHover, stroke.format())); } catch (ParseException e1) { Activator.handleError(e1.getMessage(), e1, false); stroke = null; } 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; } Set<String> proposals = new TreeSet<String>(); try { Set<String> remotes = repository .getRefDatabase() .getRefs(Constants.R_REMOTES + remoteName + "/").keySet(); proposals.addAll(remotes); } catch (IOException e) { } for (final String proposal : proposals) { if (pattern != null && !pattern.matcher(proposal).matches()) continue; IContentProposal propsal = new BranchContentProposal( proposal); 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); }