Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » The problem of StructuredTextViewerUndoManager
The problem of StructuredTextViewerUndoManager [message #172937] Tue, 04 July 2006 16:28
Eclipse User
Originally posted by: eric_suen_cn.yahoo.com.cn

Hi,

I have code like this:

// model is an instanceof IStructuredModel
model.beginRecording(this);
e1.setAttribute(...);
e2.setAttribute(...);
model.endRecording(this);

I expect it will generate one CompoundCommand, but not works, because
StructuredTextViewerUndoManager.UndoNotifier listen selection event of
the TextViewer. if any selection changed, it will call the method
forceEndOfPendingCommand of class IStructuredTextUndoManager. If you
take a look of org.eclipse.jface.text.TextViewerUndoManager, you will
see it listen to the key and mouse event instead of selection event.

In StructuredTextViewer, if you typing some text then move cursor to
other offset then move back, then keep typing, it only generate one
command, but if you typing some text then change the selection then
move cursor back, then keep typing, it will generate tow undo command.
IMO, it is kind weird.

So, is it possible that my previous code only generate one command?
otherwise, this beginRecording, endRecording are totally useless...

Eric
Previous Topic:HOWTO solve the application loaded twice problem with Tomcat
Next Topic:installation de wst
Goto Forum:
  


Current Time: Wed Oct 22 04:53:16 GMT 2014

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

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