|
Re: AdditionalProposalInfo for enum rule [message #714127 is a reply to message #713883] |
Tue, 09 August 2011 21:04 |
|
Hi,
i guess you have to hack completeKeyword
@Override
public void completeKeyword(Keyword keyword,
ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor) {
if (keyword.eContainer() instanceof EnumLiteralDeclaration) {
EnumLiteralDeclaration enumLiteral = (EnumLiteralDeclaration)keyword.eContainer();
acceptor.accept(createCompletionProposal(enumLiteral.getEnumLiteral().getLiteral(),
"This is the literal for " + enumLiteral.getEnumLiteral().getName(),
null,
contentAssistContext));
} else {
super.completeKeyword(keyword, contentAssistContext, acceptor);
}
}
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: AdditionalProposalInfo for enum rule [message #714252 is a reply to message #714127] |
Wed, 10 August 2011 06:53 |
Steffen Schuette Messages: 26 Registered: August 2010 |
Junior Member |
|
|
Hi,
thanks for the reply. This is not 100% what I ment but you got me on the right track with the completekeywork function. I only changed the true branch of the if statement in your code to inject the additional info text:
EnumLiteralDeclaration enumLiteral = (EnumLiteralDeclaration)keyword.eContainer();
ConfigurableCompletionProposal proposal = (ConfigurableCompletionProposal) createCompletionProposal(enumLiteral.getEnumLiteral().getLiteral(),contentAssistContext);
proposal.setAdditionalProposalInfo("Additional info for " + enumLiteral.getEnumLiteral().getLiteral());
acceptor.accept(proposal);
Thank you very much.
Steffen
[Updated on: Wed, 10 August 2011 06:54] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02080 seconds