[Solved] Custom content Assist [message #870256] |
Mon, 07 May 2012 13:25 |
Freddy H Messages: 26 Registered: April 2012 |
Junior Member |
|
|
Hi,
I have a problem with my content assist,
I try to apply a label provider on my content assist but there is no effect
i use :
@Override
public void configureContentProposalLabelProvider(Binder binder) {
binder.bind(ILabelProvider.class).
annotatedWith(ContentProposalLabelProvider.class).
to(MyLabelProvider.class);
}
with
MyLabelProvider contains method getText() and getImage() for grammar element's...
Fred.
[Updated on: Thu, 10 May 2012 16:28] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Custom content Assist [message #870675 is a reply to message #870671] |
Wed, 09 May 2012 10:08 |
|
Hi try to find out if the label provider that is injected to the
content assist is ever called for the place you are talking about. I
guess the answer is not. Never the less you can customize the
Complete methods in the proposal provider and call
createCompletionproposal with an image
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
|
|
Re: Custom content Assist [message #870804 is a reply to message #870757] |
Wed, 09 May 2012 18:17 |
|
Hi,
you did not post your complete grammar. thus its hard to tell how this could look like.
so let us asume your grammar would look like
EnumDecl: enumName=ID "{" propertyEnum+=ID ("," propertyEnum+=ID)* "}";
then you could do
public class MyDslProposalProvider extends AbstractMyDslProposalProvider {
@Inject
private IImageHelper imageHelper;
@Override
public void completeEnumDecl_EnumName(EObject model, Assignment assignment,
ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
//icons/"Entity.gif
acceptor.accept(createCompletionProposal("EnumName", "New EnumName", imageHelper.getImage("Entity.gif"), context));
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04851 seconds