Interface ExtensionPopupMenuComponent

    • Method Detail

      • isEnableForComponent

        boolean isEnableForComponent​(java.awt.Component invoker)
        Tells whether or not the pop up menu component is enable for the given invoker, 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 given invoker, false otherwise.
        See Also:
        isEnableForMessageContainer(MessageContainer)
      • isEnableForMessageContainer

        boolean isEnableForMessageContainer​(MessageContainer<?> invoker)
        Tells whether or not the pop up menu component is enable for the given invoker, 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 given invoker, 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 or null 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 or null 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