Why are my children and edges null when i get my diagram not using an editor? [message #210052] |
Thu, 30 October 2008 19:06  |
Eclipse User |
|
|
|
Why when i get my diagram from the following code are my
allChildren=null, allEdges=null, transientEdges = null, and
transientChildren=null.
TransactionalEditingDomain myEditingDomain =
GMFEditingDomainFactory.INSTANCE.createEditingDomain();
ResourceSet resourceSet = myEditingDomain.getResourceSet();
Resource modelResource = resourceSet.getResource(URI.
createPlatformResourceURI(resource.getFullPath().toString(), true), true);
if (modelResource.getContents().get(0) instanceof DiagramImpl) {
Diagram obj = (Diagram) modelResource.getContents().get(0);
...
}
I'm trying to pass the Diagram to Validate action to get validation on
my diagram without opening it up in an editor.
Am I doing something wrong, Is there a better approach.
Thanks
Brian Jakubik
|
|
|
|
|
Re: Why are my children and edges null when i get my diagram not usingan editor? [message #210223 is a reply to message #210210] |
Fri, 31 October 2008 18:17  |
Eclipse User |
|
|
|
OK, after more research I realized I can add a CrossReferenceAdapter to
my ResourceSet, I think I have everything I need, however I will play
with it more on Monday. Thanks for the help.
B
Brian Jakubik wrote:
> Alex thanks for the reply, I did find that my connection was transient,
> and after changing it to false, it appeared in the diagram file, and
> persisted children and persisted edges were in my inspected DiagramImpl.
>
> However, passing that to ValidateAction still results in incorrect
> validation results...
>
> An example is we have validation that checks that particular nodes have
> incoming connections, it is being validated incorrectly saying it has no
> incoming connections although it does. This may be in part because I
> cannot get a CrossReferenceAdapter from the EObject I'm validating when
> I validate not through the editor...
>
> Any more ideas?
>
> Thanks
> B
>
>
>
> Alex Shatalin wrote:
>> Hello Brian,
>>
>> Can you check that the diagram content (child nodes) was actually
>> stored into this file? If all the diagram nodes are "transient" then
>> seved diagram will be empty.
>>
>> -----------------
>> Alex Shatalin
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.26602 seconds