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