Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » MVC Question
MVC Question [message #188721] Fri, 22 July 2005 14:47 Go to next message
Josh Reed is currently offline Josh ReedFriend
Messages: 38
Registered: July 2009
Member
Here's a simple MVC question.

I have a GEF editor. When you select a figure, there is an associated
property page with it. If the user modifies a property, do I change the
model or do I tell the EditPart which changes the model?

Thanks,
Josh
Re: MVC Question [message #188769 is a reply to message #188721] Fri, 22 July 2005 16:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Are you talking about the properties view? If not, your custom property
page is the "controller" and should execute commands directly on the model.

"Josh Reed" <jareed@iastate.edu> wrote in message
news:dbr0u4$pm4$1@news.eclipse.org...
> Here's a simple MVC question.
>
> I have a GEF editor. When you select a figure, there is an associated
> property page with it. If the user modifies a property, do I change the
> model or do I tell the EditPart which changes the model?
>
> Thanks,
> Josh
Re: MVC Question [message #188810 is a reply to message #188769] Fri, 22 July 2005 18:26 Go to previous messageGo to next message
Josh Reed is currently offline Josh ReedFriend
Messages: 38
Registered: July 2009
Member
Yeah, I have a custom property page. I made the updates directly on the
model. The EditPart gets notified of the changes via
PropertyChangeListeners and updates the Figure accordingly.

Thanks,
Josh

Randy Hudson wrote:
> Are you talking about the properties view? If not, your custom property
> page is the "controller" and should execute commands directly on the model.
>
> "Josh Reed" <jareed@iastate.edu> wrote in message
> news:dbr0u4$pm4$1@news.eclipse.org...
>
>>Here's a simple MVC question.
>>
>>I have a GEF editor. When you select a figure, there is an associated
>>property page with it. If the user modifies a property, do I change the
>>model or do I tell the EditPart which changes the model?
>>
>>Thanks,
>>Josh
>
>
>
Re: MVC Question [message #188882 is a reply to message #188810] Fri, 22 July 2005 20:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You need to make it undoable or you may run into consistency problems when
the user undoes the stuff that is undoable/redoable.

"Josh Reed" <jareed@iastate.edu> wrote in message
news:dbrdo6$9gh$1@news.eclipse.org...
> Yeah, I have a custom property page. I made the updates directly on the
> model. The EditPart gets notified of the changes via
> PropertyChangeListeners and updates the Figure accordingly.
>
> Thanks,
> Josh
>
> Randy Hudson wrote:
>> Are you talking about the properties view? If not, your custom property
>> page is the "controller" and should execute commands directly on the
>> model.
>>
>> "Josh Reed" <jareed@iastate.edu> wrote in message
>> news:dbr0u4$pm4$1@news.eclipse.org...
>>
>>>Here's a simple MVC question.
>>>
>>>I have a GEF editor. When you select a figure, there is an associated
>>>property page with it. If the user modifies a property, do I change the
>>>model or do I tell the EditPart which changes the model?
>>>
>>>Thanks,
>>>Josh
>>
>>
Re: MVC Question [message #188942 is a reply to message #188882] Sun, 24 July 2005 15:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tankun.web.de

what do u mean "Make it undoable"?what should i make?
if i change the properties directly in the model,for example the location
of the model.it has no more relation with the Commands.and what will be
happen in the commandstack?

thx ur help
Re: MVC Question [message #189001 is a reply to message #188942] Mon, 25 July 2005 14:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: harsh.ti.com

What Randy is trying to say is if you change the model in anyway via
Commands, the user is able to undo/redo them if you support those
operations in your derived Command class.

Until you save your editor, any operation done via the CommandStack can be
undone even if they are changed from your custom property view.

Harsh
Re: MVC Question [message #189105 is a reply to message #188882] Mon, 25 July 2005 18:36 Go to previous message
Josh Reed is currently offline Josh ReedFriend
Messages: 38
Registered: July 2009
Member
I'll convert it over to using Commands down the road. I'm not even to
the point of using edit policies or anything like that yet. I've just
been working on getting the viewing working properly and a few other
experiments.

Thanks,
Josh


Randy Hudson wrote:
> You need to make it undoable or you may run into consistency problems when
> the user undoes the stuff that is undoable/redoable.
>
> "Josh Reed" <jareed@iastate.edu> wrote in message
> news:dbrdo6$9gh$1@news.eclipse.org...
>
>>Yeah, I have a custom property page. I made the updates directly on the
>>model. The EditPart gets notified of the changes via
>>PropertyChangeListeners and updates the Figure accordingly.
>>
>>Thanks,
>>Josh
>>
>>Randy Hudson wrote:
>>
>>>Are you talking about the properties view? If not, your custom property
>>>page is the "controller" and should execute commands directly on the
>>>model.
>>>
>>>"Josh Reed" <jareed@iastate.edu> wrote in message
>>>news:dbr0u4$pm4$1@news.eclipse.org...
>>>
>>>
>>>>Here's a simple MVC question.
>>>>
>>>>I have a GEF editor. When you select a figure, there is an associated
>>>>property page with it. If the user modifies a property, do I change the
>>>>model or do I tell the EditPart which changes the model?
>>>>
>>>>Thanks,
>>>>Josh
>>>
>>>
>
Previous Topic:Deleting a connection
Next Topic:Rulers & Guides- how long will they be internal?
Goto Forum:
  


Current Time: Tue Dec 10 15:07:50 GMT 2024

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

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

Back to the top