continue; final String targetDescription = currentTarget.getDescription();
/** * {@inheritDoc} */ @Internal @Override public String getDescription() { return target == null ? null : target.getDescription(); }
private ICompletionProposal[] getExtensionOfValueProposals(String prefix) { List<ICompletionProposal> extensions = new ArrayList<>(); Map<String, Target> targets = getTargets(); Set<String> targetNames = targets.keySet(); for (String targetName : targetNames) { Target currentTarget = targets.get(targetName); if (currentTarget instanceof ExtensionPoint) { extensions.add(new AntCompletionProposal(targetName, cursorPosition - prefix.length(), prefix.length(), targetName.length(), getTargetImage(targetName), targetName, targets.get(targetName).getDescription(), AntCompletionProposal.TASK_PROPOSAL)); } } return extensions.toArray(new ICompletionProposal[extensions.size()]); }
private ICompletionProposal[] getDefaultValueProposals(String prefix) { Map<String, Target> targets = getTargets(); List<AntCompletionProposal> defaultProposals = new ArrayList<>(targets.size()); Iterator<Target> itr = targets.values().iterator(); Target target; String targetName; while (itr.hasNext()) { target = itr.next(); targetName = target.getName(); if (targetName.toLowerCase().startsWith(prefix) && targetName.length() > 0) { defaultProposals.add(new AntCompletionProposal(targetName, cursorPosition - prefix.length(), prefix.length(), targetName.length(), getTargetImage(targetName), targetName, target.getDescription(), AntCompletionProposal.TASK_PROPOSAL)); } } ICompletionProposal[] proposals = new ICompletionProposal[defaultProposals.size()]; return defaultProposals.toArray(proposals); }
private ICompletionProposal[] getTargetProposals(IDocument document, String prefix) { String currentTargetName = getEnclosingTargetName(document, lineNumber, columnNumber); if (currentTargetName == null) { return NO_PROPOSALS; } Map<String, Target> targets = getTargets(); Set<String> targetNames = targets.keySet(); List<ICompletionProposal> proposals = new ArrayList<>(targets.size() - 2); // current target and implicit target for (String targetName : targetNames) { if (targetName.equals(currentTargetName)) { continue; } if (targetName.toLowerCase().startsWith(prefix) && targetName.length() > 0) { proposals.add(new AntCompletionProposal(targetName, cursorPosition - prefix.length(), prefix.length(), targetName.length(), getTargetImage(targetName), targetName, targets.get(targetName).getDescription(), AntCompletionProposal.TASK_PROPOSAL)); } } return proposals.toArray(new ICompletionProposal[proposals.size()]); }
public String getTargetDescription(String targetName) { AntTargetNode target = getTargetNode(targetName); if (target != null) { return target.getTarget().getDescription(); } return null; }
@Override public String getColumnText(Object element, int columnIndex) { if (columnIndex == 0) { AntElementNode node = (AntElementNode) element; return node.getLabel(); } String desc = ((AntTargetNode) element).getTarget().getDescription(); if (desc == null) { return IAntCoreConstants.EMPTY_STRING; } return desc; } }
/** * Returns whether this target is an internal target. Internal targets are targets which has no description or starts with hyphen ('-') character. * The default target is never considered internal. * * @return whether the given target is an internal target */ public boolean isInternal() { Target target = getTarget(); return (target.getDescription() == null || getTargetName().startsWith("-")) && !isDefaultTarget(); //$NON-NLS-1$ }
ICompletionProposal proposal = new AntCompletionProposal(targetName, cursorPosition - prefix.length(), prefix.length(), targetName.length(), getTargetImage(targetName), targetName, targets.get(targetName).getDescription(), AntCompletionProposal.TASK_PROPOSAL); proposals.add(proposal);
String description = target.getTarget().getDescription(); if (description != null && description.length() != 0) { message.append(AntViewMessages.AntView_4);
string2 = ((AntTargetNode) e2).getLabel(); } else { string1 = ((AntTargetNode) e1).getTarget().getDescription(); string2 = ((AntTargetNode) e2).getTarget().getDescription();
continue; targetDescription = currentTarget.getDescription();
final String targetDescription = target.getDescription(); if ((targetDescription != null) && (!targetDescription.equals(""))) { node.setAttributes(Node.ATTR_MAIN_NODE);
if (target.getDescription() != null) { addText(" description=\"", AntTargetNode.SOURCE_MARKUP); addText(target.getDescription(), AntTargetNode.SOURCE_ATTRIBUTE); addText("\"", AntTargetNode.SOURCE_MARKUP);