From 48fb821c7ddcfac52cc9e2c092de7b4592f05869 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Thu, 12 Nov 2009 14:06:54 +0000 Subject: [PATCH] [294351] Add a default hover for DSF. --- dsf/org.eclipse.cdt.dsf.ui/plugin.properties | 3 ++ dsf/org.eclipse.cdt.dsf.ui/plugin.xml | 9 ++++ .../debug/ui/AbstractDsfDebugTextHover.java | 27 +++++------- .../cdt/dsf/debug/ui/DsfDebugTextHover.java | 42 +++++++++++++++++++ 4 files changed, 64 insertions(+), 17 deletions(-) create mode 100644 dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/DsfDebugTextHover.java diff --git a/dsf/org.eclipse.cdt.dsf.ui/plugin.properties b/dsf/org.eclipse.cdt.dsf.ui/plugin.properties index c6bf0568ed3..2aad9fcefd9 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/plugin.properties +++ b/dsf/org.eclipse.cdt.dsf.ui/plugin.properties @@ -57,3 +57,6 @@ StaleData.foreground.description=This color is used to indicate that a given ele StaleData.background.label=Stale data background color StaleData.background.description=This color is used to indicate that a given element of data in a view is stale. User should refresh the view to see current data. The background color is used only when the view is in no-columns mode. + +editorTextHover.label=Debugger +editorTextHover.description=Shows formatted value in debugger hover \ No newline at end of file diff --git a/dsf/org.eclipse.cdt.dsf.ui/plugin.xml b/dsf/org.eclipse.cdt.dsf.ui/plugin.xml index fd03214480a..5f14fc83c46 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/plugin.xml +++ b/dsf/org.eclipse.cdt.dsf.ui/plugin.xml @@ -666,6 +666,15 @@ + + + + diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java index 7d57ad7e715..16002662823 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java @@ -1,20 +1,13 @@ -/** -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - +/******************************************************************************* + * Copyright (c) 2009 Nokia 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nokia Corporation - initial API and implementation + *******************************************************************************/ package org.eclipse.cdt.dsf.debug.ui; import org.eclipse.cdt.debug.ui.editors.AbstractDebugTextHover; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/DsfDebugTextHover.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/DsfDebugTextHover.java new file mode 100644 index 00000000000..ebe7cfc5b38 --- /dev/null +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/DsfDebugTextHover.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2009 Ericsson 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ericsson - initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.dsf.debug.ui; + + +/** + * A default hover provided by DSF. Any hover provided by another + * debugger integration using DSF will automatically override this one + * based on the BestMatchHover class. + * + * @since 2.1 + */ +public class DsfDebugTextHover extends AbstractDsfDebugTextHover { + + /* + * This Hover should work for any model using DSF, so we don't + * use the getModelId() method. + */ + @Override + protected String getModelId() { return null; } + + /* + * Override to not use the getModelId() method, since this hover should + * be valid for any modelId using DSF. + */ + @Override + protected boolean canEvaluate() { + if (getFrame() != null) { + return true; + } + return false; + } +}