[Pydev-cvs] org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui/internal ScriptCons
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-05-03 13:20:07
|
Update of /cvsroot/pydev/org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui/internal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5960/src_dltk_console/org/python/pydev/dltk/console/ui/internal Modified Files: ScriptConsoleViewer.java ScriptConsoleDocumentListener.java Log Message: Interactive console: ESC does not close the console when in floating mode anymore Index: ScriptConsoleDocumentListener.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui/internal/ScriptConsoleDocumentListener.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ScriptConsoleDocumentListener.java 4 Apr 2008 02:54:50 -0000 1.10 --- ScriptConsoleDocumentListener.java 3 May 2008 13:20:11 -0000 1.11 *************** *** 325,329 **** */ private void addToPartitioner(ScriptStyleRange style) { ! IDocumentPartitioner partitioner = viewer.getDocument().getDocumentPartitioner(); if (partitioner instanceof ScriptConsolePartitioner) { ScriptConsolePartitioner scriptConsolePartitioner = (ScriptConsolePartitioner) partitioner; --- 325,329 ---- */ private void addToPartitioner(ScriptStyleRange style) { ! IDocumentPartitioner partitioner = this.doc.getDocumentPartitioner(); if (partitioner instanceof ScriptConsolePartitioner) { ScriptConsolePartitioner scriptConsolePartitioner = (ScriptConsolePartitioner) partitioner; Index: ScriptConsoleViewer.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui/internal/ScriptConsoleViewer.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ScriptConsoleViewer.java 12 Apr 2008 15:40:10 -0000 1.19 --- ScriptConsoleViewer.java 3 May 2008 13:20:11 -0000 1.20 *************** *** 33,36 **** --- 33,38 ---- import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; + import org.eclipse.swt.events.TraverseEvent; + import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.events.VerifyEvent; import org.eclipse.swt.events.VerifyListener; *************** *** 512,515 **** --- 514,531 ---- final StyledText styledText = getTextWidget(); + + //Added because we don't want the console to close when the user presses ESC + //(as it would when it's on a floating window) + //we do that because ESC is meant to clear the current line (and as such, + //should do that action and not close the console). + styledText.addTraverseListener(new TraverseListener(){ + + public void keyTraversed(TraverseEvent e) { + if(e.detail == SWT.TRAVERSE_ESCAPE){ + e.doit = false; + } + }}); + + getDocument().addDocumentListener(new IDocumentListener(){ |