[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Editor doesn't recognizes model changes.

Hello Alex,

first: thank you for the tipp with the AbstractTransactionalCommand. Now I`m abel to create new vehicles and add them to the right location :)
I can even delete vehicles :D



But now I have exactly this problem what I thought I would have: When I create a new vehicle, the section which shows the vehicles doesn`t recognize the change. I can see the new vehicle not before I click on the diagram surface and go back to the vehicles-Tab.
So my first question is: How can I notify the other section of the data-change?
(Interestingly the LocationEditPart.handleNotificationEvent() is called when a vehicle is created or deleted)



And I have a new problem:
As you can see in my former mail, I need to create for each vehicle a group with labels, texts and a delete-button. So that means I need to write a for-each-construct which iterates over all vehicles, creates the elements and fills them with the data at once. The only place where I can do that is in the method refresh(). Because in the Method createContents() I don`t know anything about the input. The input is set within the Method setInput() and that method is called AFTER createContents().
BUT refresh() is called more often than createContents(). So everytime I select my tab, refresh() is called and ADDs new vehicles instead of redraw (or overdraw) the existing.
My second question: How can I remove all elements which are drawn into the parent-composite?



Best wishes and thanks in advance! Julia