Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Select and resize children in compartments
Select and resize children in compartments [message #634473] Thu, 21 October 2010 20:20 Go to next message
Volker Wegert is currently offline Volker WegertFriend
Messages: 182
Registered: July 2009
Senior Member
Hi all,

I have some trouble getting my head around an issue concerning the selection
of child elements inside a compartment. Basically, what I need is similar to
tutorial 7 from http://gmfsamples.tuxfamily.org However, once I apply the
changes, I can no longer visually select the child elements inside the
compartment. I can see in the Properties view that the selection changes when
I click on different child elements, but I don't get the black frame with the
resizing handles. I also want to be able to resize the child elements
horizontally (think table columns) - I assume this is related? I don't really
understand how the framework determines whether to allow resizing of the
elements. Could anyone please give me a hint where to look?

Thanks
Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
"If we knew what it was we were doing, it wouldn't be called research, now
would it?" (Albert Einstein)
Re: Select and resize children in compartments [message #634548 is a reply to message #634473] Fri, 22 October 2010 07:35 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I think that you need to take a look at SelectionEditPolicy and LayoutEditPolicy.

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Select and resize children in compartments [message #634851 is a reply to message #634548] Sun, 24 October 2010 16:39 Go to previous message
Volker Wegert is currently offline Volker WegertFriend
Messages: 182
Registered: July 2009
Senior Member
Hello, Aurelien,

Aurelien Pupier <aurelien.pupier@bonitasoft.com> writes:
> I think that you need to take a look at SelectionEditPolicy and
> LayoutEditPolicy.

with your hint I've succeeded in making the selection visible - simply by
adding installEditPolicy(EP.SELECTION_FEEDBACK_ROLE,
getPrimaryDragEditPolicy()) to the Node EditPart createDefaultEditPolicies
method. Using the gmfgraph/gmfmap attributes, I was also able to restrict the
usage of the resizing handles so that only the width of the contained objects
can be changed.

However, I still can't really change the width, only drag it
around. From your comment and some debugging, I guess that I need a
LayoutEditPolicy for the Compartment that contains the columns. If I
understand the code correctly, my decision (or rather the hint from the
tutorial) to use the ConstrainedToolbarLayoutEditPolicy on the table
compartment might be a bad idea for my application. I want the columns to
always use the entire height of the surrounding compartment and to be of a
fixed width (that is also stored in my domain model). With this in mind, I
think it might be a better idea to write my own layout manager for the
compartment than trying to tweak the ConstrainedToolbarLEP. Does this sound
coherent or am I missing something again?

Thanks
Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
The three Rs of Microsoft support: Retry, Reboot, Reinstall.
Previous Topic:links on a diagram disappears
Next Topic:Embed GMF generated editor into MasterDetailsBlock?
Goto Forum:
  


Current Time: Sat Apr 27 04:33:20 GMT 2024

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

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

Back to the top