mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Added Accessibility to FieldPanel
This commit is contained in:
@@ -79,7 +79,8 @@ public class ByteViewerComponent extends FieldPanel implements FieldMouseListene
|
||||
*/
|
||||
protected ByteViewerComponent(ByteViewerPanel vpanel, ByteViewerLayoutModel layoutModel,
|
||||
DataFormatModel model, int bytesPerLine, FontMetrics fm) {
|
||||
super(layoutModel);
|
||||
super(layoutModel, "Byte Viewer");
|
||||
setFieldDescriptionProvider((l, f) -> getFieldDescription(l, f));
|
||||
|
||||
this.panel = vpanel;
|
||||
this.model = model;
|
||||
@@ -94,6 +95,17 @@ public class ByteViewerComponent extends FieldPanel implements FieldMouseListene
|
||||
setBackgroundColorModel(new ByteViewerBackgroundColorModel());
|
||||
}
|
||||
|
||||
private String getFieldDescription(FieldLocation fieldLoc, Field field) {
|
||||
ByteBlockInfo info = indexMap.getBlockInfo(fieldLoc.getIndex(), fieldLoc.getFieldNum());
|
||||
if (info != null) {
|
||||
String modelName = model.getName();
|
||||
return modelName + " format at " +
|
||||
info.getBlock().getLocationRepresentation(info.getOffset()) + ", value = " +
|
||||
field.getText();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buttonPressed(FieldLocation fieldLocation, Field field, MouseEvent mouseEvent) {
|
||||
if (fieldLocation == null || field == null) {
|
||||
@@ -468,8 +480,7 @@ public class ByteViewerComponent extends FieldPanel implements FieldMouseListene
|
||||
else {
|
||||
++endFieldOffset;
|
||||
}
|
||||
fsel.addRange(
|
||||
new FieldLocation(startLoc.getIndex(), startLoc.getFieldNum(), 0, 0),
|
||||
fsel.addRange(new FieldLocation(startLoc.getIndex(), startLoc.getFieldNum(), 0, 0),
|
||||
new FieldLocation(endIndex, endFieldOffset, 0, 0));
|
||||
}
|
||||
return fsel;
|
||||
|
||||
@@ -752,7 +752,7 @@ public class ByteViewerPanel extends JPanel
|
||||
|
||||
// for the index/address column
|
||||
indexFactory = new IndexFieldFactory(fm);
|
||||
indexPanel = new FieldPanel(this);
|
||||
indexPanel = new FieldPanel(this, "Byte Viewer");
|
||||
|
||||
indexPanel.enableSelection(false);
|
||||
indexPanel.setCursorOn(false);
|
||||
|
||||
Reference in New Issue
Block a user