Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Design question on commands/actions
Design question on commands/actions [message #420595] Thu, 03 July 2008 07:54 Go to next message
Kristian Sons is currently offline Kristian SonsFriend
Messages: 27
Registered: July 2009
Junior Member
Hello!

I have following design question:
Where should I implement a GUI user feedback when editing a EMF data
structure using the standard provider adapter factories?

Example:
I use the standard EMF D&D-Action to move items around. When I drop one
item above an other item, the feature for the created AddCommand is solved
by the ItemProviderAdapter::getChildFeature(Object object, Object child)
picking the first valid feature. If there is more than one vaild feature,
I want the user to decide, which feature is meant and present a list of
valid features.

It seems grubby to me to implements this in a customized AddCommand since
the commands are independent of UI implementations. So it should be in the
action. So I would need a very specialized D&D action that would first
check the number of possible features via the provider adapters...

Is there an other/better way to implement user interactions for commands?

Thanks and regards,
Kristian
Re: Design question on commands/actions [message #420600 is a reply to message #420595] Thu, 03 July 2008 10:59 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Kristian,

Comments below.

Kristian Sons wrote:
> Hello!
>
> I have following design question:
> Where should I implement a GUI user feedback when editing a EMF data
> structure using the standard provider adapter factories?
>
> Example:
> I use the standard EMF D&D-Action to move items around. When I drop
> one item above an other item, the feature for the created AddCommand
> is solved by the ItemProviderAdapter::getChildFeature(Object object,
> Object child) picking the first valid feature. If there is more than
> one vaild feature, I want the user to decide, which feature is meant
> and present a list of valid features.
>
> It seems grubby to me to implements this in a customized AddCommand
> since the commands are independent of UI implementations. So it should
> be in the action. So I would need a very specialized D&D action that
> would first check the number of possible features via the provider
> adapters...
>
> Is there an other/better way to implement user interactions for commands?
Yes, typically I'd expect the user interactions to be the result of an
action, not to happen as part of invoking a command. In this specific
case, I imagine that specializing EditingDomainViewerdropAdapter.drop so
that it interacts with the user before executing the final resulting
command would do the trick.
>
> Thanks and regards,
> Kristian


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Extending JWT's EMF metamodel
Next Topic:Getting started with EMF
Goto Forum:
  


Current Time: Fri Apr 26 18:19:46 GMT 2024

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

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

Back to the top