Class AbstractIOSupport

    • Constructor Detail

      • AbstractIOSupport

        public AbstractIOSupport()
    • Method Detail

      • getGuiContexts

        public Set<GuiContext> getGuiContexts()
        Description copied from interface: InteractivePlugin
        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.
        Specified by:
        getGuiContexts in interface InteractivePlugin
        Returns:
        Always null
      • isInContext

        public String isInContext​(GuiContext context,
                                  Object item)
        Description copied from interface: InteractivePlugin
        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 InteractivePlugin.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.

        Specified by:
        isInContext in interface InteractivePlugin
        Parameters:
        context - The current context of the client application, it is one of the values found in set returned by InteractivePlugin.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:
        Always null
      • getShortName

        public String getShortName()
        A default implementation to maintain backwards compatibility. Plug-ins that want to return a different short name should override this method.
        Specified by:
        getShortName in interface IOSupport
        Returns:
        The name of the plugin (eg. PluginDefinition.getName())
        Since:
        2.16
      • performIO

        protected abstract String performIO​(DbControl dc,
                                            ProgressReporter progress)
                                     throws IOException
        Perform the IO operation.
        Parameters:
        dc - A DbControl that can be used by the subclass
        progress - An optional progress reporter
        Returns:
        A message that is returned as to the external program executor
        Throws:
        IOException
      • getExecutor

        protected ExternalProgramExecutor getExecutor()
        Get the external program executor that invoked the plug-in.