Package ghidra.app.util
Class AddressInput
- java.lang.Object
- 
- java.awt.Component
- 
- java.awt.Container
- 
- javax.swing.JComponent
- 
- javax.swing.JPanel
- 
- ghidra.app.util.AddressInput
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.awt.image.ImageObserver,- java.awt.MenuContainer,- java.io.Serializable,- javax.accessibility.Accessible
 
 public class AddressInput extends javax.swing.JPanelPanel for user input of addresses. Handles case with multiple address spaces.- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class javax.swing.JPaneljavax.swing.JPanel.AccessibleJPanel
 - 
Nested classes/interfaces inherited from class javax.swing.JComponentjavax.swing.JComponent.AccessibleJComponent
 
- 
 - 
Field Summary- 
Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
- 
 - 
Constructor SummaryConstructors Constructor Description AddressInput()Constructor for AddressInput.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionListener(java.awt.event.ActionListener listener)Add an action listener that will be notified anytime the user presses the return key while in the text field.voidaddChangeListener(javax.swing.event.ChangeListener listener)Adds a change listener that will be notified anytime this address value in this panel changesvoidclear()Clear the offset part of the address field.booleancontainsAddressSpaces()AddressgetAddress()Returns the address in the field or null if the address can't be parsed.AddressFactorygetAddressFactory()AddressSpacegetAddressSpace()Returns the address space selected in the combobox or in the input text itself if specified (eg: "register:1").protected javax.swing.JTextFieldgetAddressSpaceTextField()protected javax.swing.JTextFieldgetAddressTextField()java.lang.StringgetValue()Get the offset part of the address field.booleanhasInput()Returns true if the Address input field contains text.booleanisEditable()booleanisEnabled()voidremoveActionListener(java.awt.event.ActionListener listener)Removes the action listener from the list to be notified.voidrequestFocus()voidselect()Select the text field that is the offset.voidselectDefaultAddressSpace()Sets the selected combo box item to the default address space.voidsetAddress(Address addr)Set the field to display the given addressvoidsetAddressFactory(AddressFactory factory)Set the address factory to be used to parse addresses.voidsetAddressFactory(AddressFactory factory, boolean filterOverlaySpaces, boolean allowOtherSpace)Set the address factory to be used to parse addresses.voidsetAddressSpaceEditable(boolean state)Set the address space (if it is shown) such that it is not editable.voidsetEditable(boolean state)Set the text field to be editable according to the state param.voidsetEnabled(boolean enabled)voidsetValue(java.lang.String value)Set the offset part of the address field.voidshowAddressSpaceCombo(boolean showCombo)- 
Methods inherited from class javax.swing.JPanelgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 - 
Methods inherited from class javax.swing.JComponentaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 - 
Methods inherited from class java.awt.Containeradd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 - 
Methods inherited from class java.awt.Componentaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
- 
 
- 
- 
- 
Method Detail- 
setAddresspublic void setAddress(Address addr) Set the field to display the given address
 - 
getAddresspublic Address getAddress() Returns the address in the field or null if the address can't be parsed.- Throws:
- java.lang.NullPointerException- if AddressFactory has not been set.
 
 - 
getAddressSpacepublic AddressSpace getAddressSpace() Returns the address space selected in the combobox or in the input text itself if specified (eg: "register:1"). If the address space is not specified; returns the default space.- Throws:
- java.lang.NullPointerException- if AddressFactory has not been set.
 
 - 
hasInputpublic boolean hasInput() Returns true if the Address input field contains text. The getAddress() method will return null if text is not a valid address.
 - 
setAddressFactorypublic void setAddressFactory(AddressFactory factory) Set the address factory to be used to parse addresses. Also used to set the combo box with the list of valid address spaces if there is more than one space.
 - 
getAddressFactorypublic AddressFactory getAddressFactory() 
 - 
setAddressFactorypublic void setAddressFactory(AddressFactory factory, boolean filterOverlaySpaces, boolean allowOtherSpace) Set the address factory to be used to parse addresses. Also used to set the combo box with the list of valid address spaces if there is more than one space.- Parameters:
- factory- address factory to use
- filterOverlaySpaces- true if overlay spaces should not appear in the combo box for the address spaces.
- allowOtherSpace- true if the OTHER space should appear in the combo box for the address spaces
 
 - 
selectDefaultAddressSpacepublic void selectDefaultAddressSpace() Sets the selected combo box item to the default address space.
 - 
clearpublic void clear() Clear the offset part of the address field.
 - 
selectpublic void select() Select the text field that is the offset.
 - 
getValuepublic java.lang.String getValue() Get the offset part of the address field.- Returns:
- String
 
 - 
setValuepublic void setValue(java.lang.String value) Set the offset part of the address field.- Parameters:
- value- the offset value string
 
 - 
isEnabledpublic boolean isEnabled() - Overrides:
- isEnabledin class- java.awt.Component
 
 - 
containsAddressSpacespublic boolean containsAddressSpaces() 
 - 
setAddressSpaceEditablepublic void setAddressSpaceEditable(boolean state) Set the address space (if it is shown) such that it is not editable. If the combo box is shown for multiple address spaces, then the combo box is replaced with a fixed uneditable text field that shows the currently selected address space.- Parameters:
- state- false means that the combo box should not be editable
 
 - 
addChangeListenerpublic void addChangeListener(javax.swing.event.ChangeListener listener) Adds a change listener that will be notified anytime this address value in this panel changes- Parameters:
- listener- the change listener to be notified.
 
 - 
addActionListenerpublic void addActionListener(java.awt.event.ActionListener listener) Add an action listener that will be notified anytime the user presses the return key while in the text field.- Parameters:
- listener- the action listener to be notified.
 
 - 
removeActionListenerpublic void removeActionListener(java.awt.event.ActionListener listener) Removes the action listener from the list to be notified.- Parameters:
- listener-
 
 - 
setEnabledpublic void setEnabled(boolean enabled) - Overrides:
- setEnabledin class- javax.swing.JComponent
- See Also:
- Component.setEnabled(boolean)
 
 - 
setEditablepublic void setEditable(boolean state) Set the text field to be editable according to the state param.
 - 
isEditablepublic boolean isEditable() 
 - 
showAddressSpaceCombopublic void showAddressSpaceCombo(boolean showCombo) 
 - 
requestFocuspublic void requestFocus() - Overrides:
- requestFocusin class- javax.swing.JComponent
 
 - 
getAddressTextFieldprotected javax.swing.JTextField getAddressTextField() 
 - 
getAddressSpaceTextFieldprotected javax.swing.JTextField getAddressSpaceTextField() 
 
- 
 
-