Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Programatic Selection of NamedElement in UMLEditor
Programatic Selection of NamedElement in UMLEditor [message #477664] Thu, 07 August 2008 14:48 Go to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
I hope I have chosen the right newsgroup for my issue. Please correct me
if I am wrong.

I have taken the org.eclipse.uml2.uml.editor.presentation.UMLEditor from
CVS and have added in a method public void
propertyChange(PropertyChangeEvent event) to enable the editor to hear
PropertyChangedEvents from another custom plugin (with no GUI). This
propertyChange unpacks the event, containing a NamedElement, and calls
setSelection() to update the currently selected. The status bar in the
editor is selected but the main editor does nothing. It doesn't seem to
understand the NamedElement even though it is in its model.

Any help is much appreciated as I have exhausted all the approaches I can
think of.

Kind Regards,
Ronan
Re: Programatic Selection of NamedElement in UMLEditor [message #477669 is a reply to message #477664] Mon, 11 August 2008 17:55 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Okay I fixed this problem so I'll post the solution for anyone else who
might encounter it. There were a number of issues.

1. You must use the EObjects from the editingDomain
(AdapterFactoryEditingDomain) member variable. Using your own model
objects will not work as the GUI needs to manipulated via its model not
yours.

2. Any code which updates the GUI should run in a GUI thread. See
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/swt_threading.htm

3. For consistency ensure setSelection is called somewhere in the
PropertyChange menthod

Ronan
Re: Programatic Selection of NamedElement in UMLEditor [message #626861 is a reply to message #477664] Mon, 11 August 2008 17:55 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Okay I fixed this problem so I'll post the solution for anyone else who
might encounter it. There were a number of issues.

1. You must use the EObjects from the editingDomain
(AdapterFactoryEditingDomain) member variable. Using your own model
objects will not work as the GUI needs to manipulated via its model not
yours.

2. Any code which updates the GUI should run in a GUI thread. See
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/swt_threading.htm

3. For consistency ensure setSelection is called somewhere in the
PropertyChange menthod

Ronan
Previous Topic:Re: [UML2] how to load UML_PRIMITIVE_TYPES_LIBRARY
Next Topic:Constructors and Parameters
Goto Forum:
  


Current Time: Fri Apr 03 10:31:48 GMT 2020

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

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

Back to the top