[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: Custom view and ... ??

That's the whole problem. You can't have direct reference to a model in View. When element in Editor was selected SelectionListener call selectionChange() in View object. Then using a IAdaptable (EditPart implements IAdaptable) i retrive data from EditPart as an Object of IMyProperties. Then I'm passing this object to the Viewer and I have this data displeyed in a View.
How to do this other way around, how to set data??


Cheers, Greg




Martijn van Steenbergen wrote:
Greg wrote:

I've created a custom view for my Graphical Plugin Editor in Eclipse.
Then I've added a my Custom Viwer to it. It creates a form using SWT for element properties. Using SelectionListener nicely it hookes in GraphicalEditor and getProperties from element and display this in a View. My problem is ... how to make it work other way around??????
When I type new things in my Form Text Boxes HOW TO REFLECT CHANGES IN A MODEL.


Well, you just change your model (model.setXxx(), or whatever kind of model you're using). If you're doing it the preferred way, your model has a notification mechanism so the GraphicalEditor will notice the model's changes and update its appearance. It's really very specific to your model. Take a look at the Model-View-Controller design pattern if this doesn't make much sense to you.

Good luck,

Martijn.