@Test public void testDisplayString_StructureFieldLocation() { StructureDataType struct = new StructureDataType("TestStruct", 0); struct.add(new CharDataType()); struct.add(new StringDataType(), 4); struct.add(new TerminatedStringDataType(), 8); struct.add(new UnicodeDataType(), 12); Address structAddress = addr("f0001302"); CreateDataCmd cmd = new CreateDataCmd(structAddress, true, struct); assertTrue(applyCmd(program, cmd)); Address address = addr("f0001307"); int[] componentPath = new int[] { 2 }; Address refAddr = null; String rep = "\"\",00"; int opIndex = 0; int charOffset = 0; OperandFieldLocation location = new OperandFieldLocation(program, address, componentPath, refAddr, rep, opIndex, charOffset); PreviewTableCellData data = new PreviewTableCellData(location, formatter); String preview = data.getDisplayString(); assertEquals("ds \"\" (TestStruct.field_0x5)", preview); }
public String getDisplayString() { if (displayString != null) { return displayString; } displayString = getPreview(false); return displayString; }
PreviewTableCellData implements Comparable<PreviewTableCellData> { public String getDisplayString() { if (displayString != null) { return displayString; } displayString = getPreview(false); return displayString; } }
PreviewTableCellData implements Comparable<PreviewTableCellData> { public String getDisplayString() { if (displayString != null) { return displayString; } displayString = getPreview(false); return displayString; } PreviewTableCellData(ProgramLocation location, CodeUnitFormat codeUnitFormat); }
PreviewTableCellData implements Comparable<PreviewTableCellData> { public String getDisplayString() { if (displayString != null) { return displayString; } displayString = getPreview(false); return displayString; } PreviewTableCellData(ProgramLocation location, CodeUnitFormat codeUnitFormat); boolean isOffcut(); String getDisplayString(); @Override String toString(); String getHTMLDisplayString(); ProgramLocation getProgramLocation(); @Override int compareTo(PreviewTableCellData data); }
PreviewTableCellData implements Comparable<PreviewTableCellData> { public String getDisplayString() { if (displayString != null) { return displayString; } displayString = getPreview(false); return displayString; } PreviewTableCellData(ProgramLocation location, CodeUnitFormat codeUnitFormat); boolean isOffcut(); String getDisplayString(); @Override String toString(); String getHTMLDisplayString(); ProgramLocation getProgramLocation(); @Override int compareTo(PreviewTableCellData data);  }