Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » ContainerShapeEditPart
ContainerShapeEditPart [message #967523] Thu, 01 November 2012 20:49 Go to next message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
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 20:50]

Report message to a moderator

Re: ContainerShapeEditPart [message #968076 is a reply to message #967523] Fri, 02 November 2012 07:14 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
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 10:11 Go to previous message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
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 Apr 16 21:26:36 GMT 2024

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

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

Back to the top