1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 01:35:39 +02:00

check arraylist

This commit is contained in:
David Inglis 2002-08-15 19:47:38 +00:00
parent fe9ea3edcb
commit ef52ee50a4

View file

@ -36,7 +36,7 @@ import org.eclipse.swt.widgets.Label;
public class CDebuggerTab extends CLaunchConfigurationTab { public class CDebuggerTab extends CLaunchConfigurationTab {
ArrayList fDinfo; ArrayList fDinfo;
int fDindex; int fDindex;
Combo fDlist; Combo fDCombo;
Button stopInMain; Button stopInMain;
// Dynamic Debugger UI widgets // Dynamic Debugger UI widgets
@ -53,8 +53,8 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
comp.setLayout(topLayout); comp.setLayout(topLayout);
Label dlabel = new Label(comp, SWT.NONE); Label dlabel = new Label(comp, SWT.NONE);
dlabel.setText("Debugger:"); dlabel.setText("Debugger:");
fDlist = new Combo(comp, SWT.DROP_DOWN|SWT.READ_ONLY); fDCombo = new Combo(comp, SWT.DROP_DOWN|SWT.READ_ONLY);
fDlist.addModifyListener(new ModifyListener() { fDCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) { public void modifyText(ModifyEvent e) {
handleDebuggerComboBoxModified(); handleDebuggerComboBoxModified();
} }
@ -145,7 +145,7 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
if ( fDinfo != null ) { if ( fDinfo != null ) {
fDinfo.clear(); fDinfo.clear();
} }
fDlist.removeAll(); fDCombo.removeAll();
debugConfigs = CDebugCorePlugin.getDefault().getDebugConfigurations(); debugConfigs = CDebugCorePlugin.getDefault().getDebugConfigurations();
fDinfo = new ArrayList(debugConfigs.length); fDinfo = new ArrayList(debugConfigs.length);
for( int i = 0; i < debugConfigs.length; i++ ) { for( int i = 0; i < debugConfigs.length; i++ ) {
@ -153,19 +153,19 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
for( int j = 0; j < supported.length; j++ ) { for( int j = 0; j < supported.length; j++ ) {
if (supported[j].equals("*") || supported[j].equalsIgnoreCase(platform)) { if (supported[j].equals("*") || supported[j].equalsIgnoreCase(platform)) {
fDinfo.add(debugConfigs[i]); fDinfo.add(debugConfigs[i]);
fDlist.add(debugConfigs[i].getName()); fDCombo.add(debugConfigs[i].getName());
break; break;
} }
} }
} }
fDlist.getParent().layout(); fDCombo.getParent().layout();
} }
protected void setSelection(String id) { protected void setSelection(String id) {
for (int i = 0; i < fDinfo.size(); i++ ) { for (int i = 0; i < fDinfo.size(); i++ ) {
ICDebugConfiguration debugConfig = (ICDebugConfiguration) fDinfo.get(i); ICDebugConfiguration debugConfig = (ICDebugConfiguration) fDinfo.get(i);
if ( debugConfig != null && debugConfig.getID().equals(id) ) { if ( debugConfig != null && debugConfig.getID().equals(id) ) {
fDlist.select(i); fDCombo.select(i);
return; return;
} }
} }
@ -210,7 +210,7 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
public void performApply(ILaunchConfigurationWorkingCopy config) { public void performApply(ILaunchConfigurationWorkingCopy config) {
if ( isValid(config) ) { if ( isValid(config) ) {
ICDebugConfiguration dbgCfg = (ICDebugConfiguration)fDinfo.get(fDlist.getSelectionIndex()); ICDebugConfiguration dbgCfg = (ICDebugConfiguration)fDinfo.get(fDCombo.getSelectionIndex());
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, dbgCfg.getID() ); config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, dbgCfg.getID() );
ILaunchConfigurationTab dynamicTab = getDynamicTab(); ILaunchConfigurationTab dynamicTab = getDynamicTab();
if (dynamicTab == null) { if (dynamicTab == null) {
@ -226,7 +226,7 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
setErrorMessage(null); setErrorMessage(null);
setMessage(null); setMessage(null);
if ( fDlist.getSelectionIndex() == -1 ) { if ( fDCombo.getSelectionIndex() == -1 ) {
setErrorMessage("No debugger avalible"); setErrorMessage("No debugger avalible");
return false; return false;
} }
@ -243,8 +243,8 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
* that is registered against the debugger id of the currently selected debugger. * that is registered against the debugger id of the currently selected debugger.
*/ */
protected ILaunchConfigurationTab getTabForCurrentDebugger() { protected ILaunchConfigurationTab getTabForCurrentDebugger() {
int selectedIndex = fDlist.getSelectionIndex(); int selectedIndex = fDCombo.getSelectionIndex();
if (selectedIndex >= 0) { if (selectedIndex >= 0 && !fDinfo.isEmpty()) {
ICDebugConfiguration dbgCfg = (ICDebugConfiguration) fDinfo.get(selectedIndex); ICDebugConfiguration dbgCfg = (ICDebugConfiguration) fDinfo.get(selectedIndex);
return CDebugUIPlugin.getDefault().getDebuggerPage(dbgCfg.getID()); return CDebugUIPlugin.getDefault().getDebuggerPage(dbgCfg.getID());
} }