Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » ListCompartmentEditPart bug? - cannot select figures in compartment(selected figures within the compartment do not show selection feedback)
ListCompartmentEditPart bug? - cannot select figures in compartment [message #546669] Tue, 13 July 2010 17:25 Go to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
Hello,

Anyone had problems with Compartments with List Layout?

If the layout of a compartement is set to "list", the figures inside the compartment can no longer be selected: no selection feedback is given and the properties view is not updated (but the "delete" button deletes a "non-slected" element wich makes me think the selection is performed but there is a bug in the selection, like an event not being sent).

In order to specify a List Layout for a compartment, one should set, in the gmfgen file, the list property to true for a compartment edit part generation, then the EditPart corresponding to that compartment will extend ListCompartmentEditPart (rather than ShapeCompartmentEditPart).

I think there is a problem in the ListCompartmentEditPart class.

Cheers,
Emil.


[Updated on: Wed, 14 July 2010 08:43]

Report message to a moderator

Re: ListCompartmentEditPart bug? - cannot select figures in compartment [message #546790 is a reply to message #546669] Wed, 14 July 2010 08:44 Go to previous messageGo to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
Actually I was wrong: the eclipse properties view is updated when selecting an element inside the List Compartment, but no selection feedback is shown.
Re: ListCompartmentEditPart bug? - cannot select figures in compartment [message #546853 is a reply to message #546669] Wed, 14 July 2010 12:54 Go to previous messageGo to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
I found the problem and a solution.

The ListCompartmentEditPart does not install an edit policy that decorates the children with an EditPolicy.PRIMARY_DRAG_ROLE policy. It seems that ( when the "list" attribute is set to false, a ShapeCompartmentEditPart is used) the ShapeCompartmentEditPart does this.

The solution is simple:

install, for all the edit parts of the compartment's childer,NonResizable edit policy, like:

/**
	 * @generated NOT
	 */
	protected void createDefaultEditPolicies() {
		super.createDefaultEditPolicies();
		...............
               ................
                ...............
		installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy());
	}


Re: ListCompartmentEditPart bug? - cannot select figures in compartment [message #640444 is a reply to message #546669] Mon, 22 November 2010 07:19 Go to previous message
Asiri Rathnayake is currently offline Asiri RathnayakeFriend
Messages: 80
Registered: September 2010
Location: Colombo, Sri Lanka.
Member
Hi,

Thanks for your solution, I had the same problem Smile

One minor detail; if your list compartment does not support moving items here and there (normal behaviour) it's better to turn off the drag feedback like below:

/**
* @generated NOT
*/
protected void createDefaultEditPolicies() {
	// ...
	NonResizableEditPolicy nonResizableEditPolicy = new NonResizableEditPolicy();
	nonResizableEditPolicy.setDragAllowed(false);
	installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, nonResizableEditPolicy);
}

Otherwise a feedback figure will be shown when attempting to move child edit parts around (and it does not get erased).

Hope this helps.

- Asiri
Previous Topic:Re: How to do a tree inside a node ?
Next Topic:ElementTypeRegistry question
Goto Forum:
  


Current Time: Fri Apr 19 23:43:54 GMT 2024

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

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

Back to the top