Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Get a editpart according to a specified attribute value
Get a editpart according to a specified attribute value [message #126066] Sun, 13 May 2007 21:50 Go to next message
Eclipse UserFriend
Originally posted by: fanshuchuan.163.com

Hello,everybody
I need to get a editpart according to a specified attribute value (e.g.
ID=5)in the current diagramEditPart, and how can I make it?

thanks!
Peter
Re: Get a editpart according to a specified attribute value [message #126234 is a reply to message #126066] Mon, 14 May 2007 07:51 Go to previous messageGo to next message
Eclipse UserFriend
Hello Peter,

> I need to get a editpart according to a specified attribute value
> (e.g.
> ID=5)in the current diagramEditPart, and how can I make it?
Do you mean visualID or something else?.. Just call getChildren() to enumerate
all child EditParts and iterrate through..

-----------------
Alex Shatalin
Re: Get a editpart according to a specified attribute value [message #126778 is a reply to message #126234] Wed, 16 May 2007 09:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fanshuchuan.163.com

thanks all the same. the method you suggested may work, but it consumes
much time.
In my project, I need to create elements in the diagram editor
automatically including node elements and connections. To create a
connection between two node elements, the sourceEditPart and
targetEditPart should be identified by some attribute value(e.g. name),
and I wonder whether I can get the editParts easily while not having to
enumerate all the editParts and then search it one by one.
Re: Get a editpart according to a specified attribute value [message #127020 is a reply to message #126778] Thu, 17 May 2007 06:57 Go to previous message
Eclipse UserFriend
Hello Peter,

If you know notation model elements of lilnk source/target then you can use
GraphicalViewer.getEditPartRegistry().get(<nottionModelElement >) to query
EditPart.

-----------------
Alex Shatalin
Previous Topic:Selecting a Tab Programmatically in Properties
Next Topic:Opening a diagram through context menu
Goto Forum:
  


Current Time: Thu Apr 24 03:00:30 EDT 2025

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

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

Back to the top