Skip to main content



      Home
Home » Eclipse Projects » GEF » Gef Alignment action
Gef Alignment action [message #171799] Mon, 14 March 2005 23:16 Go to next message
Eclipse UserFriend
Originally posted by: gayatri.us.ibm.com

Hi, I am using the Gef AlignmentAction class in my context menu to align
2 or more editparts with respect to each other. However, I noticed that
if I select 2 or more editparts that are on the same horizontal row, and
I select them and do an Align->left (or right), they get layered on top
of one another. Is there a way that the horizontal alignment actions can
be disabled when the selected editparts are on the same row? Similar
situation for vertical alignment action. Any ideas? Thanks!
Re: Gef Alignment action [message #171839 is a reply to message #171799] Tue, 15 March 2005 07:48 Go to previous message
Eclipse UserFriend
Yeah, have your EditPart return UnexecutableCommand (or null if you want to
allow other selected parts that are not on the same row to align) when it's
given an AlignmentRequest and asked for a Command. So, basically, you'll
have to override your EditPart's ResizableEditPolicy's getAlignCommand()
method. Do the necessary checks in there to determine if the attempted
operation is invalid and if that is the case, return
UnexecutableCommand.INSTANCE or null.

"Gayatri Renganathan" <gayatri@us.ibm.com> wrote in message
news:d15nis$7qg$1@www.eclipse.org...
> Hi, I am using the Gef AlignmentAction class in my context menu to align
> 2 or more editparts with respect to each other. However, I noticed that
> if I select 2 or more editparts that are on the same horizontal row, and
> I select them and do an Align->left (or right), they get layered on top
> of one another. Is there a way that the horizontal alignment actions can
> be disabled when the selected editparts are on the same row? Similar
> situation for vertical alignment action. Any ideas? Thanks!
>
Previous Topic:Need a good technical book on GEF
Next Topic:Making GEF appear in Eclipse
Goto Forum:
  


Current Time: Wed Jul 23 05:19:25 EDT 2025

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

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

Back to the top