Package ghidra.plugins.fsbrowser

# Class FSBComponentProvider

java.lang.Object
docking.ComponentProvider
ghidra.framework.plugintool.ComponentProviderAdapter
ghidra.plugins.fsbrowser.FSBComponentProvider

All Implemented Interfaces:
  `ActionContextProvider`, `PopupActionProvider`, `FileSystemEventListener`, `ProjectIndexService.ProjectIndexListener`, `HelpDescriptor`

public class FSBComponentProvider extends ComponentProviderAdapter implements FileSystemEventListener, PopupActionProvider, ProjectIndexService.ProjectIndexListener
Plugin component provider for the `FileSystemBrowserPlugin`.

An instance of this class is created for each file system browser window (w/tree).

See the `FSBFileHandler` interface for how to add actions to this component.

- ## Field Summary

  ### Fields inherited from class ghidra.framework.plugintool.ComponentProviderAdapter

  `tool`

  ### Fields inherited from class docking.ComponentProvider

  `DEFAULT_WINDOW_GROUP, dockingTool`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FSBComponentProvider(FileSystemBrowserPlugin plugin, RefdFile rootDir)`
  Creates a new `FSBComponentProvider` instance, taking ownership of the passed-in `fsRef`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterAddedToTool()`
  `void`
  `componentHidden()`
  Notifies the provider that the component is being hidden.
  `boolean`
  `ensureFileAccessable(FSRL fsrl, FSBNode node, TaskMonitor monitor)`
  `FSBActionContext`
  `getActionContext(MouseEvent event)`
  Returns the context object which corresponds to the area of focus within this provider's component.
  `JComponent`
  `getComponent()`
  Returns the component to be displayed
  `WindowPosition`
  `getDefaultWindowPosition()`
  The initial `WindowPosition` of this provider.
  `GTree`
  `getGTree()`
  `String`
  `getName()`
  Returns the name of this provider
  `FileSystemBrowserPlugin`
  `getPlugin()`
  `List<DockingActionIf>`
  `getPopupActions(Tool tool, ActionContext context)`
  Provides notification that the popup menu is about to be displayed and allows a set of temporary actions to be included in the popup menu.
  `ProjectIndexService`
  `getProjectIndex()`
  `void`
  `indexUpdated()`
  `void`
  `onFilesystemClose(GFileSystem fs)`
  Called by GFilesystem's `Closeable.close()`, before any destructive changes are made to the filesystem instance.
  `void`
  `onFilesystemRefChange(GFileSystem fs, FileSystemRefManager refManager)`
  Called by `FileSystemRefManager` when a new `FileSystemRef` is created or released.
  `boolean`
  `openFileSystem(FSBNode node, boolean nested)`
  `void`
  `runTask(MonitoredRunnable runnableTask)`
  `void`
  `setProject(Project project)`

  ### Methods inherited from class ghidra.framework.plugintool.ComponentProviderAdapter

  `getTool`

  ### Methods inherited from class docking.ComponentProvider

  `addLocalAction, addToTool, addToToolbar, adjustFontSize, canBeParent, closeComponent, componentActivated, componentDeactived, componentMadeDisplayable, componentShown, contextChanged, createContext, createContext, createContext, getBaseIcon, getContextType, getHelpInfo, getHelpLocation, getHelpObject, getIcon, getInstanceID, getIntraGroupPosition, getLocalActions, getMappedName, getMappedOwner, getOwner, getSubTitle, getTabText, getTitle, getWindowGroup, getWindowSubMenuName, initializeInstanceID, isActive, isFocusedProvider, isInTool, isShowing, isSnapshot, isTransient, isVisible, registerAdjustableFontId, registerProviderNameOwnerChange, removeAllLocalActions, removeFromTool, removeLocalAction, requestFocus, resetFontSize, setCustomSubTitle, setCustomTabText, setCustomTitle, setDefaultFocusComponent, setDefaultWindowPosition, setHelpLocation, setIcon, setIntraGroupPosition, setKeyBinding, setSubTitle, setTabText, setTitle, setTransient, setVisible, setWindowGroup, setWindowMenuGroup, toFront, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### FSBComponentProvider

    public FSBComponentProvider(FileSystemBrowserPlugin plugin, RefdFile rootDir)
    Creates a new `FSBComponentProvider` instance, taking ownership of the passed-in `fsRef`.
    Parameters:
      `plugin` - parent plugin
      `rootDir` - `FileSystemRef` to a `GFileSystem` and a `GFile` root

- ## Method Details

  - ### getPlugin

    public FileSystemBrowserPlugin getPlugin()

  - ### getGTree

    public GTree getGTree()
    Returns:
      this provider's GTree.

  - ### getProjectIndex

    public ProjectIndexService getProjectIndex()

  - ### componentHidden

    public void componentHidden()
    Description copied from class: `ComponentProvider`
    Notifies the provider that the component is being hidden. This happens when the provider is being closed.
    Overrides:
      `componentHidden` in class `ComponentProvider`

  - ### getPopupActions

    public List<DockingActionIf> getPopupActions(Tool tool, ActionContext context)
    Description copied from interface: `PopupActionProvider`
    Provides notification that the popup menu is about to be displayed and allows a set of temporary actions to be included in the popup menu. Actions returned will be included in the menu if they have a valid popup menu path and respond true to the `DockingActionIf.isValidContext(ActionContext)` call.
    Specified by:
      `getPopupActions` in interface `PopupActionProvider`
    Parameters:
      `tool` - the tool requesting the actions
      `context` - the ActionContext
    Returns:
      list of temporary popup actions; return null if there are no popup actions

  - ### afterAddedToTool

    public void afterAddedToTool()

  - ### setProject

    public void setProject(Project project)

  - ### indexUpdated

    public void indexUpdated()
    Specified by:
      `indexUpdated` in interface `ProjectIndexService.ProjectIndexListener`

  - ### onFilesystemClose

    public void onFilesystemClose(GFileSystem fs)
    Description copied from interface: `FileSystemEventListener`
    Called by GFilesystem's `Closeable.close()`, before any destructive changes are made to the filesystem instance.
    Specified by:
      `onFilesystemClose` in interface `FileSystemEventListener`
    Parameters:
      `fs` - `GFileSystem` that is about to be closed.

  - ### onFilesystemRefChange

    public void onFilesystemRefChange(GFileSystem fs, FileSystemRefManager refManager)
    Description copied from interface: `FileSystemEventListener`
    Called by `FileSystemRefManager` when a new `FileSystemRef` is created or released.
    Specified by:
      `onFilesystemRefChange` in interface `FileSystemEventListener`
    Parameters:
      `fs` - `GFileSystem` that is being updated.
      `refManager` - `FileSystemRefManager` that is tracking the modified GFileSystem.

  - ### runTask

    public void runTask(MonitoredRunnable runnableTask)

  - ### getActionContext

    public FSBActionContext getActionContext(MouseEvent event)
    Description copied from class: `ComponentProvider`
    Returns the context object which corresponds to the area of focus within this provider's component. Null is returned when there is no context.
    Specified by:
      `getActionContext` in interface `ActionContextProvider`
    Overrides:
      `getActionContext` in class `ComponentProvider`
    Parameters:
      `event` - popup event which corresponds to this request. May be null for key-stroke or other non-mouse event.

  - ### getComponent

    public JComponent getComponent()
    Description copied from class: `ComponentProvider`
    Returns the component to be displayed
    Specified by:
      `getComponent` in class `ComponentProvider`
    Returns:
      the component to be displayed

  - ### getName

    public String getName()
    Description copied from class: `ComponentProvider`
    Returns the name of this provider
    Overrides:
      `getName` in class `ComponentProvider`
    Returns:
      the name of this provider

  - ### getDefaultWindowPosition

    public WindowPosition getDefaultWindowPosition()
    Description copied from class: `ComponentProvider`
    The initial `WindowPosition` of this provider. If a `window group` is provided, then this position is relative to that provider. Otherwise, this position is relative to the tool window.
    Overrides:
      `getDefaultWindowPosition` in class `ComponentProvider`
    Returns:
      The initial `WindowPosition` of this provider.

  - ### ensureFileAccessable

    public boolean ensureFileAccessable(FSRL fsrl, FSBNode node, TaskMonitor monitor)

  - ### openFileSystem

    public boolean openFileSystem(FSBNode node, boolean nested)