Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Question regarding key handing
Question regarding key handing [message #217781] Tue, 13 June 2006 12:26 Go to next message
Eclipse UserFriend
Originally posted by: schmelly.uni-paderborn.de

Hello,

i would like to do some special operations in my editor (more precisely
in my model) that should be invoked by pressing different keys. However
im not sure about how to implement the different actions and commands
for this.

A little example: Imagine a sequence diagram that consists of two
different lifelines 'A' and 'B'. Those lifelines interact with messages
'1' and '2' (Fig1).

A B
| |
|----1--->|
| |
|----2--->|
| |
(Fig1)

Now i want to use the arrow keys to swap the order of these messages
(Fig2, the order is defined in my model, so modifing my model should
suffice).

A B
| |
|----2--->|
| |
|----1--->|
| |
(Fig2)

Can anyone point me to the right direction and locations where and how
to implement this behaviour? Im not sure where and how to implement the
needed actions with appropriate GEF commands.

Any tips and hints are welcome!


thanks in advance,
David
Re: Question regarding key handing [message #217976 is a reply to message #217781] Fri, 16 June 2006 02:41 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 org.eclipse.gef.KeyHandler class and it's subclass
GraphicalViewerKeyHandler. Arrow keys are currently used for accessibility
navigation in the editor, but you could override this in your own KeyHandler
subclass.

-Steve

"David Schmelter" <schmelly@uni-paderborn.de> wrote in message
news:e6mau1$jvi$1@utils.eclipse.org...
> Hello,
>
> i would like to do some special operations in my editor (more precisely
> in my model) that should be invoked by pressing different keys. However
> im not sure about how to implement the different actions and commands
> for this.
>
> A little example: Imagine a sequence diagram that consists of two
> different lifelines 'A' and 'B'. Those lifelines interact with messages
> '1' and '2' (Fig1).
>
> A B
> | |
> |----1--->|
> | |
> |----2--->|
> | |
> (Fig1)
>
> Now i want to use the arrow keys to swap the order of these messages
> (Fig2, the order is defined in my model, so modifing my model should
> suffice).
>
> A B
> | |
> |----2--->|
> | |
> |----1--->|
> | |
> (Fig2)
>
> Can anyone point me to the right direction and locations where and how
> to implement this behaviour? Im not sure where and how to implement the
> needed actions with appropriate GEF commands.
>
> Any tips and hints are welcome!
>
>
> thanks in advance,
> David
Re: Question regarding key handing [message #218054 is a reply to message #217781] Mon, 19 June 2006 00:33 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This might be a simple case of assigning a keybinding for an action. The
action would be enabled whenever the proper selection existed.

"David Schmelter" <schmelly@uni-paderborn.de> wrote in message
news:e6mau1$jvi$1@utils.eclipse.org...
> Hello,
>
> i would like to do some special operations in my editor (more precisely in
> my model) that should be invoked by pressing different keys. However im
> not sure about how to implement the different actions and commands for
> this.
>
> A little example: Imagine a sequence diagram that consists of two
> different lifelines 'A' and 'B'. Those lifelines interact with messages
> '1' and '2' (Fig1).
>
> A B
> | |
> |----1--->|
> | |
> |----2--->|
> | |
> (Fig1)
>
> Now i want to use the arrow keys to swap the order of these messages
> (Fig2, the order is defined in my model, so modifing my model should
> suffice).
>
> A B
> | |
> |----2--->|
> | |
> |----1--->|
> | |
> (Fig2)
>
> Can anyone point me to the right direction and locations where and how to
> implement this behaviour? Im not sure where and how to implement the
> needed actions with appropriate GEF commands.
>
> Any tips and hints are welcome!
>
>
> thanks in advance,
> David
Previous Topic:HowTo get scroll bars to work in draw2d.FigureCanvas?
Next Topic:image memory release problem in palette
Goto Forum:
  


Current Time: Fri Apr 19 23:06:34 GMT 2024

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

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

Back to the top