@Test public void should_return_Test_Cases_proposal_for_relevant_prefixes() { for (String attempt : new String[] { "t", "* test", "*** test cases ***", TEST_CASES_PROPOSAL.toLowerCase() }) { RobotCompletionProposalSet proposalSet = visitor.visitAttempt(attempt, replacementRegion); verifyExpectedProposals(attempt, proposalSet, TEST_CASES_PROPOSAL); } }
@Override public RobotCompletionProposalSet visitAttempt(String attempt, IRegion replacementRegion) { assert attempt.equals(attempt.toLowerCase()); Map<String, RobotCompletionProposal> ourProposals = new LinkedHashMap<String, RobotCompletionProposal>(); String tableArgument = ParserUtil.parseTable(attempt); for (Entry<String, String> e : tableNameToFull.entrySet()) { if (e.getKey().startsWith(tableArgument)) { String proposal = e.getValue(); Image image = null; String displayString = e.getValue(); String additionalProposalInfo = null; String informationDisplayString = null; RobotCompletionProposal rcp = new RobotCompletionProposal(proposal, null, replacementRegion, image, displayString, informationDisplayString, additionalProposalInfo); rcp.setCursorPositionAdjustment(1); ourProposals.put(e.getValue(), rcp); } } RobotCompletionProposalSet ourProposalSet = new RobotCompletionProposalSet(); ourProposalSet.getProposals().addAll(ourProposals.values()); return ourProposalSet; }
TableAttemptVisitor implements AttemptVisitor { @Override public RobotCompletionProposalSet visitAttempt(String attempt, IRegion replacementRegion) { assert attempt.equals(attempt.toLowerCase()); Map<String, RobotCompletionProposal> ourProposals = new LinkedHashMap<String, RobotCompletionProposal>(); String tableArgument = ParserUtil.parseTable(attempt); for (Entry<String, String> e : tableNameToFull.entrySet()) { if (e.getKey().startsWith(tableArgument)) { String proposal = e.getValue(); Image image = null; String displayString = e.getValue(); String additionalProposalInfo = null; String informationDisplayString = null; RobotCompletionProposal rcp = new RobotCompletionProposal(proposal, null, replacementRegion, image, displayString, informationDisplayString, additionalProposalInfo); rcp.setCursorPositionAdjustment(1); ourProposals.put(e.getValue(), rcp); } } RobotCompletionProposalSet ourProposalSet = new RobotCompletionProposalSet(); ourProposalSet.getProposals().addAll(ourProposals.values()); return ourProposalSet; } }
TableAttemptVisitor implements AttemptVisitor { @Override public RobotCompletionProposalSet visitAttempt(String attempt, IRegion replacementRegion) { assert attempt.equals(attempt.toLowerCase()); Map<String, RobotCompletionProposal> ourProposals = new LinkedHashMap<String, RobotCompletionProposal>(); String tableArgument = ParserUtil.parseTable(attempt); for (Entry<String, String> e : tableNameToFull.entrySet()) { if (e.getKey().startsWith(tableArgument)) { String proposal = e.getValue(); Image image = null; String displayString = e.getValue(); String additionalProposalInfo = null; String informationDisplayString = null; RobotCompletionProposal rcp = new RobotCompletionProposal(proposal, null, replacementRegion, image, displayString, informationDisplayString, additionalProposalInfo); rcp.setCursorPositionAdjustment(1); ourProposals.put(e.getValue(), rcp); } } RobotCompletionProposalSet ourProposalSet = new RobotCompletionProposalSet(); ourProposalSet.getProposals().addAll(ourProposals.values()); return ourProposalSet; } TableAttemptVisitor(IPreferenceStore preferenceStore); }
TableAttemptVisitor implements AttemptVisitor { @Override public RobotCompletionProposalSet visitAttempt(String attempt, IRegion replacementRegion) { assert attempt.equals(attempt.toLowerCase()); Map<String, RobotCompletionProposal> ourProposals = new LinkedHashMap<String, RobotCompletionProposal>(); String tableArgument = ParserUtil.parseTable(attempt); for (Entry<String, String> e : tableNameToFull.entrySet()) { if (e.getKey().startsWith(tableArgument)) { String proposal = e.getValue(); Image image = null; String displayString = e.getValue(); String additionalProposalInfo = null; String informationDisplayString = null; RobotCompletionProposal rcp = new RobotCompletionProposal(proposal, null, replacementRegion, image, displayString, informationDisplayString, additionalProposalInfo); rcp.setCursorPositionAdjustment(1); ourProposals.put(e.getValue(), rcp); } } RobotCompletionProposalSet ourProposalSet = new RobotCompletionProposalSet(); ourProposalSet.getProposals().addAll(ourProposals.values()); return ourProposalSet; } TableAttemptVisitor(IPreferenceStore preferenceStore); @Override RobotCompletionProposalSet visitAttempt(String attempt, IRegion replacementRegion); }
TableAttemptVisitor implements AttemptVisitor { @Override public RobotCompletionProposalSet visitAttempt(String attempt, IRegion replacementRegion) { assert attempt.equals(attempt.toLowerCase()); Map<String, RobotCompletionProposal> ourProposals = new LinkedHashMap<String, RobotCompletionProposal>(); String tableArgument = ParserUtil.parseTable(attempt); for (Entry<String, String> e : tableNameToFull.entrySet()) { if (e.getKey().startsWith(tableArgument)) { String proposal = e.getValue(); Image image = null; String displayString = e.getValue(); String additionalProposalInfo = null; String informationDisplayString = null; RobotCompletionProposal rcp = new RobotCompletionProposal(proposal, null, replacementRegion, image, displayString, informationDisplayString, additionalProposalInfo); rcp.setCursorPositionAdjustment(1); ourProposals.put(e.getValue(), rcp); } } RobotCompletionProposalSet ourProposalSet = new RobotCompletionProposalSet(); ourProposalSet.getProposals().addAll(ourProposals.values()); return ourProposalSet; } TableAttemptVisitor(IPreferenceStore preferenceStore); @Override RobotCompletionProposalSet visitAttempt(String attempt, IRegion replacementRegion);  }