Package ghidra.plugins.fsbrowser
Class FSBActionContext
java.lang.Object
docking.DefaultActionContext
ghidra.plugins.fsbrowser.FSBActionContext
- All Implemented Interfaces:
ActionContext
FSBComponentProvider
context for actions-
Constructor Summary
ConstructorDescriptionFSBActionContext
(FSBComponentProvider provider, List<FSBNode> selectedNodes, MouseEvent event, GTree gTree) Creates a newFileSystemBrowserPlugin
-specific action context. -
Method Summary
Modifier and TypeMethodDescriptionReturns the object that was included by the ComponentProvider when this context was created.Returns the FSRL of the currently selected file nodeReturns a list of FSRLs of the currently selected file nodes in the tree.getFSRL
(boolean dirsOk) Returns theFSRL
of the currently selected item, as long as it conforms to the dirsOk requirement.getFSRLs
(boolean dirsOk) Returns a list of FSRLs of the currently selected nodes in the tree.Returns the FSRL of the currently selected item, if it is a 'loadable' item.int
Returns the number of selected nodes in the tree.Returns the currently selected tree nodeReturns a list of the currently selected tree nodes.Returns the component that is the target of this context.getTree()
Gets theFileSystemBrowserPlugin
provider's tree.boolean
boolean
Returns true if there are selected nodes in the browser tree.boolean
isBusy()
Returns true if the GTree is busyboolean
Returns true if the currently selected items are all directory itemsboolean
notBusy()
Returns true if the GTree is not busyMethods inherited from class docking.DefaultActionContext
getEventClickModifiers, getMouseEvent, getSourceObject, hasAnyEventClickModifiers, setContextObject, setEventClickModifiers, setMouseEvent, setSourceComponent, setSourceObject, toString
-
Constructor Details
-
FSBActionContext
public FSBActionContext(FSBComponentProvider provider, List<FSBNode> selectedNodes, MouseEvent event, GTree gTree) Creates a newFileSystemBrowserPlugin
-specific action context.- Parameters:
provider
- the ComponentProvider that generated this context.selectedNodes
- selected nodes in the treeevent
- MouseEvent that caused the update, or nullgTree
-FileSystemBrowserPlugin
provider tree.
-
-
Method Details
-
getComponentProvider
- Specified by:
getComponentProvider
in interfaceActionContext
- Overrides:
getComponentProvider
in classDefaultActionContext
-
getContextObject
Description copied from interface:ActionContext
Returns the object that was included by the ComponentProvider when this context was created.- Specified by:
getContextObject
in interfaceActionContext
- Overrides:
getContextObject
in classDefaultActionContext
- Returns:
- the object that was included by the ComponentProvider when this context was created.
-
getSourceComponent
Description copied from interface:ActionContext
Returns the component that is the target of this context. This value should not change whether the context is triggered by a key binding or mouse event.- Specified by:
getSourceComponent
in interfaceActionContext
- Overrides:
getSourceComponent
in classDefaultActionContext
- Returns:
- the component; may be null
-
notBusy
public boolean notBusy()Returns true if the GTree is not busy- Returns:
- boolean true if GTree is not busy
-
isBusy
public boolean isBusy()Returns true if the GTree is busy- Returns:
- boolean true if the GTree is busy
-
getTree
Gets theFileSystemBrowserPlugin
provider's tree.- Returns:
- The
FileSystemBrowserPlugin
provider's tree.
-
hasSelectedNodes
public boolean hasSelectedNodes()Returns true if there are selected nodes in the browser tree.- Returns:
- boolean true if there are selected nodes in the browser tree
-
getSelectedNodes
Returns a list of the currently selected tree nodes.- Returns:
- list of currently selected tree nodes
-
getFSRL
Returns theFSRL
of the currently selected item, as long as it conforms to the dirsOk requirement.- Parameters:
dirsOk
- boolean flag, if true the selected item can be either a file or directory element, if false, it must be a file or the root of a file system that has a container file- Returns:
- FSRL of the single selected item, null if no items selected or more than 1 item selected
-
isSelectedAllDirs
public boolean isSelectedAllDirs()Returns true if the currently selected items are all directory items- Returns:
- boolean true if the currently selected items are all directory items
-
getSelectedNode
Returns the currently selected tree node- Returns:
- the currently selected tree node, or null if no nodes or more than 1 node is selected
-
getSelectedCount
public int getSelectedCount()Returns the number of selected nodes in the tree.- Returns:
- returns the number of selected nodes in the tree.
-
getFSRLs
Returns a list of FSRLs of the currently selected nodes in the tree.- Parameters:
dirsOk
- boolean flag, if true the selected items can be either a file or directory element, if false, it must be a file or the root of a file system that has a container file before being included in the resulting list- Returns:
- list of FSRLs of the currently selected items, maybe empty but never null
-
getFileFSRLs
Returns a list of FSRLs of the currently selected file nodes in the tree.- Returns:
- list of FSRLs of the currently selected file items, maybe empty but never null
-
getFileFSRL
Returns the FSRL of the currently selected file node- Returns:
- FSRL of the currently selected file, or null if not file or more than 1 selected
-
getLoadableFSRL
Returns the FSRL of the currently selected item, if it is a 'loadable' item.- Returns:
- FSRL of the currently selected loadable item, or null if nothing selected or more than 1 selected
-
hasSelectedLinkedNodes
public boolean hasSelectedLinkedNodes()
-