GP-5176: Hovering on addresses in the Listing now show offsets in both

decimal and hexadecimal
This commit is contained in:
Ryan Kurtz 2024-12-05 11:30:34 -05:00
parent c5b753e881
commit 69ee044f29

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -178,12 +178,19 @@ public class ProgramAddressRelationshipListingHover extends AbstractConfigurable
if (reference != null) { if (reference != null) {
sb.append(italic(reference)).append(" "); sb.append(italic(reference)).append(" ");
} }
sb.append(formatOffset(offset)); sb.append(formatHexOffset(offset));
sb.append("</td>");
sb.append("<td style=\"text-align: right;\">");
sb.append(formatDecimalOffset(offset));
sb.append("</td></tr>"); sb.append("</td></tr>");
} }
private static String formatOffset(long offset) { private static String formatHexOffset(long offset) {
return String.format("+%xh", offset); return String.format("+%xh", offset);
} }
private static String formatDecimalOffset(long offset) {
return String.format("(+%d)", offset);
}
} }