JvmType content proposal [message #1758929] |
Tue, 04 April 2017 12:54  |
Eclipse User |
|
|
|
Hello there,
I need a part of my dsl to refer to a subclass of a certain type. So I followed the content proposal method described on Karsten's blog
override public void completeJvmParameterizedTypeReference_Type(EObject model, Assignment assignment,
ContentAssistContext context, ICompletionProposalAcceptor acceptor)
{
if (EcoreUtil2.getContainerOfType(model, Input) !== null || EcoreUtil2.getContainerOfType(model, Rule) !== null)
{
val jvmTypeProvider = jvmTypeProviderFactory.createTypeProvider(model.eResource().getResourceSet());
val interfaceToImplement = jvmTypeProvider.findTypeByName("com.pc360.configurator.interfaces.Configurable")
typeProposalProvider.createSubTypeProposals(interfaceToImplement, this, context,
RuleDslPackage.Literals.INPUT__CONFIGURABLE, TypeMatchFilters.canInstantiate(), acceptor);
}
else
{
super.completeJvmParameterizedTypeReference_Type(model, assignment, context, acceptor);
}
}
This works exactly as assumed. The list of subclasses appears in the proposal popup. But, I have two problems:
1- If I select any value, it's not output in the editor. I don't see any errors. Just nothing happens.
2- If I input anything (as a prefix), I would expect it to be applied as an added filter. But it doesn't return anything anymore.
Thanks for your suggestions,
[Updated on: Tue, 04 April 2017 12:56] by Moderator
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03645 seconds