Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Select many elements, but only one is "activated"
Select many elements, but only one is "activated" [message #648490] Thu, 13 January 2011 08:07 Go to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hello,

I want to implement a mechanism to allow a graphical group in order to move many elements at the same time without the need to select all of them. I can group several of these elements, and when I select one of them graphically, automatically I want to highlight the other ones, and when I move one of them, the others be moved too, but in the Properties View I only see the attributes of the first selected one.

I think I must to do is to change the PrimaryDragEditPolicy of all affected EditPart, but I can't get it work...

Any suggestions?

Thanks anybody,
Marc
Re: Select many elements, but only one is "activated" [message #648525 is a reply to message #648490] Thu, 13 January 2011 11:50 Go to previous messageGo to next message
Romain Bioteau is currently offline Romain BioteauFriend
Messages: 65
Registered: August 2009
Location: Grenoble
Member
Did you try to use the GraphicalViewer to set your selection with a StrucutredSelection containing all the edipart you want selected/highlighted ?


R&D Engineer at BonitaSoft
Re: Select many elements, but only one is "activated" [message #648526 is a reply to message #648525] Thu, 13 January 2011 11:58 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Helo Romain,

There's a problem doing it through the GraphicalViewer, setting the selection, due to ALL the elements will be activated. I mean, I want to really select one element, but graphically select all the other grouped elements, for example highlighting them with a border.

Thanks
Re: Select many elements, but only one is "activated" [message #648550 is a reply to message #648526] Thu, 13 January 2011 13:38 Go to previous messageGo to next message
Romain Bioteau is currently offline Romain BioteauFriend
Messages: 65
Registered: August 2009
Location: Grenoble
Member
Ok, I think I understand what you want.

A Good way & practice is to create an editpolicy extending SelectionEditPolicy.

implement your showSelection() & hideSelection()

Register this edit policy to the right editparts using the EditPolicyProvider or by overriding the createDefaultEditPolicy in your Custom EditPart

BR


R&D Engineer at BonitaSoft

[Updated on: Thu, 13 January 2011 13:39]

Report message to a moderator

Re: Select many elements, but only one is "activated" [message #648604 is a reply to message #648550] Thu, 13 January 2011 16:18 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Well, I finish it, and the result is very beautifull Smile

Thanks Romain!
Re: Select many elements, but only one is "activated" [message #648614 is a reply to message #648604] Thu, 13 January 2011 16:53 Go to previous messageGo to next message
Romain Bioteau is currently offline Romain BioteauFriend
Messages: 65
Registered: August 2009
Location: Grenoble
Member
Well Done Wink

R&D Engineer at BonitaSoft
Re: Select many elements, but only one is "activated" [message #648619 is a reply to message #648614] Thu, 13 January 2011 17:14 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
I Just saw this post sorry for the delay, but I think it still could be
useful.

The group functionality has been added by the runtime framework since
GMF 2.1.

See
http://wiki.eclipse.org/GMF_2.1_New_and_Noteworthy#Group.2FU ngroup_Functionality_in_the_GMF_Runtime
and https://bugs.eclipse.org/bugs/show_bug.cgi?id=111892

Mariot
--
Mariot Chauvin @ Obeo

http://www.obeo.fr
http://mariot-thoughts.blogspot.com
http://fr.linkedin.com/in/mariotchauvin
Re: Select many elements, but only one is "activated" [message #648706 is a reply to message #648619] Fri, 14 January 2011 07:31 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hi Mariot,

I know about the Group Action in GMF to group several Nodes in the diagram, but at least in Galileo, the version I'm working with, the group behaviour is not well implemented when try to move one Node contained in the group: the location of the destination is not well calculed. Although, when you first select an element contained into a group, the properties that are shown in the Properties View are the ones from the Node, not the ones of the selected Element.

If you're interested, I can attach a capture to show you the behaviour.

Thanks!
Marc
Re: Select many elements, but only one is "activated" [message #648775 is a reply to message #648706] Fri, 14 January 2011 13:47 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Le 14/01/2011 08:31, Marc a écrit :
> Hi Mariot,
>
> I know about the Group Action in GMF to group several Nodes in the
> diagram, but at least in Galileo, the version I'm working with, the
> group behaviour is not well implemented when try to move one Node
> contained in the group: the location of the destination is not well
> calculed. Although, when you first select an element contained into a
> group, the properties that are shown in the Properties View are the ones
> from the Node, not the ones of the selected Element.
>
> If you're interested, I can attach a capture to show you the behaviour.
>
> Thanks!
> Marc

Hi Marc,

Please do not hesitate to open a bugzilla issue on this with the capture
to show the behavior you have and describe the one you expect.
I am interested in.

Thanks,

Mariot
--
Mariot Chauvin @ Obeo

http://www.obeo.fr
http://mariot-thoughts.blogspot.com
http://fr.linkedin.com/in/mariotchauvin
Re: Select many elements, but only one is "activated" [message #648780 is a reply to message #648775] Fri, 14 January 2011 13:54 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
OK Mariot, Monday I'll open a bugzilla and comment it. First I'll try it in Helios if I can... Sincerely, I like what I've implemented more than the group of GMF, although my solution uses an element of my metamodel, I think it's possible to do something similar with the GMF group.

Thanks,
Marc
Re: Select many elements, but only one is "activated" [message #649053 is a reply to message #648780] Mon, 17 January 2011 12:48 Go to previous message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hi Mariot,

I have open a bugzilla for the GMF group, and I have explain the solution I adapted for my editor. You can see it in the following link:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334510

Marc
Previous Topic:How To : Get compartment size for a layout implementation?
Next Topic:Compartment and layout
Goto Forum:
  


Current Time: Thu Apr 25 15:46:03 GMT 2024

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

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

Back to the top