From 6a80bb8cc78a3ca0cdbec5bf8a65b0f748541308 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Tue, 6 Apr 2010 02:16:26 +0000 Subject: [PATCH] [306569][308131] Allow to recalculate tabs' minimal size --- .../ui/launching/AbstractCDebuggerTab.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/AbstractCDebuggerTab.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/AbstractCDebuggerTab.java index 99a5de88a7c..210437cbd86 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/AbstractCDebuggerTab.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/AbstractCDebuggerTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 QNX Software Systems and others. + * Copyright (c) 2008, 2010 QNX Software Systems 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 @@ -17,6 +17,8 @@ import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDebugConfiguration; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.cdt.debug.ui.ICDebuggerPage; +import org.eclipse.cdt.debug.ui.ICDebuggerPageExtension; +import org.eclipse.cdt.debug.ui.ICDebuggerPageExtension.IContentChangeListener; import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; import org.eclipse.cdt.dsf.gdb.launching.LaunchMessages; import org.eclipse.core.runtime.CoreException; @@ -49,6 +51,16 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab { private boolean fIsInitializing = false; private boolean fPageUpdated; + private IContentChangeListener fContentListener = new IContentChangeListener() { + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.ui.ICDebuggerPageExtension.IContentChangeListener#contentChanged() + */ + public void contentChanged() { + contentsChanged(); + } + }; + protected void setDebugConfig(ICDebugConfiguration config) { fCurrentDebugConfig = config; } @@ -62,7 +74,11 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab { } protected void setDynamicTab(ICDebuggerPage tab) { - fDynamicTab = tab; + if ( fDynamicTab instanceof ICDebuggerPageExtension ) + ((ICDebuggerPageExtension)fDynamicTab).removeContentChangeListener( fContentListener ); + fDynamicTab = tab; + if ( fDynamicTab instanceof ICDebuggerPageExtension ) + ((ICDebuggerPageExtension)fDynamicTab).addContentChangeListener( fContentListener ); } protected Composite getDynamicTabHolder() {