Interface ExtensionPopupMenuComponent
-
- All Known Implementing Classes:
ExtensionPopupMenu
,ExtensionPopupMenuItem
,ExtensionPopupMenuItemMessageContainer
,ExtensionPopupMenuMessageContainer
,PopupContextMenuItemFactory
,PopupContextMenuItemHolder
,PopupContextTreeMenu
,PopupCopyMenu
,PopupExcludeFromProxyMenu
,PopupExcludeFromScanMenu
,PopupExcludeFromSpiderMenu
,PopupFindMenu
,PopupFlagCustomPageIndicatorMenu
,PopupFlagLoggedInIndicatorMenu
,PopupFlagLoggedOutIndicatorMenu
,PopupMenuActiveScanCustom
,PopupMenuActiveScanCustomWithContext
,PopupMenuActiveScanNode
,PopupMenuActiveScanScope
,PopupMenuActiveScanSite
,PopupMenuActiveScanURL
,PopupMenuAddAntiCSRF
,PopupMenuAddBreakHistory
,PopupMenuAddBreakSites
,PopupMenuAddSession
,PopupMenuAlert
,PopupMenuAlertDelete
,PopupMenuAlertEdit
,PopupMenuAlertSetFalsePositive
,PopupMenuAlertsRefresh
,PopupMenuCopyUrls
,PopupMenuEditBreak
,PopupMenuExportContextURLs
,PopupMenuExportSelectedURLs
,PopupMenuExportURLs
,PopupMenuFactoryAddUserFromSession
,PopupMenuFactoryAddUserFromSession.PopupMenuAddUserFromSession
,PopupMenuGenerateForm
,PopupMenuHistoryReferenceContainer
,PopupMenuHttpMessageContainer
,PopupMenuItemAlert
,PopupMenuItemContext
,PopupMenuItemContextDataDriven
,PopupMenuItemContextDataDrivenNode
,PopupMenuItemContextExclude
,PopupMenuItemContextInclude
,PopupMenuItemCopySessionToken
,PopupMenuItemExcludeFromContext
,PopupMenuItemHistoryReferenceContainer
,PopupMenuItemHttpMessageContainer
,PopupMenuItemIncludeInContext
,PopupMenuItemSiteNodeContainer
,PopupMenuItemSiteNodeContextMenuFactory
,PopupMenuItemSpiderDialog
,PopupMenuItemSpiderDialogWithContext
,PopupMenuJumpTo
,PopupMenuNote
,PopupMenuOpenUrlInBrowser
,PopupMenuParamSearch
,PopupMenuPurgeHistory
,PopupMenuPurgeSites
,PopupMenuRemove
,PopupMenuRemoveAntiCSRF
,PopupMenuRemoveSession
,PopupMenuRemoveSession
,PopupMenuResendMessage
,PopupMenuResendMessage
,PopupMenuSessionSearch
,PopupMenuSetActiveSession
,PopupMenuShowAlerts
,PopupMenuShowInHistory
,PopupMenuShowInSites
,PopupMenuSiteNodeContainer
,PopupMenuSitesRefresh
,PopupMenuTag
,PopupMenuUnsetActiveSession
,PopupPasteMenu
,PopupUserMenu
,PopupUserMenuItemHolder
,SyntaxMenu
,ViewMenu
public interface ExtensionPopupMenuComponent
A component that can be shown/handled in pop up menus (for example,MainPopupMenu
) with enhanced behaviour (compared toJMenu
s andJMenuItem
s).The menu component will be queried:
- to know if it is enable or not for the
Component
where the pop up menu is being invoked, by callingisEnableForComponent(Component)
; - to know if it is enable or not for the
MessageContainer
where the pop up menu is being invoked, by callingisEnableForMessageContainer(MessageContainer)
; - to know if its action is safe or not so it can be automatically disabled when it's not safe
and the
Control.Mode
doesn't allow potential dangerous operations, by callingisSafe()
; - its position in the pop up menu, by calling
getMenuIndex()
.
precedeWithSeparator()
andsucceedWithSeparator()
, respectively.The menu component will be notified when no longer shown (i.e. the pop up menu was dismissed) by calling
dismissed(ExtensionPopupMenuComponent)
, so it can free any resources (e.g. clean any references to UI components).- Since:
- 2.3.0
- See Also:
ExtensionPopupMenu
,ExtensionPopupMenuItem
,MainPopupMenu
,Control.Mode
,MessageContainer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
dismissed(ExtensionPopupMenuComponent selectedMenuComponent)
Called after the pop up menu in which this pop up menu component is dismissed, indicating the menu component that was selected ornull
if none.int
getMenuIndex()
Deprecated.default int
getWeight()
Indicates the relative weight of the menu item - the higher the weight the higher in the menu.boolean
isEnableForComponent(java.awt.Component invoker)
Tells whether or not the pop up menu component is enable for the giveninvoker
, therefore shown (or not) in the pop up menu.boolean
isEnableForMessageContainer(MessageContainer<?> invoker)
Tells whether or not the pop up menu component is enable for the giveninvoker
, therefore shown (or not) in the pop up menu.boolean
isSafe()
Tells whether or not the pop up menu component is safe, that is, doesn't do any potentially dangerous operations (for example, active scan a target server).boolean
precedeWithSeparator()
Deprecated.boolean
succeedWithSeparator()
Deprecated.
-
-
-
Method Detail
-
isEnableForComponent
boolean isEnableForComponent(java.awt.Component invoker)
Tells whether or not the pop up menu component is enable for the giveninvoker
, therefore shown (or not) in the pop up menu.It is responsibility of the pop up menu component to enable/disable itself in case it should be shown but shouldn't be active/enabled.
Note: Calling this method implies that the pop up menu in which this pop up menu component is, is being invoked.
- Parameters:
invoker
- the component where the pop up menu was invoked- Returns:
true
if the menu component is enable for the giveninvoker
,false
otherwise.- See Also:
isEnableForMessageContainer(MessageContainer)
-
isEnableForMessageContainer
boolean isEnableForMessageContainer(MessageContainer<?> invoker)
Tells whether or not the pop up menu component is enable for the giveninvoker
, therefore shown (or not) in the pop up menu.It is responsibility of the pop up menu component to enable/disable itself in case it should be shown but shouldn't be active/enabled.
Note: Calling this method implies that the pop up menu in which this pop up menu component is, is being invoked.
- Parameters:
invoker
- the message container where the pop up menu was invoked- Returns:
true
if the menu component is enable for the giveninvoker
,false
otherwise.- See Also:
isEnableForComponent(Component)
-
getMenuIndex
@Deprecated(since="2.15.0") int getMenuIndex()
Deprecated.Replaced by weights.
-
precedeWithSeparator
@Deprecated(since="2.15.0") boolean precedeWithSeparator()
Deprecated.Replaced by weights.
-
succeedWithSeparator
@Deprecated(since="2.15.0") boolean succeedWithSeparator()
Deprecated.Replaced by weights.
-
isSafe
boolean isSafe()
Tells whether or not the pop up menu component is safe, that is, doesn't do any potentially dangerous operations (for example, active scan a target server).The pop up menu component will be automatically disabled when it is not safe and the
Control.Mode
set doesn't allow potentially dangerous operations.- Returns:
true
if the menu component is safe,false
otherwise.- See Also:
Control.Mode
-
dismissed
void dismissed(ExtensionPopupMenuComponent selectedMenuComponent)
Called after the pop up menu in which this pop up menu component is dismissed, indicating the menu component that was selected ornull
if none.Can be used to free any resources no longer needed (e.g. references to UI components) after being shown in the pop up menu.
Note 1: Any resource needed to execute the action should only be freed in this method if the menu was not selected. If it was selected the resources should only be freed after executing the action.
Note 2: This method will not be called if this pop up menu component is not enabled for the
invoker
.- Parameters:
selectedMenuComponent
- the selected menu component ornull
if none- Since:
- 2.4.0
- See Also:
isEnableForComponent(Component)
,isEnableForMessageContainer(MessageContainer)
-
getWeight
default int getWeight()
Indicates the relative weight of the menu item - the higher the weight the higher in the menu.- Returns:
- The weight of the menu item
- Since:
- 2.15.0
-
-