mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Some cleanup leading up to some functional improvements (this commit doesn't alter behavior).
This commit is contained in:
parent
503dee38ed
commit
064d4429ba
2 changed files with 15 additions and 7 deletions
|
@ -12,6 +12,7 @@
|
|||
package org.eclipse.cdt.debug.internal.ui.views.memory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.debug.internal.core.CMemoryBlockRetrievalExtension;
|
||||
import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
|
||||
|
@ -57,8 +58,8 @@ public class AddMemoryBlockDialog extends TrayDialog implements ModifyListener,
|
|||
private boolean fEnteredExpression; // basically, which of the two radio buttons was selected when OK was hit
|
||||
private CMemoryBlockRetrievalExtension fMemRetrieval;
|
||||
|
||||
private static ArrayList sAddressHistory = new ArrayList();
|
||||
private static ArrayList sExpressionHistory = new ArrayList();
|
||||
private static List<String> sAddressHistory = new ArrayList<String>();
|
||||
private static List<String> sExpressionHistory = new ArrayList<String>();
|
||||
|
||||
public AddMemoryBlockDialog(Shell parentShell,
|
||||
IMemoryBlockRetrieval memRetrieval) {
|
||||
|
@ -74,6 +75,7 @@ public class AddMemoryBlockDialog extends TrayDialog implements ModifyListener,
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
PlatformUI.getWorkbench().getHelpSystem().setHelp(
|
||||
parent,
|
||||
|
@ -170,6 +172,7 @@ public class AddMemoryBlockDialog extends TrayDialog implements ModifyListener,
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
|
||||
*/
|
||||
@Override
|
||||
protected void configureShell(Shell newShell) {
|
||||
super.configureShell(newShell);
|
||||
|
||||
|
@ -180,6 +183,7 @@ public class AddMemoryBlockDialog extends TrayDialog implements ModifyListener,
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
|
||||
*/
|
||||
@Override
|
||||
protected void okPressed() {
|
||||
fExpression = fExpressionInput.getText();
|
||||
fAddress = fAddressInput.getText();
|
||||
|
@ -212,6 +216,7 @@ public class AddMemoryBlockDialog extends TrayDialog implements ModifyListener,
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
protected Control createButtonBar(Composite parent) {
|
||||
return super.createButtonBar(parent);
|
||||
}
|
||||
|
@ -232,7 +237,7 @@ public class AddMemoryBlockDialog extends TrayDialog implements ModifyListener,
|
|||
return fEnteredExpression;
|
||||
}
|
||||
|
||||
private static void addHistory(ArrayList list, String item) {
|
||||
private static void addHistory(List<String> list, String item) {
|
||||
if (!list.contains(item))
|
||||
list.add(0, item);
|
||||
|
||||
|
@ -240,8 +245,8 @@ public class AddMemoryBlockDialog extends TrayDialog implements ModifyListener,
|
|||
list.remove(list.size()-1);
|
||||
}
|
||||
|
||||
private static String[] getHistory(ArrayList list) {
|
||||
return (String[])list.toArray(new String[list.size()]);
|
||||
private static String[] getHistory(List<String> list) {
|
||||
return list.toArray(new String[list.size()]);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
package org.eclipse.cdt.debug.internal.ui.views.memory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.eclipse.cdt.debug.internal.core.CMemoryBlockRetrievalExtension;
|
||||
|
@ -91,7 +92,7 @@ public class AddMemoryBlocks implements IAddMemoryBlocksTarget {
|
|||
|
||||
String input = dialog.enteredExpression() ? dialog.getExpression() : dialog.getAddress();
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
List<String> list = new ArrayList<String>();
|
||||
|
||||
if (input.length() == 0)
|
||||
list.add(""); //$NON-NLS-1$
|
||||
|
@ -101,7 +102,7 @@ public class AddMemoryBlocks implements IAddMemoryBlocksTarget {
|
|||
list.add(tokenizer.nextToken());
|
||||
}
|
||||
|
||||
final String[] addrsOrExprs = (String[]) list.toArray(new String[list.size()]);
|
||||
final String[] addrsOrExprs = list.toArray(new String[list.size()]);
|
||||
|
||||
ParamHolder params;
|
||||
if (dialog.enteredExpression())
|
||||
|
@ -114,6 +115,7 @@ public class AddMemoryBlocks implements IAddMemoryBlocksTarget {
|
|||
final ParamHolder params_f = params;
|
||||
final IMemoryRenderingSite memRendSite = (IMemoryRenderingSite) part;
|
||||
Job job = new Job("Add Memory Block") { //$NON-NLS-1$
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
addMemoryBlocks(debugViewElement_f, retrieval_f, params_f,
|
||||
memRendSite);
|
||||
|
@ -273,6 +275,7 @@ public class AddMemoryBlocks implements IAddMemoryBlocksTarget {
|
|||
{
|
||||
UIJob uiJob = new UIJob("open error"){ //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
public IStatus runInUIThread(IProgressMonitor monitor) {
|
||||
// open error for the exception
|
||||
String detail = ""; //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue