Skip to main content



      Home
Home » Eclipse Projects » GEF » question regarding canceling tool activation
question regarding canceling tool activation [message #17085] Mon, 19 August 2002 10:14 Go to next message
Eclipse UserFriend
Hi,
i'm using several tools in my palette, and i need to allow my users to
cancel a selection of a tool during edit time. one way is to select the
select tool from the palette, which is a little bit UI clumsy, but it
works. i would like my users also to be able to press the Esc button and
it would acheive the same. i have a key handler for my editor part, but i
am not sure how to use it for this purpose.
any ideas?
thanks
yoav
Re: question regarding canceling tool activation [message #17114 is a reply to message #17085] Mon, 19 August 2002 16:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.spam.com

EditPartViewer's KeyHandler is definitely the right way to add a listener
for key presses. But in general, only the selection tool should forward key
events to the viewer's key handler.

When some tool is active besides the SelectionTool, just receive the key
event in *that* tool, not the key handler. In fact, all tools should
already inherit the behavior you are describing. See
AbstractTool.handleKeyPressed(...)


"Yoav Rubin" <yoav@il.ibm.com> wrote in message
news:ajqugg$j5s$1@rogue.oti.com...
> Hi,
> i'm using several tools in my palette, and i need to allow my users to
> cancel a selection of a tool during edit time. one way is to select the
> select tool from the palette, which is a little bit UI clumsy, but it
> works. i would like my users also to be able to press the Esc button and
> it would acheive the same. i have a key handler for my editor part, but i
> am not sure how to use it for this purpose.
> any ideas?
> thanks
> yoav
>
Re: question regarding canceling tool activation [message #17143 is a reply to message #17114] Tue, 20 August 2002 03:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
in the logic example i use the tools does not behave in this fashion, it
seems that the handleKeyPressed method of the selection tool gets called
even if other tool is selected in the palette. i've looked into it and
found that there are two edit domain, one gets created from the editor
part , and one for the palette viewer in the paletteViewerImpl class, thus
any key press that happends on the canvas is forward to the selection tool
(since it is still the active tool for this edit domain), and not to the
appropriate creation tool (which is the active tool for the
paletteViewer). i thought of using the keyHandler for this, but i don't
think that defining an action for this purpose is a good idea. is there a
better solution or am i missing something here?
thank
yoav
Randy Hudson wrote:

> EditPartViewer's KeyHandler is definitely the right way to add a listener
> for key presses. But in general, only the selection tool should forward key
> events to the viewer's key handler.

> When some tool is active besides the SelectionTool, just receive the key
> event in *that* tool, not the key handler. In fact, all tools should
> already inherit the behavior you are describing. See
> AbstractTool.handleKeyPressed(...)


> "Yoav Rubin" <yoav@il.ibm.com> wrote in message
> news:ajqugg$j5s$1@rogue.oti.com...
> > Hi,
> > i'm using several tools in my palette, and i need to allow my users to
> > cancel a selection of a tool during edit time. one way is to select the
> > select tool from the palette, which is a little bit UI clumsy, but it
> > works. i would like my users also to be able to press the Esc button and
> > it would acheive the same. i have a key handler for my editor part, but i
> > am not sure how to use it for this purpose.
> > any ideas?
> > thanks
> > yoav
> >
Re: question regarding canceling tool activation [message #17256 is a reply to message #17143] Tue, 20 August 2002 10:51 Go to previous message
Eclipse UserFriend
Originally posted by: hudsonr.spam.com

Yes, this is a focus problem. I wonder if we can prevent the Palette from
ever receiving focus when you click on it. If you TAb to the graphical
viewer, and then press escape, it works.

The Palette has its own edit domain because it is its own graphical editor.
We will be adding things like the ability to re-order palette entries, and
other advanced functions.

"Yoav Rubin" <yoav@il.ibm.com> wrote in message
news:ajsqe4$ent$1@rogue.oti.com...
> Hi,
> in the logic example i use the tools does not behave in this fashion, it
> seems that the handleKeyPressed method of the selection tool gets called
> even if other tool is selected in the palette. i've looked into it and
> found that there are two edit domain, one gets created from the editor
> part , and one for the palette viewer in the paletteViewerImpl class, thus
> any key press that happends on the canvas is forward to the selection tool
> (since it is still the active tool for this edit domain), and not to the
> appropriate creation tool (which is the active tool for the
> paletteViewer). i thought of using the keyHandler for this, but i don't
> think that defining an action for this purpose is a good idea. is there a
> better solution or am i missing something here?
> thank
> yoav
> Randy Hudson wrote:
>
> > EditPartViewer's KeyHandler is definitely the right way to add a
listener
> > for key presses. But in general, only the selection tool should forward
key
> > events to the viewer's key handler.
>
> > When some tool is active besides the SelectionTool, just receive the key
> > event in *that* tool, not the key handler. In fact, all tools should
> > already inherit the behavior you are describing. See
> > AbstractTool.handleKeyPressed(...)
>
>
> > "Yoav Rubin" <yoav@il.ibm.com> wrote in message
> > news:ajqugg$j5s$1@rogue.oti.com...
> > > Hi,
> > > i'm using several tools in my palette, and i need to allow my users to
> > > cancel a selection of a tool during edit time. one way is to select
the
> > > select tool from the palette, which is a little bit UI clumsy, but it
> > > works. i would like my users also to be able to press the Esc button
and
> > > it would acheive the same. i have a key handler for my editor part,
but i
> > > am not sure how to use it for this purpose.
> > > any ideas?
> > > thanks
> > > yoav
> > >
>
>
>
>
>
Previous Topic:is it possible for me to replace the palette with menu
Next Topic:Need Editor access in an EditPolicy class
Goto Forum:
  


Current Time: Thu Jul 24 18:40:14 EDT 2025

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

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

Back to the top