[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
AW: AW: [geclipse-dev] JSDL job description creation
|
Hi Romain, Hi Kasia,
> To do it just replace this code:
> JSDLJobDescription jsdl = new JSDLJobDescription( file );
> jsdl.create(new JSDLJobDescriptionCreator());
>
> with this one:
> //JSDLJobDescription object was created by g-Eclipse when
.jsdl
> file was created
> JSDLJobDescription jsdl = null;
> //...just ask GridModel for JSDLJobDescription
> IGridElement element = GridModel.getRoot().findElement(
file );
> //and to be on the safe side - check if you were given
proper
> object
> if (element instanceof JSDLJobDescription){
> jsdl = ( JSDLJobDescription )element;
> }
Thanks for the hint Kasia, you're of course right. Nevertheless there is
a trapdoor in this approach. When an IFile is created the model listens
to the resource plug-in and creates the grid model elements when the
resource plug-in reports a new element in the workspace. But since the
resource notifications are done asynchronously the model element may not
been set up just after the IFile was created but will be set up when the
resource plug-in enters the next notification cycle.
Just wanted to mention this. So Romain, you may have to either poll the
model for the new element to appear or to act as a listener to the model
in order to get informed when the new element finally appeared.
If you have any further questions on this do not hesitate to ask.
Cheers, Mathias