The statement below would not compile because there seems a variable
name missing from the second declaration. But if I understand its
intent correctly, it's equivalent to:
IExecutionDMContext
dmc = (event.getDMContext()
instanceof IContainerDMContext) ? event.getDMContext() :
null;
Without understanding what you want to do with the context, i can't
really answer your questions.
Cheers,
Pawel
On 07/21/2010 02:30 PM, Rohit Girme wrote:
Hi,
I am trying to use/call DSF services for some time now. For many of
these services related to "run control" we need an IExecutionContext
object. The way I do it is as follows :
IContainerDMContext
abc = DMContexts.getAncestorOfType( event.getDMContext(),
IContainerDMContext.class )
if (abc != null)
{
IExecutionDMContext = !event.getDMContext().equals( abc ) ? event.getDMContext() :
null
}
This piece of code is inside an event listener, which listenes for an
MIStopped event. So basically, I get " IExecutionDMContext " from
MIStopped event object. I tried using ISuspendedDMEvent instead, to
make it generic. However it does not give the same result. I found the
above piece of code in some DSF file. So I know some DSF class uses it.
I have been looking through the source code for a while now. But this
is the only way I found that works.
My questions are :
Is the process I described above, the right one ?
Is there any better way to get the IExecutionDMContext object ?
Something more generic.
--
Thanks & Regards,
Rohit Girme
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
|