Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How do i add Alignment Actions etc. ?
How do i add Alignment Actions etc. ? [message #210083] Wed, 22 February 2006 14:48 Go to next message
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
Registered: July 2009
Senior Member
Hello,

i like to add some actions to my GEF editor.
How can i add alignment and snap to the grid actions to
my editor ?

Thanks in advance for any answer !
Re: How do i add Alignment Actions etc. ? [message #210149 is a reply to message #210083] Wed, 22 February 2006 21:12 Go to previous messageGo to next message
Steven R. Shaw is currently offline Steven R. ShawFriend
Messages: 128
Registered: July 2009
Senior Member
Take a look at the logic example source code
(org.eclipse.gef.examples.logic)

@see LogicEditor.createActions()

-Steve

"Marcel" <marcel.au@web.de> wrote in message
news:18784644.1140619750068.JavaMail.root@cp1.javalobby.org...
> Hello,
>
> i like to add some actions to my GEF editor.
> How can i add alignment and snap to the grid actions to
> my editor ?
>
> Thanks in advance for any answer !
Re: How do i add Alignment Actions etc. ? [message #210193 is a reply to message #210149] Thu, 23 February 2006 09:17 Go to previous messageGo to next message
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
Registered: July 2009
Senior Member
I've read through the logical example and tried to adapt the code.
The MatchWidthAction and MatchHeightAction are working.
But i can't activate the other actions. The are greyed
out in the toolbar. Also the snap to the grid action
doesn't work. Did i forget something to implement?
Re: How do i add Alignment Actions etc. ? [message #210346 is a reply to message #210193] Mon, 27 February 2006 01:39 Go to previous messageGo to next message
Steven R. Shaw is currently offline Steven R. ShawFriend
Messages: 128
Registered: July 2009
Senior Member
It could be that you have a missing editpolicies that those actions are
relying upon?

The typical way UI is enabled / disabled is by sending a request to the
current selection (EditParts) and seeing if a command is returned. If a
command is returned, this indicates that UI can be enabled. If a null is
returned, then the action is grayed out. Most often, requests are handled
by the edit policies installed on an EditPart.

Hint:
- See what editpolicies installed in Logic example respond to / handle
requests for the action that you are interested in.

Regards,

Steve.

"Marcel" <marcel.au@web.de> wrote in message
news:13997094.1140686274465.JavaMail.root@cp1.javalobby.org...
> I've read through the logical example and tried to adapt the code.
> The MatchWidthAction and MatchHeightAction are working.
> But i can't activate the other actions. The are greyed
> out in the toolbar. Also the snap to the grid action
> doesn't work. Did i forget something to implement?
Re: How do i add Alignment Actions etc. ? [message #210370 is a reply to message #210346] Mon, 27 February 2006 09:42 Go to previous message
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
Registered: July 2009
Senior Member
Thank for your reply ! I will try that.
Previous Topic:TextFlow doesn't return correct height from getPreferredSize()
Next Topic:snapToGrip not working
Goto Forum:
  


Current Time: Fri Apr 19 02:08:00 GMT 2024

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

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

Back to the top