Class MenuRenameHooker
java.lang.Object
net.datenwerke.rs.tsreportarea.client.tsreportarea.hookers.MenuRenameHooker
- All Implemented Interfaces:
Hook,TsFavoriteMenuHook
-
Constructor Summary
ConstructorsConstructorDescriptionMenuRenameHooker(TsDiskTreeManagerDao treeManagerDao, TeamSpaceUIService teamSpaceService, ToolbarService toolbarService) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddContextMenuEntries(Menu menu, List<AbstractTsDiskNodeDto> items, ItemSelector selector, TsDiskMainComponent mainComponent) booleanconfigureToolbarButton(DwTextButton renameBtn, List<AbstractTsDiskNodeDto> items, TsDiskMainComponent mainComponent) Configures the rename toolbar button based on current selection and permissions.createToolbarButton(ToolbarService toolbarService) Creates a toolbar button for renaming functionality.voidRemoves any registered event handlers to prevent memory leaks.
-
Constructor Details
-
MenuRenameHooker
public MenuRenameHooker(TsDiskTreeManagerDao treeManagerDao, TeamSpaceUIService teamSpaceService, ToolbarService toolbarService)
-
-
Method Details
-
addContextMenuEntries
public boolean addContextMenuEntries(Menu menu, List<AbstractTsDiskNodeDto> items, ItemSelector selector, TsDiskMainComponent mainComponent) - Specified by:
addContextMenuEntriesin interfaceTsFavoriteMenuHook
-
createToolbarButton
Creates a toolbar button for renaming functionality.- Specified by:
createToolbarButtonin interfaceTsFavoriteMenuHook- Parameters:
toolbarService- the toolbar service used to create the button- Returns:
- a configured DwTextButton with edit icon and rename text, styled for menu button appearance
-
removeHandlerRegistration
public void removeHandlerRegistration()Removes any registered event handlers to prevent memory leaks. Safely handles null handlerRegistration references.- Specified by:
removeHandlerRegistrationin interfaceTsFavoriteMenuHook
-
configureToolbarButton
public boolean configureToolbarButton(DwTextButton renameBtn, List<AbstractTsDiskNodeDto> items, TsDiskMainComponent mainComponent) Configures the rename toolbar button based on current selection and permissions.- Specified by:
configureToolbarButtonin interfaceTsFavoriteMenuHook- Parameters:
renameBtn- the button to configureitems- the list of selected disk nodesmainComponent- the main component containing context information- Returns:
- true if the button was successfully configured and enabled, false if configuration failed due to invalid selection or permissions
- Throws:
NullPointerException- if renameBtn or mainComponent parameters are null
-