Iterate through Diagram roots [message #156639] |
Mon, 22 October 2007 10:10 |
Eclipse User |
|
|
|
Originally posted by: trommas.yahoo.com
I want to iterate through all books, no matter which diagram root they
belong to.
I've tried this to iterate through all libraries (diagram roots), but it
only iterate through a single library.
for (Resource a : library.eResource().getResourceSet().getResources()) {
Library library = (Library) resource.getContents().get(0);
for (Book book : library.getBooks()) {
System.out.println(book.getName());
}
}
Any ideas?
Thanks,
Tomas
|
|
|
|
Re: Iterate through Diagram roots [message #156671 is a reply to message #156663] |
Mon, 22 October 2007 13:36 |
Eclipse User |
|
|
|
Originally posted by: trommas.yahoo.com
Thanks SKuhn.
It's unfortunately not possible (or very difficult) to iterate all
diagram roots (because they are in different files etc.)
So I have some other ideas (The problem is that my model elements wraps
objects from a owl-file (they have listeners attached), this causes sync
problems with gmf):
Is there perhaps a refresh diagram command I could call when the user
selects a tab (or switches focus to a window) with a diagram in it?, or
(slightly more unattractive) I could make a menu element which runs an
update command on the diagram.
Any suggestions or tips welcome :)
Regards,
Tomas
|
|
|
|
handleMajorSemanticChange (was: Iterate through Diagram roots) [message #157847 is a reply to message #156685] |
Wed, 31 October 2007 09:08 |
Eclipse User |
|
|
|
Originally posted by: trommas.yahoo.com
SKuhn wrote:
> There's a handleMajorSemanticChange command in the EditParts. I'm not
> sure what it's doing exactly, but it already helped me once. I just
> figured out that it's refreshing nearly every element in the diagram.
How strange! I searched for the methodcall to handleMajorSemanticChange
and found it in the taipan and mindmap projects I've downloaded.. But
not in my own plugins!
The method it called ex from TopicEditPart's handleNotificationEvent
method. My similar class has no handleMajorSemanticChange method at all
(and hence handleMajorSemanticChange is never called)
Why is this?
Regards,
Tomas Zijdemans
|
|
|
Powered by
FUDForum. Page generated in 0.03870 seconds