Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2008-07-28 11:11:07 -0400
committerMichael Rennie2008-07-28 11:11:07 -0400
commit3e24ae3a8ea4f490c2127aa03e6a9c83c837c47f (patch)
tree894d7169482c9338a75be4123b18d9934f1f486f /org.eclipse.ui.console
parent62eb12e13194c1640dceffc0ce69c3857ae5bb05 (diff)
downloadeclipse.platform.debug-3e24ae3a8ea4f490c2127aa03e6a9c83c837c47f.tar.gz
eclipse.platform.debug-3e24ae3a8ea4f490c2127aa03e6a9c83c837c47f.tar.xz
eclipse.platform.debug-3e24ae3a8ea4f490c2127aa03e6a9c83c837c47f.zip
Bug 236049 [console] 'Clear' context menu item enable when no text is available to be cleared
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
index 349572ff2..5e1b7a4fd 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Livar Cunha (livarcocc@gmail.com) - Bug 236049
*******************************************************************************/
package org.eclipse.ui.console;
@@ -87,13 +88,20 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
}
};
- // updates the find replace action if the document length is > 0
+ // updates the find replace action and the clear action if the document length is > 0
private ITextListener textListener = new ITextListener() {
public void textChanged(TextEvent event) {
IUpdate findReplace = (IUpdate)fGlobalActions.get(ActionFactory.FIND.getId());
if (findReplace != null) {
findReplace.update();
}
+
+ if (fClearOutputAction != null) {
+ IDocument doc = fViewer.getDocument();
+ if(doc != null) {
+ fClearOutputAction.setEnabled(doc.getLength() > 0);
+ }
+ }
}
};

Back to the top