mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
GP-4478: More review changes
GP-4478: Review changes GP-4478 Add help to assembler Add help to assembler Initial commit
This commit is contained in:
parent
8c56fc8e04
commit
6096a50042
2 changed files with 28 additions and 11 deletions
|
@ -46,8 +46,8 @@ import ghidra.program.model.address.Address;
|
|||
import ghidra.program.model.lang.*;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.model.mem.ByteMemBufferImpl;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.NumericUtilities;
|
||||
import ghidra.util.*;
|
||||
import help.Help;
|
||||
|
||||
/**
|
||||
* A pair of text fields suitable for guided assembly
|
||||
|
@ -402,13 +402,14 @@ public class AssemblyDualTextField {
|
|||
private static final String CMD_ZERO = "Zero undefined bits";
|
||||
|
||||
private JLabel hints;
|
||||
private EmptyBorderToggleButton button;
|
||||
|
||||
@Override
|
||||
protected void addContent(JPanel content) {
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
Box controls = Box.createHorizontalBox();
|
||||
Icon icon = new GIcon("icon.plugin.assembler.question");
|
||||
EmptyBorderToggleButton button = new EmptyBorderToggleButton(icon);
|
||||
button = new EmptyBorderToggleButton(icon);
|
||||
button.setToolTipText("Exhaust unspecified bits, otherwise zero them");
|
||||
button.addActionListener((e) -> {
|
||||
exhaustUndefined = CMD_EXHAUST.equals(e.getActionCommand());
|
||||
|
@ -428,6 +429,7 @@ public class AssemblyDualTextField {
|
|||
content.add(panel, BorderLayout.SOUTH);
|
||||
|
||||
addAutocompletionListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -633,6 +635,15 @@ public class AssemblyDualTextField {
|
|||
return operands;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the button that toggles bit exhaustion
|
||||
*
|
||||
* @return the button
|
||||
*/
|
||||
public JButton getExhaustButton() {
|
||||
return auto.button;
|
||||
}
|
||||
|
||||
/**
|
||||
* For single mode: Get the text field containing the full assembly text
|
||||
*
|
||||
|
|
|
@ -47,6 +47,7 @@ import ghidra.util.HelpLocation;
|
|||
import ghidra.util.Msg;
|
||||
import ghidra.util.task.CachingSwingWorker;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
import help.Help;
|
||||
|
||||
/**
|
||||
* A context menu action to assemble an instruction at the current address
|
||||
|
@ -145,7 +146,8 @@ public class PatchInstructionAction extends AbstractPatchAction {
|
|||
|
||||
setPopupMenuData(new MenuData(new String[] { name }, MENU_GROUP));
|
||||
setKeyBindingData(new KeyBindingData(KEYBIND_PATCH_INSTRUCTION));
|
||||
setHelpLocation(new HelpLocation(owner.getName(), "patch_instruction"));
|
||||
HelpLocation location = new HelpLocation(owner.getName(), "patch_instruction");
|
||||
setHelpLocation(location);
|
||||
|
||||
input.getMnemonicField().setBorder(BorderFactory.createLineBorder(Colors.ERROR, 2));
|
||||
input.getOperandsField().setBorder(BorderFactory.createLineBorder(Colors.ERROR, 2));
|
||||
|
@ -153,6 +155,10 @@ public class PatchInstructionAction extends AbstractPatchAction {
|
|||
|
||||
input.getAutocompleter().addAutocompletionListener(listenerForAccept);
|
||||
|
||||
Help.getHelpService().registerHelp(input.getMnemonicField(), location);
|
||||
Help.getHelpService().registerHelp(input.getOperandsField(), location);
|
||||
Help.getHelpService().registerHelp(input.getExhaustButton(), location);
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue