Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » ContainerShapeEditPart
ContainerShapeEditPart [message #967523] Thu, 01 November 2012 16:49 Go to next message
Rui Domingues is currently offline Rui Domingues
Messages: 186
Registered: October 2010
Senior Member
Hi.

It's possible to read this code and comments in ContainerShapeEdit class:
	/**
	 * Creates the EditPolicies of this EditPart. Subclasses often overwrite
	 * this method to change the behaviour of the editpart. This implementation
	 * adds the layout-specific EditPolicy to the super-implementation.
	 * 
	 * @see ShapeEditPart
	 */
	@Override
	protected void createEditPolicies() {
		super.createEditPolicies();
		installEditPolicy(EditPolicy.LAYOUT_ROLE, getConfigurationProvider().getEditPolicyFactory()
				.createShapeXYLayoutEditPolicy());
		// installEditPolicy(EditPolicy.CONTAINER_ROLE,
		// getConfigurationProvider().getEditPolicyFactory().createShapeXYLayoutEditPolicy());
		installEditPolicy("Snap Feedback", new GFSnapFeedbackPolicy()); //$NON-NLS-1$
	}


In the comments it is talked about subclassing. Anybody knows a way to subclass or use a plugin fragment to extend this method, in such a way I can install a new EditPolicy.

Thanks in advance
rui

[Updated on: Thu, 01 November 2012 16:50]

Report message to a moderator

Re: ContainerShapeEditPart [message #968076 is a reply to message #967523] Fri, 02 November 2012 03:14 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1571
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Rui,

these are Graphiti internal classes and I'm afraid currently it is not
possible to hook in there, or it would require huge effort and overriding
many non-API classes. The override comment is somewhat misleading and refers
to Graphiti framework coding and/or is simply taken over from the underlying
GEF class.

What is your concrete usecase or need? Maybe there's another way to achieve
the same...

Michael
Re: ContainerShapeEditPart [message #968253 is a reply to message #968076] Fri, 02 November 2012 06:11 Go to previous message
Rui Domingues is currently offline Rui Domingues
Messages: 186
Registered: October 2010
Senior Member
Maybe you still remember about my other post about showing my own guidelines, because I have a high restrictive layout, so I want to give feedback to user about the position where the object will actually be placed.

I've already achieved to install the policy. I have a selection listener and when the selected object is a containershapeeditpart ant it corresponds to my BO, I install the editpolicy, and it is working very well.

I was asking because maybe it would be possible to install directly in the editpart.

Do you see a way of doing it other way around?

Thanks
Previous Topic:Problem with Platform Graphics Algorithm Text Flow
Next Topic:Miniature view implementation for Graphiti Diagram Editor
Goto Forum:
  


Current Time: Tue Jul 22 09:28:39 EDT 2014

Powered by FUDForum. Page generated in 0.03254 seconds