Skip to main content



      Home
Home » Eclipse Projects » GEF » EmptyStackException can occur when undoing using the keyboard shortcuts
EmptyStackException can occur when undoing using the keyboard shortcuts [message #93103] Tue, 09 September 2003 10:58 Go to next message
Eclipse UserFriend
Hi

sometimes when the user does too much CTRL+Z, an EmptyStackException is
thrown. I found that the implementation of UndoAction is missing the call to
CommandStack.canUndo. I know that there is a call to this method in the
method calculateEnabled of the UndoAction, but it seems that this method is
not called when it is activated from the keyboard (i.e., using CTRL+Z).
Please let me know if i am missing something here, since as for now I've
fixed it locally in my app.

thanks

Yoav
Re: EmptyStackException can occur when undoing using the keyboard shortcuts [message #93138 is a reply to message #93103] Tue, 09 September 2003 11:54 Go to previous messageGo to next message
Eclipse UserFriend
I can't reproduce this problem. The same UndoAction is used for both
keyboard shortcuts and toolbar/menu items. If the UndoAction is not
enabled, the keyboard shortcut shouldn't work. Can you give a
step-by-step test case?

Eric


Yoav Rubin wrote:
> Hi
>
> sometimes when the user does too much CTRL+Z, an EmptyStackException is
> thrown. I found that the implementation of UndoAction is missing the call to
> CommandStack.canUndo. I know that there is a call to this method in the
> method calculateEnabled of the UndoAction, but it seems that this method is
> not called when it is activated from the keyboard (i.e., using CTRL+Z).
> Please let me know if i am missing something here, since as for now I've
> fixed it locally in my app.
>
> thanks
>
> Yoav
>
>
>
Re: EmptyStackException can occur when undoing using the keyboard shortcuts [message #93147 is a reply to message #93138] Tue, 09 September 2003 12:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi, i can't reproduce it in the logic example, but i guess it is somehow
related to my previous post, regarding the problems with undo/redo, it seems
that both of this post problem and the previous one have the same "root", so
i can't reproduce it in other apps, but in the other post there are other
symptoms...
thanks
Yoav
"Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
news:bjkt18$80o$1@eclipse.org...
> I can't reproduce this problem. The same UndoAction is used for both
> keyboard shortcuts and toolbar/menu items. If the UndoAction is not
> enabled, the keyboard shortcut shouldn't work. Can you give a
> step-by-step test case?
>
> Eric
>
>
> Yoav Rubin wrote:
> > Hi
> >
> > sometimes when the user does too much CTRL+Z, an EmptyStackException is
> > thrown. I found that the implementation of UndoAction is missing the
call to
> > CommandStack.canUndo. I know that there is a call to this method in the
> > method calculateEnabled of the UndoAction, but it seems that this method
is
> > not called when it is activated from the keyboard (i.e., using CTRL+Z).
> > Please let me know if i am missing something here, since as for now I've
> > fixed it locally in my app.
> >
> > thanks
> >
> > Yoav
> >
> >
> >
>
Re: EmptyStackException can occur when undoing using the keyboard shortcuts [message #93270 is a reply to message #93103] Wed, 10 September 2003 10:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

It is likely that your instance of UndoAction is not listening to the
CommandStack. I've guessing that if you drop-down the Edit menu, Eclipse is
unnecessarily querying your isEnabled() state, which causes the action to
disable. What should happen, is when the command stack undoes a command, it
notifies a listener immediately, that listener then calls update() on the
command stack actions (undo and redo). I think this is also linked to the
dirty state of the editor.

-Randy


"Yoav Rubin" <yoav@il.ibm.com> wrote in message
news:bjkpr7$4td$1@eclipse.org...
> Hi
>
> sometimes when the user does too much CTRL+Z, an EmptyStackException is
> thrown. I found that the implementation of UndoAction is missing the call
to
> CommandStack.canUndo. I know that there is a call to this method in the
> method calculateEnabled of the UndoAction, but it seems that this method
is
> not called when it is activated from the keyboard (i.e., using CTRL+Z).
> Please let me know if i am missing something here, since as for now I've
> fixed it locally in my app.
>
> thanks
>
> Yoav
>
>
>
Re: EmptyStackException can occur when undoing using the keyboard shortcuts [message #93688 is a reply to message #93270] Thu, 11 September 2003 03:36 Go to previous message
Eclipse UserFriend
Thanks Randy, your "diagnosis" solved the problem :)

"Randy Hudson" <none@us.ibm.com> wrote in message
news:bjnbab$lms$1@eclipse.org...
> It is likely that your instance of UndoAction is not listening to the
> CommandStack. I've guessing that if you drop-down the Edit menu, Eclipse
is
> unnecessarily querying your isEnabled() state, which causes the action to
> disable. What should happen, is when the command stack undoes a command,
it
> notifies a listener immediately, that listener then calls update() on the
> command stack actions (undo and redo). I think this is also linked to the
> dirty state of the editor.
>
> -Randy
>
>
> "Yoav Rubin" <yoav@il.ibm.com> wrote in message
> news:bjkpr7$4td$1@eclipse.org...
> > Hi
> >
> > sometimes when the user does too much CTRL+Z, an EmptyStackException is
> > thrown. I found that the implementation of UndoAction is missing the
call
> to
> > CommandStack.canUndo. I know that there is a call to this method in the
> > method calculateEnabled of the UndoAction, but it seems that this method
> is
> > not called when it is activated from the keyboard (i.e., using CTRL+Z).
> > Please let me know if i am missing something here, since as for now I've
> > fixed it locally in my app.
> >
> > thanks
> >
> > Yoav
> >
> >
> >
>
>
Previous Topic:Alternative ways of starting a gef editor
Next Topic:cyclic directed graph layout in GEF 2.2 Release
Goto Forum:
  


Current Time: Sat May 10 15:52:35 EDT 2025

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

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

Back to the top