|EditParts: Create additional children edit parts [message #503624]
||Tue, 15 December 2009 01:29
| No real name
Registered: July 2009
I have two different diagram editors:
1. An editor to create Function Block Types. Function Block Types have
input events, output events, input variables, and output variables among
2. An editor to create a Function Block Network. Networks contain
Function Blocks. Function Blocks have an attribute Type that points to a
Function Block Type. In addition, input/output events and variables can
be connected with each other. However, since these are stored in the
Function Block Type, Function Blocks themselves do not contain events
and variables and there cannot be connected to each other.
I would like my Function Blocks to create new events and variables
whenever their Type has been changed, so that their events and variables
correspond to those of the Function Block Type.
For this, I changed the method handleNotificationEvent() in FBEditPart
(The edit part of the Function Blocks). There I have access to the
notifier Function Block that has been changed, the feature that has been
changed, and the Function Block Type that is the new type of the
I thought I should create as well new edit parts for the events and
variables as new figures and assign the figures to the edit parts.
For this I create an EditPart Factory and use it's method
createEditPart(EditPart context, Object model). The context is the
FBEditPart of course and the model is the event/variable, but after
having a look at the method I noticed that the model has to be a View.
However, I cannot get the model from an element. I tried to use the
EditPart itself and used this.getModel to get the model of the Function
Block, but from there I cannot get to the model of the Function Block
Type or its events and variables.
Does anyone have an idea how to solve this?
Powered by FUDForum
. Page generated in 0.01982 seconds