mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Fixed missing help; fixed action enablement
This commit is contained in:
parent
4a65e9af3b
commit
ac00cf7e30
2 changed files with 10 additions and 7 deletions
|
@ -1365,7 +1365,7 @@
|
||||||
</BLOCKQUOTE>
|
</BLOCKQUOTE>
|
||||||
</BLOCKQUOTE>
|
</BLOCKQUOTE>
|
||||||
|
|
||||||
<H2><A name="Edit_Field"></A>Quick Editing of a Structure or Union Field</H2>
|
<H2><A name="Edit_Field"></A><A name="Quick_Edit_Field">Quick Editing of a Structure or Union Field</H2>
|
||||||
<BLOCKQUOTE>
|
<BLOCKQUOTE>
|
||||||
<P>As a convenience, a structure or union field can be edited directly from the listing without
|
<P>As a convenience, a structure or union field can be edited directly from the listing without
|
||||||
bringing up the entire structure or union editor. To edit a field, click anywhere on the line
|
bringing up the entire structure or union editor. To edit a field, click anywhere on the line
|
||||||
|
|
|
@ -842,8 +842,15 @@ public class DataPlugin extends Plugin implements DataService {
|
||||||
|
|
||||||
private boolean canEditField(ListingActionContext context) {
|
private boolean canEditField(ListingActionContext context) {
|
||||||
ProgramLocation location = context.getLocation();
|
ProgramLocation location = context.getLocation();
|
||||||
int[] componentPath = location.getComponentPath();
|
int[] path = location.getComponentPath();
|
||||||
return componentPath != null && componentPath.length > 0;
|
if (path == null || path.length == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Program program = context.getProgram();
|
||||||
|
Address address = location.getAddress();
|
||||||
|
DataTypeComponent dtc = DataTypeUtils.getDataTypeComponent(program, address, path);
|
||||||
|
return dtc != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void editField(ListingActionContext context) {
|
private void editField(ListingActionContext context) {
|
||||||
|
@ -854,10 +861,6 @@ public class DataPlugin extends Plugin implements DataService {
|
||||||
int[] path = location.getComponentPath();
|
int[] path = location.getComponentPath();
|
||||||
|
|
||||||
DataTypeComponent dtc = DataTypeUtils.getDataTypeComponent(program, address, path);
|
DataTypeComponent dtc = DataTypeUtils.getDataTypeComponent(program, address, path);
|
||||||
if (dtc == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DataType parent = dtc.getParent();
|
DataType parent = dtc.getParent();
|
||||||
Composite composite = (Composite) parent;
|
Composite composite = (Composite) parent;
|
||||||
int ordinal = dtc.getOrdinal();
|
int ordinal = dtc.getOrdinal();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue