Class MarkNodeAsFavoriteHooker

java.lang.Object
net.datenwerke.rs.dashboard.client.dashboard.hookers.MarkNodeAsFavoriteHooker
All Implemented Interfaces:
Hook, TsFavoriteMenuHook

public class MarkNodeAsFavoriteHooker extends Object implements TsFavoriteMenuHook
  • Constructor Details

    • MarkNodeAsFavoriteHooker

      public MarkNodeAsFavoriteHooker(DashboardDao dashboardDao)
  • Method Details

    • addContextMenuEntries

      public boolean addContextMenuEntries(Menu menu, List<AbstractTsDiskNodeDto> items, ItemSelector selector, TsDiskMainComponent mainComponent)
      Specified by:
      addContextMenuEntries in interface TsFavoriteMenuHook
    • createToolbarButton

      public DwTextButton createToolbarButton(ToolbarService toolbarService)
      Creates a toolbar button for adding items to favorites. This button is styled specifically for the TsDiskMainComponent menu.
      Specified by:
      createToolbarButton in interface TsFavoriteMenuHook
      Parameters:
      toolbarService - the toolbar service used to create the button
      Returns:
      a configured DwTextButton with star icon and "Add to Favorites" text
    • configureToolbarButton

      public boolean configureToolbarButton(DwTextButton button, List<AbstractTsDiskNodeDto> items, TsDiskMainComponent mainComponent)
      Configures the toolbar button behavior for favorite functionality. Only enables the button when exactly one non-root item is selected.
      Specified by:
      configureToolbarButton in interface TsFavoriteMenuHook
      Parameters:
      button - the button to configure
      items - the list of selected items
      mainComponent - the main component reference
      Returns:
      true if the button was successfully configured, false if configuration was skipped due to invalid selection (no items, multiple items, or root item selected)
    • removeHandlerRegistration

      public void removeHandlerRegistration()
      Removes any registered event handlers to prevent memory leaks. Should be called when the button is no longer in use or being reconfigured.
      Specified by:
      removeHandlerRegistration in interface TsFavoriteMenuHook