mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
5226c0b13a
commit
b26d21eb32
1 changed files with 35 additions and 41 deletions
|
@ -45,7 +45,6 @@ import org.eclipse.ui.PlatformUI;
|
|||
* The dynamic tab for gdb-based debugger implementations.
|
||||
*/
|
||||
public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||
|
||||
protected TabFolder fTabFolder;
|
||||
protected Text fGDBCommandText;
|
||||
protected Text fGDBInitText;
|
||||
|
@ -75,13 +74,13 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, defaultGdbCommand);
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, defaultGdbInit);
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_NON_STOP_DEFAULT);
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_NON_STOP_DEFAULT);
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT);
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT);
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
|
||||
|
||||
if (fSolibBlock != null)
|
||||
fSolibBlock.setDefaults(configuration);
|
||||
|
@ -93,8 +92,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
if (valid) {
|
||||
setErrorMessage(null);
|
||||
setMessage(null);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setErrorMessage(LaunchUIMessages.getString("GDBDebuggerPage.gdb_executable_not_specified")); //$NON-NLS-1$
|
||||
setMessage(null);
|
||||
}
|
||||
|
@ -105,8 +103,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
private String getStringAttr(ILaunchConfiguration config, String attributeName, String defaultValue) {
|
||||
try {
|
||||
return config.getAttribute(attributeName, defaultValue);
|
||||
}
|
||||
catch (CoreException exc) {
|
||||
} catch (CoreException exc) {
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
@ -114,8 +111,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
private boolean getBooleanAttr(ILaunchConfiguration config, String attributeName, boolean defaultValue) {
|
||||
try {
|
||||
return config.getAttribute(attributeName, defaultValue);
|
||||
}
|
||||
catch (CoreException exc) {
|
||||
} catch (CoreException exc) {
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
@ -128,9 +124,9 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
String gdbCommand = getStringAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, defaultGdbCommand);
|
||||
String gdbInit = getStringAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, defaultGdbInit);
|
||||
boolean nonStopMode = getBooleanAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_NON_STOP_DEFAULT);
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_NON_STOP_DEFAULT);
|
||||
boolean reverseEnabled = getBooleanAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT);
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT);
|
||||
boolean updateThreadsOnSuspend = getBooleanAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
||||
boolean debugOnFork = getBooleanAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
||||
|
@ -150,17 +146,17 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
|
||||
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
|
||||
fGDBCommandText.getText().trim());
|
||||
fGDBCommandText.getText().trim());
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT,
|
||||
fGDBInitText.getText().trim());
|
||||
fGDBInitText.getText().trim());
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
|
||||
fNonStopCheckBox.getSelection());
|
||||
fNonStopCheckBox.getSelection());
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
|
||||
fReverseCheckBox.getSelection());
|
||||
fReverseCheckBox.getSelection());
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
|
||||
fUpdateThreadlistOnSuspend.getSelection());
|
||||
fUpdateThreadlistOnSuspend.getSelection());
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
||||
fDebugOnFork.getSelection());
|
||||
fDebugOnFork.getSelection());
|
||||
if (fSolibBlock != null)
|
||||
fSolibBlock.performApply(configuration);
|
||||
}
|
||||
|
@ -210,11 +206,11 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
|
||||
tabItem.setText(LaunchUIMessages.getString("GDBDebuggerPage.main_tab_name")); //$NON-NLS-1$
|
||||
Composite comp = ControlFactory.createCompositeEx(tabFolder, 1, GridData.FILL_BOTH);
|
||||
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
|
||||
((GridLayout) comp.getLayout()).makeColumnsEqualWidth = false;
|
||||
comp.setFont(tabFolder.getFont());
|
||||
tabItem.setControl(comp);
|
||||
Composite subComp = ControlFactory.createCompositeEx(comp, 3, GridData.FILL_HORIZONTAL);
|
||||
((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false;
|
||||
((GridLayout) subComp.getLayout()).makeColumnsEqualWidth = false;
|
||||
subComp.setFont(tabFolder.getFont());
|
||||
Label label = ControlFactory.createLabel(subComp, LaunchUIMessages.getString("GDBDebuggerPage.gdb_debugger")); //$NON-NLS-1$
|
||||
GridData gd = new GridData();
|
||||
|
@ -230,7 +226,6 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
});
|
||||
Button button = createPushButton(subComp, LaunchUIMessages.getString("GDBDebuggerPage.gdb_browse"), null); //$NON-NLS-1$
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent evt) {
|
||||
handleGDBButtonSelected();
|
||||
|
@ -268,7 +263,6 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
});
|
||||
button = createPushButton(subComp, LaunchUIMessages.getString("GDBDebuggerPage.gdb_cmdfile_browse"), null); //$NON-NLS-1$
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent evt) {
|
||||
handleGDBInitButtonSelected();
|
||||
|
@ -322,7 +316,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
tabItem.setControl(comp);
|
||||
fSolibBlock = createSolibBlock(comp);
|
||||
if (fSolibBlock instanceof Observable)
|
||||
((Observable)fSolibBlock).addObserver(this);
|
||||
((Observable) fSolibBlock).addObserver(this);
|
||||
}
|
||||
|
||||
/** Used to add a checkbox to the tab. Each checkbox has its own line. */
|
||||
|
@ -350,7 +344,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
|||
public void dispose() {
|
||||
if (fSolibBlock != null) {
|
||||
if (fSolibBlock instanceof Observable)
|
||||
((Observable)fSolibBlock).deleteObserver(this);
|
||||
((Observable) fSolibBlock).deleteObserver(this);
|
||||
fSolibBlock.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
|
|
Loading…
Add table
Reference in a new issue