Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Why are my children and edges null when i get my diagram not using an editor?
Why are my children and edges null when i get my diagram not using an editor? [message #210052] Thu, 30 October 2008 23:06 Go to next message
Brian Jakubik is currently offline Brian JakubikFriend
Messages: 140
Registered: July 2009
Senior Member
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 #210172 is a reply to message #210052] Fri, 31 October 2008 11:45 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
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
Re: Why are my children and edges null when i get my diagram not usingan editor? [message #210210 is a reply to message #210172] Fri, 31 October 2008 17:26 Go to previous messageGo to next message
Brian Jakubik is currently offline Brian JakubikFriend
Messages: 140
Registered: July 2009
Senior Member
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
>
>
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 22:17 Go to previous message
Brian Jakubik is currently offline Brian JakubikFriend
Messages: 140
Registered: July 2009
Senior Member
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
>>
>>
Previous Topic:EMFCompositePropertySource instead of PropertySource in XXXPropertySection
Next Topic:bendpoints drag&drop
Goto Forum:
  


Current Time: Tue Apr 13 17:37:27 GMT 2021

Powered by FUDForum. Page generated in 0.02015 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top