Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2010-04-28 08:18:59 +0000
committerAnton Leherbauer2010-04-28 08:18:59 +0000
commit0d4f5c71b649e545cf6bdee53bbaaa509fbfa5ea (patch)
tree1d95a48d7cafa827ab766d8f1656d77f7c608240 /dsf/org.eclipse.cdt.dsf.ui
parent90380cf9ed79ad155d01a2548c68b5f7abc9b45d (diff)
downloadorg.eclipse.cdt-0d4f5c71b649e545cf6bdee53bbaaa509fbfa5ea.tar.gz
org.eclipse.cdt-0d4f5c71b649e545cf6bdee53bbaaa509fbfa5ea.tar.xz
org.eclipse.cdt-0d4f5c71b649e545cf6bdee53bbaaa509fbfa5ea.zip
Bug 310425 - incorporate Marc's feedback
Diffstat (limited to 'dsf/org.eclipse.cdt.dsf.ui')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java41
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java25
2 files changed, 32 insertions, 34 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java
index 2f0e2cee589..a8587ca401a 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java
@@ -14,10 +14,7 @@ package org.eclipse.cdt.dsf.debug.internal.ui;
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMContext;
import org.eclipse.cdt.dsf.debug.ui.IDsfDebugUIConstants;
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IVariable;
import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputRequestor;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate;
@@ -130,23 +127,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
private ViewerInputService fInputService;
- /**
- * Creates the content for the root element of the tree viewer in the hover
- */
- private class TreeRoot extends ElementContentProvider {
- @Override
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return 1;
- }
- @Override
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return new Object[] { fVariable };
- }
- @Override
- protected boolean supportsContextId(String id) {
- return true;
- }
- }
+ private IInformationControlCreator fInformationControlCreator;
/**
* Inner class implementing IDetailPaneContainer methods. Handles changes to detail
@@ -463,20 +444,20 @@ public class ExpressionInformationControlCreator implements IInformationControlC
if (input instanceof IExpressionDMContext) {
fVariable = input;
fInputService.resolveViewerInput(input);
- } else if (input instanceof IVariable) {
- fVariable = input;
- fViewer.setInput(new TreeRoot());
}
}
@Override
public IInformationControlCreator getInformationPresenterControlCreator() {
- return new ExpressionInformationControlCreator(fShowDetailPane, fExpansionLevel) {
- @Override
- public IInformationControl createInformationControl(Shell shell) {
- return new ExpressionInformationControl(shell, true);
- }
- };
+ if (fInformationControlCreator == null) {
+ fInformationControlCreator = new ExpressionInformationControlCreator(fShowDetailPane, fExpansionLevel) {
+ @Override
+ public IInformationControl createInformationControl(Shell shell) {
+ return new ExpressionInformationControl(shell, true);
+ }
+ };
+ }
+ return fInformationControlCreator;
}
public void viewerInputComplete(IViewerInputUpdate update) {
@@ -491,7 +472,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/**
* Create default expression information control creator.
* <p>
- * Same as {@link ExpressionInformationControlCreator(true, 1)}.
+ * Same as {@code ExpressionInformationControlCreator(true, 1)}.
* </p>
*/
public ExpressionInformationControlCreator() {
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 d3115574dd4..e1ac76a9da1 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
@@ -157,9 +157,10 @@ abstract public class AbstractDsfDebugTextHover extends AbstractDebugTextHover i
/**
* Create an information control creator for the "advanced" hover.
- * Called by {@link #getHoverControlCreator()} when {@link #useExpressionExplorer()}
- * returns <code>true</code>.
- *
+ * <p>
+ * Clients can call this method to create an information control creator
+ * with custom options.
+ * </p>
* @param showDetailPane whether the detail pane should be visible
* @param defaultExpansionLevel automatically expand the expression to this level
* @return the information control creator
@@ -167,11 +168,27 @@ abstract public class AbstractDsfDebugTextHover extends AbstractDebugTextHover i
protected final IInformationControlCreator createExpressionInformationControlCreator(boolean showDetailPane, int defaultExpansionLevel) {
return new ExpressionInformationControlCreator(showDetailPane, defaultExpansionLevel);
}
+
+ /**
+ * Create an information control creator for the "advanced" hover.
+ * Called by {@link #getHoverControlCreator()} when {@link #useExpressionExplorer()}
+ * returns <code>true</code>.
+ * <p>
+ * The default implementation returns an information control creator with
+ * details pane enabled and default expansion level = 1.
+ * Clients may override this method to return an instance with different options.
+ * </p>
+ * @return the information control creator
+ * @see {@link #createExpressionInformationControlCreator(boolean, int)}
+ */
+ protected IInformationControlCreator createExpressionInformationControlCreator() {
+ return createExpressionInformationControlCreator(true, 1);
+ }
@Override
public IInformationControlCreator getHoverControlCreator() {
if (useExpressionExplorer()) {
- return createExpressionInformationControlCreator(true, 1);
+ return createExpressionInformationControlCreator();
} else {
return new IInformationControlCreator() {
public IInformationControl createInformationControl(Shell parent) {

Back to the top