Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Swanson2001-08-16 10:09:24 +0000
committerDarin Swanson2001-08-16 10:09:24 +0000
commit27fb7aa545d959d1e646701c6c247a8032462b11 (patch)
tree3b8768db325ed4f98f536e10cc80c1dcb292e1c9
parente51fddeceb8052fe949015a5ce87ab1a432ada14 (diff)
downloadeclipse.platform.debug-27fb7aa545d959d1e646701c6c247a8032462b11.tar.gz
eclipse.platform.debug-27fb7aa545d959d1e646701c6c247a8032462b11.tar.xz
eclipse.platform.debug-27fb7aa545d959d1e646701c6c247a8032462b11.zip
1GGCTMA: ITPDUI:WIN2000 - ( trivial )Console view
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ConsoleViewer.java42
1 files changed, 33 insertions, 9 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ConsoleViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ConsoleViewer.java
index 836893e73..8b3bef01a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ConsoleViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ConsoleViewer.java
@@ -5,7 +5,16 @@ package org.eclipse.debug.internal.ui;
* All Rights Reserved.
*/
-import org.eclipse.jface.text.*; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.VerifyEvent; import org.eclipse.swt.events.VerifyListener; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control;
+import org.eclipse.jface.text.*;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.widgets.Composite;
public class ConsoleViewer extends TextViewer implements IPropertyChangeListener{
@@ -53,14 +62,6 @@ public class ConsoleViewer extends TextViewer implements IPropertyChangeListener
super(parent, SWT.H_SCROLL | SWT.V_SCROLL);
getTextWidget().setDoubleClickEnabled(true);
- getTextWidget().addVerifyListener( new VerifyListener() {
- public void verifyText(VerifyEvent e) {
- ConsoleDocument doc= (ConsoleDocument) getDocument();
- if (doc != null && doc.getStartOfEditableContent() > e.start) {
- e.doit= false;
- }
- }
- });
DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
FontData data= ConsolePreferencePage.getConsoleFontData();
@@ -163,6 +164,29 @@ public class ConsoleViewer extends TextViewer implements IPropertyChangeListener
protected void dispose() {
DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
fFont.dispose();
+ }
+
+ /*
+ * @see ITextViewer#isEditable
+ */
+ public boolean isEditable() {
+ StyledText widget= getTextWidget();
+ int caretPos= widget.getCaretOffset();
+ ConsoleDocument doc= (ConsoleDocument) getDocument();
+ if (doc != null && doc.getStartOfEditableContent() > caretPos) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * @see VerifyListener#verifyText
+ */
+ protected void handleVerifyEvent(VerifyEvent e) {
+ ConsoleDocument doc= (ConsoleDocument) getDocument();
+ if (doc != null && doc.getStartOfEditableContent() > e.start) {
+ e.doit= false;
+ }
}
}

Back to the top