/** * Adds a proposal. * * @param proposal the string to be inserted * @param cursorPosition the cursor position after insertion, * relative to the start of the proposal * @param displayString the proposal's label * @param additionalInfo the additional information */ private void addProposal(String proposal, int cursorPosition, String displayString, String additionalInfo) { fProposals.add(new ContentProposal(proposal, displayString, additionalInfo, cursorPosition)); }
/** * Adds a proposal. * * @param proposal the string to be inserted * @param cursorPosition the cursor position after insertion, * relative to the start of the proposal * @param displayString the proposal's label * @param additionalInfo the additional information */ private void addProposal(String proposal, int cursorPosition, String displayString, String additionalInfo) { fProposals.add(new ContentProposal(proposal, displayString, additionalInfo, cursorPosition)); }
/** * Adds a proposal. * * @param proposal the string to be inserted * @param displayString the proposal's label * @param additionalInfo the additional information */ private void addProposal(String proposal, String displayString, String additionalInfo) { fProposals.add(new ContentProposal(proposal, displayString, additionalInfo)); }
/** * Adds a proposal. * * @param proposal the string to be inserted * @param displayString the proposal's label * @param additionalInfo the additional information */ private void addProposal(String proposal, String displayString, String additionalInfo) { fProposals.add(new ContentProposal(proposal, displayString, additionalInfo)); }
/** * Adds a proposal to the priority proposals list. * * @param proposal the string to be inserted * @param displayString the proposal's label * @param additionalInfo the additional information */ private void addPriorityProposal(String proposal, String displayString, String additionalInfo) { fPriorityProposals.add(new ContentProposal(proposal, displayString, additionalInfo)); }
/** * Adds a proposal to the priority proposals list. * * @param proposal the string to be inserted * @param displayString the proposal's label * @param additionalInfo the additional information */ private void addPriorityProposal(String proposal, String displayString, String additionalInfo) { fPriorityProposals.add(new ContentProposal(proposal, displayString, additionalInfo)); }
private void setProposals(Map<String, String> proposals) { contentProposals = new ContentProposal[proposals.size()]; int i = 0; for (Map.Entry<String, String> entry : proposals.entrySet()) { ContentProposal proposal = new ContentProposal(entry.getKey(), entry.getValue()); contentProposals[i++] = proposal; } }
/** * Adds a proposal. Ensures that existing pre- and postfixes are not duplicated. * * @param proposal the string to be inserted * @param cursorPosition the cursor position after insertion, * relative to the start of the proposal * @param displayString the proposal's label * @param additionalInfo the additional information */ private void addBracketProposal(String proposal, int cursorPosition, String displayString, String additionalInfo) { String prolog= fExpression.substring(0, fDocumentOffset); if (! fIsEscape && prolog.endsWith("\\") && proposal.startsWith("\\")) { //$NON-NLS-1$//$NON-NLS-2$ fProposals.add(new ContentProposal(proposal, displayString, additionalInfo, cursorPosition)); return; } for (int i= 1; i <= cursorPosition; i++) { String prefix= proposal.substring(0, i); if (prolog.endsWith(prefix)) { String postfix= proposal.substring(cursorPosition); String epilog= fExpression.substring(fDocumentOffset); if (epilog.startsWith(postfix)) { fPriorityProposals.add(new ContentProposal(proposal.substring(i, cursorPosition), displayString, additionalInfo, cursorPosition-i)); } else { fPriorityProposals.add(new ContentProposal(proposal.substring(i), displayString, additionalInfo, cursorPosition-i)); } return; } } fProposals.add(new ContentProposal(proposal, displayString, additionalInfo, cursorPosition)); }
/** * Adds a proposal. Ensures that existing pre- and postfixes are not duplicated. * * @param proposal the string to be inserted * @param cursorPosition the cursor position after insertion, * relative to the start of the proposal * @param displayString the proposal's label * @param additionalInfo the additional information */ private void addBracketProposal(String proposal, int cursorPosition, String displayString, String additionalInfo) { String prolog= fExpression.substring(0, fDocumentOffset); if (! fIsEscape && prolog.endsWith("\\") && proposal.startsWith("\\")) { //$NON-NLS-1$//$NON-NLS-2$ fProposals.add(new ContentProposal(proposal, displayString, additionalInfo, cursorPosition)); return; } for (int i= 1; i <= cursorPosition; i++) { String prefix= proposal.substring(0, i); if (prolog.endsWith(prefix)) { String postfix= proposal.substring(cursorPosition); String epilog= fExpression.substring(fDocumentOffset); if (epilog.startsWith(postfix)) { fPriorityProposals.add(new ContentProposal(proposal.substring(i, cursorPosition), displayString, additionalInfo, cursorPosition-i)); } else { fPriorityProposals.add(new ContentProposal(proposal.substring(i), displayString, additionalInfo, cursorPosition-i)); } return; } } fProposals.add(new ContentProposal(proposal, displayString, additionalInfo, cursorPosition)); }
&& proposal.substring(0, contents.length()) .equalsIgnoreCase(contents)) { list.add(new ContentProposal(proposal)); contentProposals = new IContentProposal[proposals.length]; for (int i = 0; i < proposals.length; i++) { contentProposals[i] = new ContentProposal(proposals[i]);
&& proposals[i].substring(0, contents.length()) .equalsIgnoreCase(contents)) { list.add(new ContentProposal(proposals[i])); contentProposals = new IContentProposal[proposals.length]; for (int i = 0; i < proposals.length; i++) { contentProposals[i] = new ContentProposal(proposals[i]);
&& proposals[i].substring(0, contents.length()) .equalsIgnoreCase(contents)) { list.add(new ContentProposal(proposals[i])); contentProposals = new IContentProposal[proposals.length]; for (int i = 0; i < proposals.length; i++) { contentProposals[i] = new ContentProposal(proposals[i]);
/** * Adds a proposal that starts with a backslash. * Ensures that the backslash is not repeated if already typed. * * @param proposal the string to be inserted * @param displayString the proposal's label * @param additionalInfo the additional information */ private void addBsProposal(String proposal, String displayString, String additionalInfo) { String prolog= fExpression.substring(0, fDocumentOffset); int position= proposal.length(); // If the string already contains the backslash, do not include in the proposal if (prolog.endsWith("\\")) { //$NON-NLS-1$ position--; proposal= proposal.substring(1); } if (fIsEscape) { fPriorityProposals.add(new ContentProposal(proposal, displayString, additionalInfo, position)); } else { addProposal(proposal, position, displayString, additionalInfo); } } }
/** * Adds a proposal that starts with a backslash. * Ensures that the backslash is not repeated if already typed. * * @param proposal the string to be inserted * @param displayString the proposal's label * @param additionalInfo the additional information */ private void addBsProposal(String proposal, String displayString, String additionalInfo) { String prolog= fExpression.substring(0, fDocumentOffset); int position= proposal.length(); // If the string already contains the backslash, do not include in the proposal if (prolog.endsWith("\\")) { //$NON-NLS-1$ position--; proposal= proposal.substring(1); } if (fIsEscape) { fPriorityProposals.add(new ContentProposal(proposal, displayString, additionalInfo, position)); } else { addProposal(proposal, position, displayString, additionalInfo); } } }