if(!possibleValue.equals(defaultValue)) {
currentValid = currentValid || possibleValue.equals(currentValue);
if ((matchString.length() == 0) || possibleValue.startsWith(matchString)) {
String rString = "\"" + possibleValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
alternateMatch = "\"" + alternateMatch; //$NON-NLS-1$
CustomCompletionProposal proposal = new MarkupCompletionProposal(
rString, rOffset, rLength, possibleValue.length() + 1,
XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM),
rString, alternateMatch, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE, true);
contentAssistRequest.addProposal(proposal);
}
}
}
if(defaultValue != null && ((matchString.length() == 0) || defaultValue.startsWith(matchString))) {
String rString = "\"" + defaultValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
CustomCompletionProposal proposal = new MarkupCompletionProposal(
rString, rOffset, rLength, defaultValue.length() + 1,
XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DEFAULT),
rString, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
contentAssistRequest.addProposal(proposal);
}
}
else if (((attrDecl.getUsage() == CMAttributeDeclaration.FIXED) ||
(attrDecl.getAttrType().getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED)) &&
(attrDecl.getAttrType().getImpliedValue() != null)) {
// FIXED values
String value = attrDecl.getAttrType().getImpliedValue();
if ((value != null) && (value.length() > 0)) {
String rValue = "\"" + value + "\"";//$NON-NLS-2$//$NON-NLS-1$
CustomCompletionProposal proposal = new MarkupCompletionProposal(
rValue, contentAssistRequest.getReplacementBeginPosition(),
contentAssistRequest.getReplacementLength(), rValue.length() + 1,
image, rValue, null, proposedInfo,
XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
contentAssistRequest.addProposal(proposal);
if ((currentValue.length() > 0) && !value.equals(currentValue)) {
rValue = "\"" + currentValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
proposal = new MarkupCompletionProposal(rValue, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), rValue.length() + 1, image, rValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
contentAssistRequest.addProposal(proposal);
}
}
}
}
else {
// unknown attribute, so supply nice empty values
proposedInfo = getAdditionalInfo(null, elementDecl);
CustomCompletionProposal proposal = null;
if ((currentValue != null) && (currentValue.length() > 0)) {
String rValue = "\"" + currentValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
proposal = new MarkupCompletionProposal(rValue,
contentAssistRequest.getReplacementBeginPosition(),
contentAssistRequest.getReplacementLength(), 1, image,