Class Registry

java.lang.Object
de.julianweinelt.datacat.dbx.api.Registry

public class Registry extends Object
The Registry class manages the core functionality of the DBX plugin framework, including:
  • Plugin registration and lifecycle
  • Custom event handling and listener management

It acts as a centralized manager and dispatcher, handling all dynamic components within the plugin environment.

  • Constructor Details

    • Registry

      protected Registry(DbxAPI api)
  • Method Details

    • setMainFrame

      @Internal public void setMainFrame(JFrame mainFrame)
    • instance

      public static Registry instance()
    • getEventAmount

      public int getEventAmount()
    • registerEvent

      public void registerEvent(DbxPlugin plugin, String eventName)
      Registers a single event name for a given plugin.
      Parameters:
      plugin - the plugin registering the event
      eventName - the name of the event
    • registerEvents

      public void registerEvents(DbxPlugin plugin, String... eventNames)
      Registers multiple event names for a given plugin.
      Parameters:
      plugin - the plugin registering the events
      eventNames - the names of the events
    • registerListener

      public void registerListener(Object listener, DbxPlugin plugin)
      Registers all listener methods annotated with Subscribe in the given listener object.
      Parameters:
      listener - the listener instance containing subscribed methods
      plugin - the plugin registering the listener
    • callEvent

      public void callEvent(Event event)
      Calls a specific event and dispatches it to all registered listeners for the event's name, in priority order.
      Parameters:
      event - the event to dispatch
    • addPlugin

      public void addPlugin(DbxPlugin plugin)
      Adds a plugin to the internal registry.
      Parameters:
      plugin - the plugin to register
    • getPlugin

      public DbxPlugin getPlugin(String name)
      Retrieves a plugin by its name.
      Parameters:
      name - the name of the plugin
      Returns:
      the DbxPlugin instance, or null if not found
    • removePlugin

      public void removePlugin(String name)
      Removes a plugin and all its associated event registrations.
      Parameters:
      name - the name of the plugin to remove
    • removePlugin

      public void removePlugin(DbxPlugin plugin)
      Removes a plugin and all its associated event registrations.
      Parameters:
      plugin - The DbxPlugin instance to remove
    • registerTheme

      public void registerTheme(Theme theme)
      Registers a Theme object as a new editor theme.
      Parameters:
      theme - The theme object containing all important information
    • getTheme

      public Theme getTheme(String name)
    • themeData

      public Map<String,String> themeData()
      Gets an internal format for all installed themes to be used in the editor.
      Returns:
      A Map object containing the unlocalized name of the theme as the key and the defining plugin as the value