Package ghidra.app.util.viewer.util

# Class OpenCloseManager

java.lang.Object
ghidra.app.util.viewer.util.OpenCloseManager

public class OpenCloseManager extends Object
Manages the open/close state of structures and arrays at specific addresses.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OpenCloseManager()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addChangeListener(ChangeListener l)`
  Adds a change listener to be notified when a location is open or closed.
  `void`
  `closeAllData(Data data, TaskMonitor monitor)`
  `void`
  `closeAllData(Program program, AddressSetView addresses, TaskMonitor monitor)`
  `void`
  `closeData(Data data)`
  Marks the given data as open.
  `int`
  `getOpenIndex(Address address, int[] path)`
  Returns the index of the component that is open at the given address.
  `boolean`
  `isOpen(Address address)`
  Tests if the data at the given address is open
  `boolean`
  `isOpen(Address address, int[] path)`
  Test is the data at the given address and component path is open
  `boolean`
  `isOpen(Data data)`
  `void`
  `openAllData(Data data, TaskMonitor monitor)`
  `void`
  `openAllData(Program program, AddressSetView addresses, TaskMonitor monitor)`
  `boolean`
  `openData(Data data)`
  Marks the given data as open.
  `void`
  `removeChangeListener(ChangeListener l)`
  Removes the listener.
  `void`
  `toggleOpen(Data data)`

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

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

- ## Constructor Details

  - ### OpenCloseManager

    public OpenCloseManager()

- ## Method Details

  - ### openData

    public boolean openData(Data data)
    Marks the given data as open. This method notifies listeners of changes.
    Parameters:
      `data` - The data to open.
    Returns:
      true if the data location was opened (false if already open or can't be opened)

  - ### closeData

    public void closeData(Data data)
    Marks the given data as open. This method notifies listeners of changes.
    Parameters:
      `data` - The data to open.

  - ### isOpen

    public boolean isOpen(Address address)
    Tests if the data at the given address is open
    Parameters:
      `address` - the address to test if open

  - ### isOpen

    public boolean isOpen(Address address, int[] path)
    Test is the data at the given address and component path is open
    Parameters:
      `address` - the address to test
      `path` - the component path to test.

  - ### getOpenIndex

    public int getOpenIndex(Address address, int[] path)
    Returns the index of the component that is open at the given address.
    Parameters:
      `address` - the address to find the open index.
      `path` - the component path.

  - ### isOpen

    public boolean isOpen(Data data)

  - ### toggleOpen

    public void toggleOpen(Data data)

  - ### openAllData

    public void openAllData(Program program, AddressSetView addresses, TaskMonitor monitor)

  - ### openAllData

    public void openAllData(Data data, TaskMonitor monitor)

  - ### closeAllData

    public void closeAllData(Program program, AddressSetView addresses, TaskMonitor monitor)

  - ### closeAllData

    public void closeAllData(Data data, TaskMonitor monitor)

  - ### addChangeListener

    public void addChangeListener(ChangeListener l)
    Adds a change listener to be notified when a location is open or closed.
    Parameters:
      `l` - the listener to be notified.

  - ### removeChangeListener

    public void removeChangeListener(ChangeListener l)
    Removes the listener.
    Parameters:
      `l` - the listener to remove.