1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-03-28 14:56:28 +01:00

Fixed NLS warnings

Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
Change-Id: I04565040918e5019415a7e4edd79f7337ab7da5d
This commit is contained in:
Torbjörn Svensson 2020-06-29 19:02:58 +02:00 committed by Alexander Fedorov
parent 0391d6ccf1
commit 3d218e99c7
20 changed files with 92 additions and 91 deletions

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.memorybrowser;singleton:=true
Bundle-Version: 1.3.300.qualifier
Bundle-Version: 1.3.400.qualifier
Bundle-Activator: org.eclipse.cdt.debug.ui.memory.memorybrowser.MemoryBrowserPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -49,7 +49,7 @@ public class GoToAddressBarWidget {
* Character sequence that is unlikely to appear naturally in a recurring
* debug context ID or memory space ID
*/
private static String SEPARATOR = "<seperator>";
private static String SEPARATOR = "<seperator>"; //$NON-NLS-1$
/**
* At a minimum, the expression history is kept on a per launch
@ -57,7 +57,7 @@ public class GoToAddressBarWidget {
* provide a recurring ID, we further divide the history by those IDs. This
* constant is used when no recurring context ID is available.
*/
private static String UNKNOWN_CONTEXT_ID = "Unknown";
private static String UNKNOWN_CONTEXT_ID = "Unknown"; //$NON-NLS-1$
private Combo fExpression;
private ControlDecoration fEmptyExpression;
private ControlDecoration fWrongExpression;
@ -120,12 +120,12 @@ public class GoToAddressBarWidget {
String contextID = getRecurringContextID(context);
ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
String currentExpressions = "";
String currentExpressions = ""; //$NON-NLS-1$
if (launchConfiguration != null) {
try {
ILaunchConfigurationWorkingCopy wc = launchConfiguration.getWorkingCopy();
if (wc != null) {
currentExpressions = wc.getAttribute(getSaveExpressionKey(contextID, memorySpace), "");
currentExpressions = wc.getAttribute(getSaveExpressionKey(contextID, memorySpace), ""); //$NON-NLS-1$
StringTokenizer st = new StringTokenizer(currentExpressions, ","); //$NON-NLS-1$
/*
@ -143,10 +143,10 @@ public class GoToAddressBarWidget {
list.remove(0);
}
currentExpressions = "";
currentExpressions = ""; //$NON-NLS-1$
for (int idx = 0; idx < list.size(); idx++) {
if (idx > 0) {
currentExpressions += ",";
currentExpressions += ","; //$NON-NLS-1$
}
currentExpressions += list.get(idx);
}
@ -233,10 +233,10 @@ public class GoToAddressBarWidget {
}
ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
String expressions = "";
String expressions = ""; //$NON-NLS-1$
if (launchConfiguration != null) {
expressions = launchConfiguration
.getAttribute(getSaveExpressionKey(getRecurringContextID(context), memorySpace), "");
.getAttribute(getSaveExpressionKey(getRecurringContextID(context), memorySpace), ""); //$NON-NLS-1$
}
StringTokenizer st = new StringTokenizer(expressions, ","); //$NON-NLS-1$

View file

@ -585,7 +585,7 @@ public class MemoryBrowser extends ViewPart
// widgets update require Display
runOnUIThread(() -> fGotoAddressBar
.handleExpressionStatus(new Status(Status.ERROR, MemoryBrowserPlugin.PLUGIN_ID,
Messages.getString("MemoryBrowser.FailedToGoToAddressTitle"), e1)));
Messages.getString("MemoryBrowser.FailedToGoToAddressTitle"), e1))); //$NON-NLS-1$
}
}
}.start();
@ -621,11 +621,11 @@ public class MemoryBrowser extends ViewPart
IMemoryBlockRetrieval retrieval = (IMemoryBlockRetrieval) tab.getParent().getData(KEY_RETRIEVAL);
if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) {
label = ((IMemorySpaceAwareMemoryBlockRetrieval) retrieval)
.encodeAddress("0x" + viewportAddress.toString(16), memorySpaceID);
.encodeAddress("0x" + viewportAddress.toString(16), memorySpaceID); //$NON-NLS-1$
}
}
if (label == null) {
label = "0x" + viewportAddress.toString(16);
label = "0x" + viewportAddress.toString(16); //$NON-NLS-1$
}
// If the expression that was went to ("Go") is not a hex address,
@ -639,13 +639,13 @@ public class MemoryBrowser extends ViewPart
//
String expression = (String) tab.getData(KEY_EXPRESSION);
BigInteger evaluatedAddress = (BigInteger) tab.getData(KEY_EXPRESSION_ADDRESS);
if (expression != null && !expression.equals("0x" + viewportAddress.toString(16))) {
label += " - " + expression;
if (expression != null && !expression.equals("0x" + viewportAddress.toString(16))) { //$NON-NLS-1$
label += " - " + expression; //$NON-NLS-1$
BigInteger delta = evaluatedAddress.subtract(viewportAddress);
if (!delta.equals(BigInteger.ZERO)) {
label += "(";
label += "("; //$NON-NLS-1$
label += delta.signum() < 0 ? '+' : '-';
label += "0x" + delta.abs().toString(16) + ")";
label += "0x" + delta.abs().toString(16) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
}

View file

@ -26,7 +26,7 @@ public class MemoryBrowserPreferenceInitializer extends AbstractPreferenceInitia
IPreferenceStore store = MemoryBrowserPlugin.getDefault().getPreferenceStore();
// The following preferences should be kept in the store
store.setDefault(MemoryBrowser.PREF_DEFAULT_RENDERING, "");
store.setDefault(MemoryBrowser.PREF_DEFAULT_RENDERING, ""); //$NON-NLS-1$
}
}

View file

@ -18,3 +18,4 @@ Require-Bundle: org.eclipse.debug.core,
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.eclipse.debug.ui.memory
Eclipse-LazyStart: true
Automatic-Module-Name: org.eclipse.cdt.debug.ui.memory.search

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.traditional;singleton:=true
Bundle-Version: 1.5.200.qualifier
Bundle-Version: 1.5.300.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.debug.core,
org.eclipse.debug.ui,

View file

@ -41,6 +41,7 @@ public class MemorySpacePreferencesHelper implements IMemorySpacePreferencesHelp
private final IPreferenceStore fStore;
// List of RGB colors that we can use, by default, for memory space backgrounds
@SuppressWarnings("nls")
private static final String[] fColorPool = { "238,192,192", "250,238,195", "255,179,0", "122,245,0", "184,242,255",
"166,189,215", "206,162,98", "245,138,157", "244,200,0", "255,136,56", "244,255,128" };
@ -55,7 +56,7 @@ public class MemorySpacePreferencesHelper implements IMemorySpacePreferencesHelp
*/
private String[] getMemorySpaceIds() {
String csv = fStore.getString(TraditionalRenderingPreferenceConstants.MEM_KNOWN_MEMORY_SPACE_ID_LIST_CSV);
return csv.isEmpty() ? new String[0] : csv.split(",");
return csv.isEmpty() ? new String[0] : csv.split(","); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -94,7 +95,7 @@ public class MemorySpacePreferencesHelper implements IMemorySpacePreferencesHelp
for (int i = 0; i < memorySpaces.length; i++) {
csv.append(memorySpaces[i]);
if (i < memorySpaces.length - 1) {
csv.append(",");
csv.append(","); //$NON-NLS-1$
}
}
@ -113,14 +114,14 @@ public class MemorySpacePreferencesHelper implements IMemorySpacePreferencesHelp
public Map<String, String> getMemorySpaceLabels() {
String prefix = TraditionalRenderingPreferenceConstants.MEM_MEMORY_SPACE_ID_PREFIX;
String labelPrefix = TraditionalRenderingMessages
.getString("TraditionalRenderingPreferencePage_BackgroundColorMemorySpacePrefix");
.getString("TraditionalRenderingPreferencePage_BackgroundColorMemorySpacePrefix"); //$NON-NLS-1$
String[] ids = getMemorySpaceIds();
Map<String, String> keysToLabels = new HashMap<>();
String key, label;
for (int i = 0; i < ids.length; i++) {
key = prefix + ids[i];
label = labelPrefix + " " + ids[i];
label = labelPrefix + " " + ids[i]; //$NON-NLS-1$
keysToLabels.put(key, label);
}
return keysToLabels;

View file

@ -74,7 +74,7 @@ public class AddressPane extends AbstractPane {
GC gc = new GC(this);
StringBuilder buf = new StringBuilder();
for (int i = 0; i < getCellCharacterCount(); i++)
buf.append("0");
buf.append("0"); //$NON-NLS-1$
int width = gc.textExtent(buf.toString()).x;
gc.dispose();
return width;

View file

@ -56,15 +56,15 @@ public class ColorAndEffectFieldEditor extends FieldEditor {
colorSelector.getButton().setLayoutData(new GridData());
checkBold = new Button(parent, SWT.CHECK);
checkBold.setText(TraditionalRenderingMessages.getString("ColorAndEffectFieldEditor.bold"));
checkBold.setText(TraditionalRenderingMessages.getString("ColorAndEffectFieldEditor.bold")); //$NON-NLS-1$
checkBold.setLayoutData(new GridData());
checkItalic = new Button(parent, SWT.CHECK);
checkItalic.setText(TraditionalRenderingMessages.getString("ColorAndEffectFieldEditor.italic"));
checkItalic.setText(TraditionalRenderingMessages.getString("ColorAndEffectFieldEditor.italic")); //$NON-NLS-1$
checkItalic.setLayoutData(new GridData());
checkBox = new Button(parent, SWT.CHECK);
checkBox.setText(TraditionalRenderingMessages.getString("ColorAndEffectFieldEditor.box"));
checkBox.setText(TraditionalRenderingMessages.getString("ColorAndEffectFieldEditor.box")); //$NON-NLS-1$
checkBox.setLayoutData(new GridData());
}

View file

@ -42,7 +42,7 @@ import org.eclipse.swt.widgets.Shell;
public class DataPane extends AbstractPane {
private Shell fToolTipShell;
private final static String UNICODE_NORTH_WEST_ARROW = "\u2196";
private final static String UNICODE_NORTH_WEST_ARROW = "\u2196"; //$NON-NLS-1$
public DataPane(Rendering parent) {
super(parent);
@ -542,7 +542,7 @@ public class DataPane extends AbstractPane {
}
// Display the associated textual information
String info = fRendering.buildAddressInfoString(startAddress, ",", false);
String info = fRendering.buildAddressInfoString(startAddress, ",", false); //$NON-NLS-1$
if (info.length() > 0) {
// Add one character e.g. up arrow, to indicate the start of the data i.e. upper or lower row
gc.drawText(UNICODE_NORTH_WEST_ARROW + info, location.x, location.y + getCellTextHeight());
@ -654,9 +654,8 @@ public class DataPane extends AbstractPane {
// TODO consider adding finer granularity?
boolean anyByteEditing = false;
for (int n = 0; n < bytes.length && !anyByteEditing; n++)
if (bytes[n] instanceof TraditionalMemoryByte)
if (bytes[n].isEdited())
anyByteEditing = true;
if (bytes[n].isEdited())
anyByteEditing = true;
TraditionalRendering ren = fRendering.getTraditionalRendering();
@ -758,13 +757,13 @@ public class DataPane extends AbstractPane {
private void diplayToolTip(Point hoverPoint, BigInteger subAddress) {
// Show the current hovering address as the first line in the tooltip
StringBuilder sb = new StringBuilder("0x").append(subAddress.toString(16));
StringBuilder sb = new StringBuilder("0x").append(subAddress.toString(16)); //$NON-NLS-1$
// Add additional address information, if available
if (fRendering.hasAddressInfo(subAddress)) {
String info = fRendering.buildAddressInfoString(subAddress, "\n", true);
String info = fRendering.buildAddressInfoString(subAddress, "\n", true); //$NON-NLS-1$
if (info.length() > 0) {
sb.append("\n").append(info);
sb.append("\n").append(info); //$NON-NLS-1$
}
}

View file

@ -987,7 +987,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
block.setValue(offset, byteValue);
} catch (Exception e) {
MemoryViewUtil.openError(
TraditionalRenderingMessages.getString("TraditionalRendering.FAILURE_WRITE_MEMORY"), "", e);
TraditionalRenderingMessages.getString("TraditionalRendering.FAILURE_WRITE_MEMORY"), "", e); //$NON-NLS-1$ //$NON-NLS-2$
logError(TraditionalRenderingMessages.getString("TraditionalRendering.FAILURE_WRITE_MEMORY"), e); //$NON-NLS-1$
}
@ -1009,7 +1009,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
public void setVisibleAddressBar(boolean visible) {
fAddressBarControl.setVisible(visible);
if (visible) {
String selectedStr = "0x" + getCaretAddress().toString(16);
String selectedStr = "0x" + getCaretAddress().toString(16); //$NON-NLS-1$
Text text = fAddressBar.getExpressionWidget();
text.setText(selectedStr);
text.setSelection(0, text.getCharCount());
@ -1444,9 +1444,9 @@ public class Rendering extends Composite implements IDebugEventSetListener {
protected void setCurrentScrollSelection() {
BigInteger viewportStartAddress = getViewportStartAddress();
if (TraceOptions.DEBUG) {
TraceOptions.trace(MessageFormat.format("Update scroll for viewrange[0x{0} : 0x{1}]:\n",
TraceOptions.trace(MessageFormat.format("Update scroll for viewrange[0x{0} : 0x{1}]:\n", //$NON-NLS-1$
viewportStartAddress.toString(16), getViewportEndAddress().toString(16)));
TraceOptions.trace(MessageFormat.format(" current ScrollRange=[0x{0} : 0x{1}]; selection = {2}\n",
TraceOptions.trace(MessageFormat.format(" current ScrollRange=[0x{0} : 0x{1}]; selection = {2}\n", //$NON-NLS-1$
getScrollStartAddress().toString(16), getScrollEndAddress().toString(16), fCurrentScrollSelection));
}
BigInteger addressableRow = BigInteger.valueOf(getAddressableCellsPerRow());
@ -1460,7 +1460,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
setScrollStartAddress(newScrollStart);
if (TraceOptions.DEBUG) {
TraceOptions.trace(MessageFormat.format(" new ScrollRange=[0x{0} : 0x{1}]\n",
TraceOptions.trace(MessageFormat.format(" new ScrollRange=[0x{0} : 0x{1}]\n", //$NON-NLS-1$
getScrollStartAddress().toString(16), getScrollEndAddress().toString(16)));
}
} else if (getViewportEndAddress().compareTo(getScrollEndAddress()) >= 0) {
@ -1477,7 +1477,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
setScrollStartAddress(newScrollStart);
if (TraceOptions.DEBUG) {
TraceOptions.trace(MessageFormat.format(" new ScrollRange=[0x{0} : 0x{1}]\n",
TraceOptions.trace(MessageFormat.format(" new ScrollRange=[0x{0} : 0x{1}]\n", //$NON-NLS-1$
getScrollStartAddress().toString(16), getScrollEndAddress().toString(16)));
}
}
@ -1486,7 +1486,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
fCurrentScrollSelection = viewportStartAddress.subtract(getScrollStartAddress()).divide(addressableRow)
.intValue() + 1;
if (TraceOptions.DEBUG) {
TraceOptions.trace(MessageFormat.format(" new selection={0}\n", fCurrentScrollSelection));
TraceOptions.trace(MessageFormat.format(" new selection={0}\n", fCurrentScrollSelection)); //$NON-NLS-1$
}
getVerticalBar().setSelection(fCurrentScrollSelection);
}
@ -1581,14 +1581,14 @@ public class Rendering extends Composite implements IDebugEventSetListener {
protected String getCharacterSet(int mode) {
switch (mode) {
case Rendering.TEXT_UTF8:
return "UTF8";
return "UTF8"; //$NON-NLS-1$
case Rendering.TEXT_UTF16:
return "UTF16";
return "UTF16"; //$NON-NLS-1$
case Rendering.TEXT_USASCII:
return "US-ASCII";
return "US-ASCII"; //$NON-NLS-1$
case Rendering.TEXT_ISO_8859_1:
default:
return "ISO-8859-1";
return "ISO-8859-1"; //$NON-NLS-1$
}
}
@ -1711,7 +1711,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
try {
clip = new Clipboard(getDisplay());
String addressString = "0x" + getCaretAddress().toString(16);
String addressString = "0x" + getCaretAddress().toString(16); //$NON-NLS-1$
TextTransfer plainTextTransfer = TextTransfer.getInstance();
clip.setContents(new Object[] { addressString }, new Transfer[] { plainTextTransfer });
@ -2024,7 +2024,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
* type e.g. Variables, Registers, etc.
*/
String buildAddressInfoString(BigInteger address, String separator, boolean addTypeHeaders) {
return "";
return ""; //$NON-NLS-1$
}
/**

View file

@ -481,7 +481,7 @@ public class RenderingAddressInfo extends Rendering implements IDebugContextList
List<IMemoryBlockAddressInfoItem> infoItems) {
if (infoItems == null || infoItems.size() < 1) {
// No information to display
return "";
return ""; //$NON-NLS-1$
}
// The container string builder for all types
@ -496,7 +496,7 @@ public class RenderingAddressInfo extends Rendering implements IDebugContextList
if (typeBuilder == null) {
// Create a String builder per information type
if (addTypeHeaders) {
typeBuilder = new StringBuilder(infoType).append(":").append(separator);
typeBuilder = new StringBuilder(infoType).append(":").append(separator); //$NON-NLS-1$
} else {
typeBuilder = new StringBuilder();
}

View file

@ -484,7 +484,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
// has a memory-space-specific background color been set for the associated memory space?
if (fMemorySpaceId != null) {
String key = fMemSpacePreferenceHelper.getMemorySpaceKey(fMemorySpaceId);
if (store.getString(key) != "") {
if (store.getString(key) != "") { //$NON-NLS-1$
colorBackground = new Color(Display.getDefault(), PreferenceConverter.getColor(store, key));
}
}

View file

@ -19,53 +19,53 @@ package org.eclipse.cdt.debug.ui.memory.traditional;
*/
public class TraditionalRenderingPreferenceConstants {
public static final String MEM_COLOR_CHANGED = "memoryColorChanged";
public static final String MEM_COLOR_CHANGED_ITALIC = "memoryColorChanged.italic";
public static final String MEM_COLOR_CHANGED_BOLD = "memoryColorChanged.bold";
public static final String MEM_COLOR_CHANGED_BOX = "memoryColorChanged.box";
public static final String MEM_COLOR_CHANGED = "memoryColorChanged"; //$NON-NLS-1$
public static final String MEM_COLOR_CHANGED_ITALIC = "memoryColorChanged.italic"; //$NON-NLS-1$
public static final String MEM_COLOR_CHANGED_BOLD = "memoryColorChanged.bold"; //$NON-NLS-1$
public static final String MEM_COLOR_CHANGED_BOX = "memoryColorChanged.box"; //$NON-NLS-1$
public static final String MEM_COLOR_EDIT = "memoryColorEdit";
public static final String MEM_COLOR_EDIT_ITALIC = "memoryColorEdit.italic";
public static final String MEM_COLOR_EDIT_BOLD = "memoryColorEdit.bold";
public static final String MEM_COLOR_EDIT_BOX = "memoryColorEdit.box";
public static final String MEM_COLOR_EDIT = "memoryColorEdit"; //$NON-NLS-1$
public static final String MEM_COLOR_EDIT_ITALIC = "memoryColorEdit.italic"; //$NON-NLS-1$
public static final String MEM_COLOR_EDIT_BOLD = "memoryColorEdit.bold"; //$NON-NLS-1$
public static final String MEM_COLOR_EDIT_BOX = "memoryColorEdit.box"; //$NON-NLS-1$
public static final String MEM_USE_GLOBAL_BACKGROUND = "memUseGlobalBackground";
public static final String MEM_USE_GLOBAL_BACKGROUND = "memUseGlobalBackground"; //$NON-NLS-1$
public static final String MEM_COLOR_BACKGROUND = "memoryColorBackground";
public static final String MEM_COLOR_BACKGROUND = "memoryColorBackground"; //$NON-NLS-1$
public static final String MEM_COLOR_TEXT = "memoryColorText";
public static final String MEM_COLOR_TEXT = "memoryColorText"; //$NON-NLS-1$
public static final String MEM_USE_GLOBAL_SELECTION = "memUseGlobalSelection";
public static final String MEM_USE_GLOBAL_SELECTION = "memUseGlobalSelection"; //$NON-NLS-1$
public static final String MEM_COLOR_SELECTION = "memoryColorSelection";
public static final String MEM_COLOR_SELECTION = "memoryColorSelection"; //$NON-NLS-1$
public static final String MEM_USE_GLOBAL_TEXT = "memUseGlobalText";
public static final String MEM_USE_GLOBAL_TEXT = "memUseGlobalText"; //$NON-NLS-1$
public static final String MEM_LIGHTEN_DARKEN_ALTERNATE_CELLS = "memoryColorScaleTextAlternate";
public static final String MEM_LIGHTEN_DARKEN_ALTERNATE_CELLS = "memoryColorScaleTextAlternate"; //$NON-NLS-1$
public static final String MEM_EDIT_BUFFER_SAVE = "memoryEditBufferSave";
public static final String MEM_EDIT_BUFFER_SAVE = "memoryEditBufferSave"; //$NON-NLS-1$
public static final String MEM_EDIT_BUFFER_SAVE_ON_ENTER_ONLY = "saveOnEnterCancelOnFocusLost";
public static final String MEM_EDIT_BUFFER_SAVE_ON_ENTER_ONLY = "saveOnEnterCancelOnFocusLost"; //$NON-NLS-1$
public static final String MEM_EDIT_BUFFER_SAVE_ON_ENTER_OR_FOCUS_LOST = "saveOnEnterOrFocusLost";
public static final String MEM_EDIT_BUFFER_SAVE_ON_ENTER_OR_FOCUS_LOST = "saveOnEnterOrFocusLost"; //$NON-NLS-1$
public static final String MEM_HISTORY_TRAILS_COUNT = "memoryHistoryTrailsCount";
public static final String MEM_HISTORY_TRAILS_COUNT = "memoryHistoryTrailsCount"; //$NON-NLS-1$
public static final String MEM_DEFAULT_COPY_ACTION = "memoryDefaultCopyAction";
public static final String MEM_DEFAULT_COPY_ACTION = "memoryDefaultCopyAction"; //$NON-NLS-1$
// support for memory space - specific coloring
/**
* @since 1.4
*/
public static final String MEM_KNOWN_MEMORY_SPACE_ID_LIST_CSV = "memorySpaceIdList";
public static final String MEM_KNOWN_MEMORY_SPACE_ID_LIST_CSV = "memorySpaceIdList"; //$NON-NLS-1$
/**
* @since 1.4
*/
public static final String MEM_MEMORY_SPACE_ID_PREFIX = MEM_COLOR_BACKGROUND + "MemorySpace-";
public static final String MEM_MEMORY_SPACE_ID_PREFIX = MEM_COLOR_BACKGROUND + "MemorySpace-"; //$NON-NLS-1$
/**
* @since 1.4
*/
public static final String MEM_CROSS_REFERENCE_INFO = "memCrossReferenceInfo";
public static final String MEM_CROSS_REFERENCE_INFO = "memCrossReferenceInfo"; //$NON-NLS-1$
}

View file

@ -35,29 +35,26 @@ public class TraditionalRenderingPreferenceInitializer extends AbstractPreferenc
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_USE_GLOBAL_BACKGROUND, true);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_USE_GLOBAL_SELECTION, true);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED, "255,0,0");
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED, "255,0,0"); //$NON-NLS-1$
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_ITALIC, false);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_BOLD, false);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_BOX, true);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT, "0,255,0");
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT, "0,255,0"); //$NON-NLS-1$
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_ITALIC, true);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_BOLD, false);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_BOX, true);
Color systemSelection = Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_SELECTION,
systemSelection.getRed() + "," + systemSelection.getGreen() + "," + systemSelection.getBlue());
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_SELECTION, toColorString(systemSelection));
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_LIGHTEN_DARKEN_ALTERNATE_CELLS, "5");
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_LIGHTEN_DARKEN_ALTERNATE_CELLS, "5"); //$NON-NLS-1$
Color systemText = Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_TEXT,
systemText.getRed() + "," + systemText.getGreen() + "," + systemText.getBlue());
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_TEXT, toColorString(systemText));
Color systemBackground = Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_BACKGROUND,
systemBackground.getRed() + "," + systemBackground.getGreen() + "," + systemBackground.getBlue());
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_BACKGROUND, toColorString(systemBackground));
// Set the default background colors, for known memory spaces
IMemorySpacePreferencesHelper util = TraditionalMemoryRenderingFactory.getMemorySpacesPreferencesHelper();
@ -74,9 +71,12 @@ public class TraditionalRenderingPreferenceInitializer extends AbstractPreferenc
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_EDIT_BUFFER_SAVE,
TraditionalRenderingPreferenceConstants.MEM_EDIT_BUFFER_SAVE_ON_ENTER_ONLY);
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_HISTORY_TRAILS_COUNT, "1");
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_HISTORY_TRAILS_COUNT, "1"); //$NON-NLS-1$
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_CROSS_REFERENCE_INFO, true);
}
private String toColorString(Color color) {
return String.format("%d,%d,%d", color.getRed(), color.getGreen(), color.getBlue()); //$NON-NLS-1$
}
}

View file

@ -60,7 +60,7 @@ public class ExportMemoryDialog extends SelectionDialog {
private IDialogSettings fProperties = MemoryTransportPlugin.getDefault().getDialogSettings(EXPORT_SETTINGS);
private final String INITIAL_ADDRESS = "Initial address";
private final String INITIAL_ADDRESS = "Initial address"; //$NON-NLS-1$
public ExportMemoryDialog(Shell parent, IMemoryBlock memoryBlock, BigInteger initialStartAddr) {
super(parent);
@ -183,14 +183,14 @@ public class ExportMemoryDialog extends SelectionDialog {
IConfigurationElement element = points[i];
if ("exporter".equals(element.getName())) //$NON-NLS-1$
{
String maxSizeStr = element.getAttribute("maxmemorysize");
String maxSizeStr = element.getAttribute("maxmemorysize"); //$NON-NLS-1$
if (maxSizeStr != null) {
if (fMemoryBlock instanceof IMemoryBlockExtension) {
IMemoryBlockExtension memBlock = (IMemoryBlockExtension) fMemoryBlock;
try {
BigInteger endAddress = memBlock.getBigBaseAddress();
BigInteger length = memBlock.getBigLength();
if (length != null && !length.equals(new BigInteger("-1", 10))) {
if (length != null && !length.equals(new BigInteger("-1", 10))) { //$NON-NLS-1$
endAddress = endAddress.add(length);
}
int maxAddressSizeInBits = endAddress.bitLength();

View file

@ -70,7 +70,7 @@ public class ImportMemoryDialog extends SelectionDialog {
private IMemoryRenderingSite fMemoryView;
private final String INITIAL_ADDRESS = "Initial address";
private final String INITIAL_ADDRESS = "Initial address"; //$NON-NLS-1$
public ImportMemoryDialog(Shell parent, IMemoryBlock memoryBlock, BigInteger initialStartAddr,
IMemoryRenderingSite renderingSite) {
@ -221,7 +221,7 @@ public class ImportMemoryDialog extends SelectionDialog {
IConfigurationElement element = points[i];
if ("importer".equals(element.getName())) //$NON-NLS-1$
{
String maxSizeStr = element.getAttribute("maxmemorysize");
String maxSizeStr = element.getAttribute("maxmemorysize"); //$NON-NLS-1$
if (maxSizeStr != null) {
if (fMemoryBlock instanceof IMemoryBlockExtension) {
IMemoryBlockExtension memBlock = (IMemoryBlockExtension) fMemoryBlock;

View file

@ -309,7 +309,7 @@ public class PlainTextExporter implements IMemoryExporter {
if (length.compareTo(BigInteger.ZERO) <= 0) {
if (endAddress.compareTo(BigInteger.ZERO) < 0) {
endString = endAddress.toString(16); //$NON-NLS-1$
endString = endAddress.toString(16);
} else {
endString = "0x" + endAddress.toString(16); //$NON-NLS-1$
}

View file

@ -311,7 +311,7 @@ public class RAWBinaryExporter implements IMemoryExporter {
if (length.compareTo(BigInteger.ZERO) <= 0) {
if (endAddress.compareTo(BigInteger.ZERO) < 0) {
endString = endAddress.toString(16); //$NON-NLS-1$
endString = endAddress.toString(16);
} else {
endString = "0x" + endAddress.toString(16); //$NON-NLS-1$
}

View file

@ -332,7 +332,7 @@ public class SRecordExporter implements IMemoryExporter {
if (length.compareTo(BigInteger.ZERO) <= 0) {
if (endAddress.compareTo(BigInteger.ZERO) < 0) {
endString = endAddress.toString(16); //$NON-NLS-1$
endString = endAddress.toString(16);
} else {
endString = "0x" + endAddress.toString(16); //$NON-NLS-1$
}