Package ghidra.app.util.datatype
Class CategoryPathSelectionEditor
java.lang.Object
javax.swing.AbstractCellEditor
ghidra.app.util.datatype.CategoryPathSelectionEditor
- All Implemented Interfaces:
Serializable,CellEditor
An editor that is used to show the
DropDownSelectionTextField for the entering of
category paths by name and offers the user of a completion window. This editor also provides a
browse button that when pressed will show a data type tree so that the user may browse a tree
of known category paths.
Stand Alone Usage
In order to use this component directly you need to call getEditorComponent(). This
will give you a Component for editing.
In order to know when changes are made to the component you need to add a DocumentListener
via the addDocumentListener(DocumentListener) method. The added listener will be
notified as the user enters text into the editor's text field.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList -
Constructor Summary
ConstructorsConstructorDescriptionCategoryPathSelectionEditor(ServiceProvider serviceProvider) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDocumentListener(DocumentListener listener) Adds a document listener to the text field editing component of this editor so that users can be notified when the text contents of the editor change.voidaddFocusListener(FocusListener listener) Add the provided FocusListener to the selectionField.protected DropDownSelectionTextField<CategoryPath> createDropDownSelectionTextField(ghidra.app.util.datatype.CategoryPathSelectionEditor.CategoryPathDropDownSelectionDataModel model) The browse button which opens a menu with the Category Path collection from the data manager.Retrieve the value in the cell.If a path was selected from the drop-down list, it is already well-formed and cannot be null.Returns the text value of the editor's text field.Retrieve the drop-down text field that holds the category path collection.Returns the component that allows the user to edit.Returns the direction of the user triggered navigation; null if the user did not trigger navigation out of this component.booleanDetermine whether the Category Path Text Field is enabled.voidremoveDocumentListener(DocumentListener listener) Removes a previously added document listener.voidremoveFocusListener(FocusListener listener) Remove the provided FocusListener from the selectionField.voidPlace focus on the selectionField.voidSets the value to be edited on this cell editor.voidSets the cell editor value as the entered String text.voidsetConsumeEnterKeyPress(boolean consume) Sets whether this editor should consumer Enter key pressesvoidSets the initially selected node in the data type tree that the user can choose to show.voidsetEnabled(boolean createStructureByName) Enable or disable the Category Path Text Field.voidsetTabCommitsEdit(boolean doesCommit) Toggle Tab key commits an edit.Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
-
Constructor Details
-
CategoryPathSelectionEditor
Creates a new instance.- Parameters:
serviceProvider-ServiceProvider
-
-
Method Details
-
setConsumeEnterKeyPress
public void setConsumeEnterKeyPress(boolean consume) Sets whether this editor should consumer Enter key presses- Parameters:
consume- true to consume- See Also:
-
createDropDownSelectionTextField
protected DropDownSelectionTextField<CategoryPath> createDropDownSelectionTextField(ghidra.app.util.datatype.CategoryPathSelectionEditor.CategoryPathDropDownSelectionDataModel model) -
getCellEditorValue
Retrieve the value in the cell.- Returns:
- categoryPath of the selected value from the drop-down
-
getCellEditorValueAsCategoryPath
If a path was selected from the drop-down list, it is already well-formed and cannot be null.- Returns:
- the selected category path as CategoryPath
-
getCellEditorValueAsText
Returns the text value of the editor's text field.- Returns:
- the text value of the editor's text field.
-
getEditorComponent
Returns the component that allows the user to edit.- Returns:
- the component that allows the user to edit.
-
getDropDownTextField
Retrieve the drop-down text field that holds the category path collection.- Returns:
- CategoryPath drop-down selection text field object
-
getBrowseButton
The browse button which opens a menu with the Category Path collection from the data manager.- Returns:
- browseButton
-
setDefaultSelectedTreePath
Sets the initially selected node in the data type tree that the user can choose to show.- Parameters:
path- The path to set
-
requestFocus
public void requestFocus()Place focus on the selectionField. -
setCellEditorValueAsText
Sets the cell editor value as the entered String text.- Parameters:
text- String input
-
setCellEditorValue
Sets the value to be edited on this cell editor.- Parameters:
path- The data type which is to be edited.
-
addDocumentListener
Adds a document listener to the text field editing component of this editor so that users can be notified when the text contents of the editor change.- Parameters:
listener- the listener to add.
-
removeDocumentListener
Removes a previously added document listener.- Parameters:
listener- the listener to remove.
-
addFocusListener
Add the provided FocusListener to the selectionField.- Parameters:
listener- FocusListener
-
removeFocusListener
Remove the provided FocusListener from the selectionField.- Parameters:
listener- FocusListener
-
setTabCommitsEdit
public void setTabCommitsEdit(boolean doesCommit) Toggle Tab key commits an edit. Sets the traversal key enabled field of the selectionField.- Parameters:
doesCommit- Boolean
-
setEnabled
public void setEnabled(boolean createStructureByName) Enable or disable the Category Path Text Field.- Parameters:
createStructureByName- Boolean
-
isEnabled
public boolean isEnabled()Determine whether the Category Path Text Field is enabled.- Returns:
- isEnabled boolean
-