Interface InteractivePlugin

    • Method Detail

      • getGuiContexts

        Set<GuiContext> getGuiContexts()
        Get a set containing all items that the plugin handles. Ie. if the plugin imports reporters, return a set containing Item.REPORTER. This information is used by client applications to put the plugin in the proper place in the user interface.
        Returns:
        A Set containing Item:s, or null if the plugin is not concerned about items
      • isInContext

        String isInContext​(GuiContext context,
                           Object item)
        Check if the plugin can be used on the specified object. The item is either a BasicItem or BasicData object, or null if called from a list context. A client application should only call this method for contexts matching one of the contexts in the set returned by the getGuiContexts() method. For GuiContext.Type.ITEM contexts an item of the correct type should be passed as a parameter.

        The plug-in can response with a null value indicating success, a warning-level message or throw an exception to indicate an error-level message. Client application should normally only show error-level messages to users, unless the user has requested to see warning messages.

        NOTE! Before BASE 2.4 all messages were treated as error-level messages.

        Parameters:
        context - The current context of the client application, it is one of the values found in set returned by getGuiContexts()
        item - The currently active item, it's type should match the GuiContext.getItem() type, or null if the context is a list context
        Returns:
        Null if the plugin can use that item, or a warning-level message explaining why the plugin can't be used
        Throws:
        RuntimeException - With an error-leve message explaining why the plug-in can't be used
      • getRequestInformation

        RequestInformation getRequestInformation​(GuiContext context,
                                                 String command)
                                          throws BaseException
        This method will return the RequestInformation for a given command, i.e. the list of parameters and some nice help text.
        Parameters:
        context - The current context of the client application, it is one of the values found in set returned by getGuiContexts()
        command - The command
        Returns:
        The RequestInformation for the command
        Throws:
        BaseException - if there is an error
      • configure

        void configure​(GuiContext context,
                       Request request,
                       Response response)
        Configure the plugin. Hopefully the client is supplying values for the parameters specified by getRequestInformation(GuiContext, String).
        Parameters:
        context - The current context of the client application, it is one of the values found in set returned by getGuiContexts()
        request - Request object with the command and parameters
        response - Response object in for the plugin to response through