Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 91734 Details for
Bug 221638
[implementation] TextViewerUndoManager#undoable() always return false when used in a textListener or document listener
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Simple program for reproducing the problem
TextEditor.java (text/x-java), 1.62 KB, created by
Radoslav Gerganov
on 2008-03-06 04:52:53 EST
(
hide
)
Description:
Simple program for reproducing the problem
Filename:
MIME Type:
Creator:
Radoslav Gerganov
Created:
2008-03-06 04:52:53 EST
Size:
1.62 KB
patch
obsolete
>import org.eclipse.jface.text.*; >import org.eclipse.jface.window.ApplicationWindow; >import org.eclipse.swt.SWT; >import org.eclipse.swt.custom.StyledText; >import org.eclipse.swt.events.KeyAdapter; >import org.eclipse.swt.events.KeyEvent; >import org.eclipse.swt.widgets.*; > >public class TextEditor extends ApplicationWindow { > > public TextEditor() { > super(null); > } > > public void run() { > setBlockOnOpen(true); > open(); > Display.getCurrent().dispose(); > } > > protected void configureShell(Shell shell) { > super.configureShell(shell); > shell.setText("Text Editor"); > shell.setSize(600, 400); > } > > protected Control createContents(Composite parent) { > final TextViewer viewer = new TextViewer(parent, SWT.NONE); > > viewer.setDocument(new Document()); > TextViewerUndoManager undoManager = new TextViewerUndoManager(25); > viewer.setUndoManager(undoManager); > undoManager.connect(viewer); > > final StyledText styledText = viewer.getTextWidget(); > styledText.addKeyListener(new KeyAdapter() { > public void keyReleased(KeyEvent event) { > IUndoManager undoManager = viewer.getUndoManager(); > System.out.println("[keyListener] undoable: " + undoManager.undoable()); > } > }); > viewer.addTextListener(new ITextListener() { > public void textChanged(TextEvent arg0) { > IUndoManager undoManager = viewer.getUndoManager(); > System.out.println("[textListener] undoable: " + undoManager.undoable()); > } > > }); > return styledText; > } > > public static void main(String[] args) { > new TextEditor().run(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 221638
: 91734