Cast of an IEObjectDescription object [message #1053580] |
Mon, 06 May 2013 11:22  |
Eclipse User |
|
|
|
I've been digging into the forum and I couldn't find anything about the issue I'm gonna explain. Here it's:
I'm writing a proposal provider for an element of my grammar (let's say element of type T and attribute attr). The idea is that when someone presses CTRL + SPACE the list to be show should be filtered according to certain logic. The following code shows how I'm retrieving the default information to be displayed by the proposal provider:
//Method
@Override
public void completeT_Attr(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
IScope scope = provider.getScope(model, MyDSLPackage.eINSTANCE.getAttr());
EClass ec = null;
QualifiedName nameElemQN = null;
ICompletionProposal completionProposal = null;
for (IEObjectDescription element : scope.getAllElements()) {
/*
* What should I use to cast the element object
* to an object of a typed defined in my grammar??
MyTypeOfInterest obj = (MyTypeOfInterest)element.XXXXX;
*/
}
}
Can anyone tell me how should I proceed to make the cast work? Is it the right approach to customize a proposal provider where the information to be displayed by the proposal provided comes from different files?
Thanks for your help.
-Alfredo.
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.30827 seconds