1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

The "ICDebuggerPage" interface and "AbstractCDebuggerPage" class are added. All extensions of the "CDebuggerPage" extension point must implement "ICDebuggerPage".

This commit is contained in:
Mikhail Khodjaiants 2006-02-03 19:57:35 +00:00
parent 1390e00319
commit b6d6d8f874
7 changed files with 102 additions and 17 deletions

View file

@ -1,3 +1,11 @@
2006-02-03 Mikhail Khodjaiants
The "ICDebuggerPage" interface and "AbstractCDebuggerPage" class are added.
All extensions of the "CDebuggerPage" extension point must implement "ICDebuggerPage".
* CDebuggerPage.exsd
+ AbstractCDebuggerPage.java
* CDebugUIPlugin.java
+ ICDebuggerPage.java
2006-01-27 Mikhail Khodjaiants 2006-01-27 Mikhail Khodjaiants
Bug 125561: ClassCastException in Modules view. Bug 125561: ClassCastException in Modules view.
* ModulesView.java * ModulesView.java

View file

@ -64,7 +64,7 @@
specifies a fully qualified name of a Java class that implements <code>AbstractLaunchConfigurationTab</code> specifies a fully qualified name of a Java class that implements <code>AbstractLaunchConfigurationTab</code>
</documentation> </documentation>
<appInfo> <appInfo>
<meta.attribute kind="java" basedOn="org.eclipse.debug.ui.AbstractLaunchConfigurationTab"/> <meta.attribute kind="java" basedOn="org.eclipse.cdt.debug.ui.ICDebuggerPage"/>
</appInfo> </appInfo>
</annotation> </annotation>
</attribute> </attribute>

View file

@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2004 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.ui;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
/**
* Common function for debugger pages.
* @since 3.1
*/
abstract public class AbstractCDebuggerPage extends AbstractLaunchConfigurationTab implements ICDebuggerPage {
private String fDebuggerID = null;
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.ui.ICDebuggerPage#init(java.lang.String)
*/
public void init( String debuggerID ) {
fDebuggerID = debuggerID;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.ui.ICDebuggerPage#getDebuggerIdentifier()
*/
public String getDebuggerIdentifier() {
return fDebuggerID;
}
}

View file

@ -30,7 +30,6 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.model.IPersistableSourceLocator; import org.eclipse.debug.core.model.IPersistableSourceLocator;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Color;
@ -135,14 +134,15 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
log( new Status( IStatus.ERROR, getUniqueIdentifier(), IInternalCDebugUIConstants.INTERNAL_ERROR, message, null ) ); log( new Status( IStatus.ERROR, getUniqueIdentifier(), IInternalCDebugUIConstants.INTERNAL_ERROR, message, null ) );
} }
public ILaunchConfigurationTab getDebuggerPage( String debuggerID ) throws CoreException { public ICDebuggerPage getDebuggerPage( String debuggerID ) throws CoreException {
if ( fDebuggerPageMap == null ) { if ( fDebuggerPageMap == null ) {
initializeDebuggerPageMap(); initializeDebuggerPageMap();
} }
IConfigurationElement configElement = (IConfigurationElement)fDebuggerPageMap.get( debuggerID ); IConfigurationElement configElement = (IConfigurationElement)fDebuggerPageMap.get( debuggerID );
ILaunchConfigurationTab tab = null; ICDebuggerPage tab = null;
if ( configElement != null ) { if ( configElement != null ) {
tab = (ILaunchConfigurationTab)configElement.createExecutableExtension( "class" ); //$NON-NLS-1$ tab = (ICDebuggerPage)configElement.createExecutableExtension( "class" ); //$NON-NLS-1$
tab.init( debuggerID );
} }
return tab; return tab;
} }

View file

@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2004 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.ui;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
/**
* Interface for debugger pages contributed via the "CDebuggerPage"
* extension point.
*
* @since 3.1
*/
public interface ICDebuggerPage extends ILaunchConfigurationTab {
/**
* Allows the page to initialize itself after being created.
* This lifecycle method is called after the page has been created
* and before any other method of the page is called.
*
* @param debuggerID the identifier of the debugger this page is created for.
*/
public void init( String debuggerID );
/**
* Returns the identifier of the debugger this page is associated with.
*/
public String getDebuggerIdentifier();
}

View file

@ -1,3 +1,8 @@
2006-02-03 Mikhail Khodjaiants
The "ICDebuggerPage" interface and "AbstractCDebuggerPage" class are added.
All extensions of the "CDebuggerPage" extension point must implement "ICDebuggerPage".
* AbstractCLaunchDelegate.java
2006-01-30 Mikhail Khodjaiants 2006-01-30 Mikhail Khodjaiants
Bug 124519: CDT launch shortcuts ignore Common Tabs "Launch in background" option. Bug 124519: CDT launch shortcuts ignore Common Tabs "Launch in background" option.
Applied patch from Andrew Ferguson (andrew.ferguson@arm.com). Applied patch from Andrew Ferguson (andrew.ferguson@arm.com).

View file

@ -15,11 +15,11 @@ import java.util.Map;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConfiguration; import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.debug.ui.ICDebuggerPage;
import org.eclipse.cdt.launch.ui.CLaunchConfigurationTab; import org.eclipse.cdt.launch.ui.CLaunchConfigurationTab;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.ModifyListener;
@ -39,7 +39,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
protected ICDebugConfiguration fCurrentDebugConfig; protected ICDebugConfiguration fCurrentDebugConfig;
// Dynamic Debugger UI widgets // Dynamic Debugger UI widgets
protected ILaunchConfigurationTab fDynamicTab; protected ICDebuggerPage fDynamicTab;
protected Composite fDynamicTabHolder; protected Composite fDynamicTabHolder;
private boolean fInitDefaults; private boolean fInitDefaults;
private Combo fDCombo; private Combo fDCombo;
@ -54,11 +54,11 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
return fCurrentDebugConfig; return fCurrentDebugConfig;
} }
protected ILaunchConfigurationTab getDynamicTab() { protected ICDebuggerPage getDynamicTab() {
return fDynamicTab; return fDynamicTab;
} }
protected void setDynamicTab(ILaunchConfigurationTab tab) { protected void setDynamicTab(ICDebuggerPage tab) {
fDynamicTab = tab; fDynamicTab = tab;
} }
@ -94,7 +94,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
* @see ILaunchConfigurationTab#getErrorMessage() * @see ILaunchConfigurationTab#getErrorMessage()
*/ */
public String getErrorMessage() { public String getErrorMessage() {
ILaunchConfigurationTab tab = getDynamicTab(); ICDebuggerPage tab = getDynamicTab();
if ( (super.getErrorMessage() != null) || (tab == null)) { if ( (super.getErrorMessage() != null) || (tab == null)) {
return super.getErrorMessage(); return super.getErrorMessage();
} }
@ -157,7 +157,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
if (debugConfig == null) { if (debugConfig == null) {
setDynamicTab(null); setDynamicTab(null);
} else { } else {
ILaunchConfigurationTab tab = null; ICDebuggerPage tab = null;
try { try {
tab = CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID()); tab = CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID());
} catch (CoreException e) { } catch (CoreException e) {
@ -179,7 +179,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
abstract public void createControl(Composite parent); abstract public void createControl(Composite parent);
public void activated(ILaunchConfigurationWorkingCopy workingCopy) { public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
ILaunchConfigurationTab dynamicTab = getDynamicTab(); ICDebuggerPage dynamicTab = getDynamicTab();
if (dynamicTab != null) { if (dynamicTab != null) {
dynamicTab.activated(workingCopy); dynamicTab.activated(workingCopy);
} }
@ -187,7 +187,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
public void initializeFrom(ILaunchConfiguration config) { public void initializeFrom(ILaunchConfiguration config) {
setLaunchConfiguration(config); setLaunchConfiguration(config);
ILaunchConfigurationTab dynamicTab = getDynamicTab(); ICDebuggerPage dynamicTab = getDynamicTab();
if (dynamicTab != null) { if (dynamicTab != null) {
dynamicTab.initializeFrom(config); dynamicTab.initializeFrom(config);
} }
@ -196,7 +196,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
public void performApply(ILaunchConfigurationWorkingCopy config) { public void performApply(ILaunchConfigurationWorkingCopy config) {
if (getDebugConfig() != null) { if (getDebugConfig() != null) {
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, getDebugConfig().getID()); config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, getDebugConfig().getID());
ILaunchConfigurationTab dynamicTab = getDynamicTab(); ICDebuggerPage dynamicTab = getDynamicTab();
if (dynamicTab == null) { if (dynamicTab == null) {
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, (Map)null); config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, (Map)null);
} else { } else {
@ -207,7 +207,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
public void setDefaults(ILaunchConfigurationWorkingCopy config) { public void setDefaults(ILaunchConfigurationWorkingCopy config) {
setLaunchConfigurationWorkingCopy(config); setLaunchConfigurationWorkingCopy(config);
ILaunchConfigurationTab dynamicTab = getDynamicTab(); ICDebuggerPage dynamicTab = getDynamicTab();
if (dynamicTab != null) { if (dynamicTab != null) {
dynamicTab.setDefaults(config); dynamicTab.setDefaults(config);
setInitializeDefault(false); setInitializeDefault(false);
@ -222,7 +222,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
return false; return false;
} }
ILaunchConfigurationTab dynamicTab = getDynamicTab(); ICDebuggerPage dynamicTab = getDynamicTab();
if (dynamicTab != null) { if (dynamicTab != null) {
return dynamicTab.isValid(config); return dynamicTab.isValid(config);
} }
@ -322,7 +322,7 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
} }
/** /**
* Return the class that implements <code>ILaunchConfigurationTab</code> * Return the class that implements <code>ICDebuggerPage</code>
* that is registered against the debugger id of the currently selected * that is registered against the debugger id of the currently selected
* debugger. * debugger.
*/ */