diff options
author | Michael Rennie | 2008-07-28 15:11:07 +0000 |
---|---|---|
committer | Michael Rennie | 2008-07-28 15:11:07 +0000 |
commit | 3e24ae3a8ea4f490c2127aa03e6a9c83c837c47f (patch) | |
tree | 894d7169482c9338a75be4123b18d9934f1f486f /org.eclipse.ui.console | |
parent | 62eb12e13194c1640dceffc0ce69c3857ae5bb05 (diff) | |
download | eclipse.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.java | 12 |
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); + } + } } }; |