[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,

I don`t understand what you mean by "actually selected EMF object" and I don`t know, where "EMF-generated code for item providers" is. :(

So I just looked into the generated code and into SWT-code and looked up how other parts handle events and notify each other.

I tried this:
There ist this SelectionListener in the VehiclesAddSection, which cares when the "Add new vehicle"-Button is clicked. I added this to this Listener:


public static final int EVENT_VEHICLES_CHANGED = 0x1000; (this is defined outside of the Listener)

Event event = new Event();
event.type = EVENT_VEHICLES_CHANGED;
event.widget = thisParent;
thisParent.notifyListeners(EVENT_VEHICLES_CHANGED, event);


And in the VehiclesViewAndDeleteSection, which shows the vehicles, I added this:


thisParent.addListener(VehiclesAddSection.EVENT_VEHICLES_CHANGED, new Listener()
{
@Override
public void handleEvent(Event event)
{
drawVehicles();
}

});


So, now when I create a new vehicle, than handleEvent() in the other section should be called. But it isn`t called. notifyListeners() is called. Why? What do I wrong?

Best wishes
Julia