Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java48
1 files changed, 24 insertions, 24 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java
index 2fd4ef732..29ca117d9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java
@@ -4,7 +4,7 @@
* 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:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -26,7 +26,7 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
public class GoToAddressComposite {
-
+
private Text fExpression;
private Button fOKButton;
private Button fCancelButton;
@@ -48,7 +48,7 @@ public class GoToAddressComposite {
layout.marginHeight = 0;
layout.marginLeft = 0;
fComposite.setLayout(layout);
-
+
fGoToCombo = new Combo(fComposite, SWT.READ_ONLY);
fGoToCombo.add(DebugUIMessages.GoToAddressComposite_0);
fGoToCombo.add(DebugUIMessages.GoToAddressComposite_4);
@@ -57,26 +57,26 @@ public class GoToAddressComposite {
fExpression = new Text(fComposite, SWT.SINGLE | SWT.BORDER);
fExpression.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
+
fHexButton = new Button(fComposite, SWT.CHECK);
fHexButton.setText(DebugUIMessages.GoToAddressComposite_6);
fHexButton.setSelection(true);
-
+
fOKButton = new Button(fComposite, SWT.NONE);
fOKButton.setText(DebugUIMessages.GoToAddressComposite_1);
-
+
fCancelButton = new Button(fComposite, SWT.NONE);
fCancelButton.setText(DebugUIMessages.GoToAddressComposite_2);
-
+
return fComposite;
}
-
+
public int getHeight()
{
int height = fComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
return height;
}
-
+
public Button getButton(int id)
{
if (id == IDialogConstants.OK_ID)
@@ -85,46 +85,46 @@ public class GoToAddressComposite {
return fCancelButton;
return null;
}
-
+
public String getExpressionText()
{
return fExpression.getText();
}
-
+
public Text getExpressionWidget()
{
return fExpression;
}
-
+
public boolean isGoToAddress()
{
return fGoToCombo.getSelectionIndex() == 0;
}
-
+
public boolean isOffset()
{
return fGoToCombo.getSelectionIndex() == 1;
}
-
+
public boolean isJump()
{
return fGoToCombo.getSelectionIndex() == 2;
}
-
+
public boolean isHex()
{
return fHexButton.getSelection();
}
-
+
public BigInteger getGoToAddress(BigInteger baseAddress, BigInteger selectedAddress) throws NumberFormatException
{
boolean add = true;
String expression = getExpressionText();
boolean hex = isHex();
int radix = hex?16:10;
-
+
expression = expression.trim();
-
+
if (isGoToAddress())
{
expression = expression.toUpperCase();
@@ -133,7 +133,7 @@ public class GoToAddressComposite {
expression = expression.substring(2);
radix = 16;
}
-
+
return new BigInteger(expression, radix);
}
@@ -146,15 +146,15 @@ public class GoToAddressComposite {
expression = expression.substring(1);
add = false;
}
-
+
expression = expression.toUpperCase();
if (expression.startsWith("0X")) //$NON-NLS-1$
{
expression = expression.substring(2);
radix = 16;
}
-
- BigInteger gotoAddress = new BigInteger(expression, radix);
+
+ BigInteger gotoAddress = new BigInteger(expression, radix);
BigInteger address = baseAddress;
if (isJump())
@@ -162,12 +162,12 @@ public class GoToAddressComposite {
if (address == null)
throw new NumberFormatException(DebugUIMessages.GoToAddressComposite_7);
-
+
if (add)
gotoAddress = address.add(gotoAddress);
else
gotoAddress = address.subtract(gotoAddress);
-
+
return gotoAddress;
}

Back to the top