Class AbstractTool

java.lang.Object
com.lowagie.toolbox.AbstractTool
All Implemented Interfaces:
ActionListener, EventListener
Direct Known Subclasses:
Add3D, Bookmarks2XML, Burst, CompressDecompressPageContent, Concat, ConcatN, Decrypt, Divide, DvdCover, Encrypt, ExtractAttachments, Handouts, HtmlBookmarks, ImageXRefViewer, InspectPDF, Normalize, NUp, PhotoAlbum, RemoveLaunchApplication, ReversePages, SelectedPages, Split, Txt2Pdf, WatermarkerTool, XML2Bookmarks

public abstract class AbstractTool extends Object implements ActionListener
Every iText tool has to extend this abstract class.
Since:
2.1.1 (imported from itexttoolbox project)
Version:
$Id: AbstractTool.java 3276 2008-04-19 00:32:58Z xlv $
  • Field Details

    • versionsarray

      public static ArrayList<String> versionsarray
      An array with the plugin_versions of the tool.
    • internalFrame

      protected JInternalFrame internalFrame
      The internal frame of the tool.
    • arguments

      protected ArrayList<AbstractArgument> arguments
      The list of arguments needed by the tool.
    • awtdesktop

      private Desktop awtdesktop
      awtdesktop
  • Constructor Details

    • AbstractTool

      public AbstractTool()
      AbstractTool
  • Method Details

    • addVersion

      protected static void addVersion(String version)
      Add the version of the plugin to the plugin_versions array.
      Parameters:
      version - the version to add.
    • setMainArguments

      public void setMainArguments(String[] args)
      Sets the arguments.
      Parameters:
      args - the arguments as String-array.
    • getArguments

      public ArrayList<AbstractArgument> getArguments()
      Gets the arguments.
      Returns:
      Returns the arguments.
    • setArguments

      public void setArguments(ArrayList<AbstractArgument> arguments)
      Sets the arguments.
      Parameters:
      arguments - The arguments to set.
    • getValue

      public Object getValue(String name) throws InstantiationException
      Gets the value of a given argument.
      Parameters:
      name - the name of the argument
      Returns:
      the value of an argument as an Object.
      Throws:
      InstantiationException - on error
    • getInternalFrame

      public JInternalFrame getInternalFrame()
      Returns the internal frame. Creates one if it's null.
      Returns:
      Returns the internalFrame.
    • setInternalFrame

      public void setInternalFrame(JInternalFrame internalFrame)
      Sets the internal frame.
      Parameters:
      internalFrame - The internalFrame to set.
    • getMenubar

      public JMenuBar getMenubar()
      Gets the menubar.
      Returns:
      a menubar for this tool
    • setMenubar

      public void setMenubar(JMenuBar menubar)
    • getUsage

      public String getUsage()
      Gets the usage of the tool.
      Returns:
      a String describing how to use the tool.
    • getArgs

      private String getArgs()
      Gets the current arguments of the tool.
      Returns:
      a String with the list of arguments and their values.
    • actionPerformed

      public void actionPerformed(ActionEvent evt)
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      evt - ActionEvent
      See Also:
    • getDestPathPDF

      protected abstract File getDestPathPDF() throws InstantiationException
      Gets the PDF file that should be generated (or null if the output isn't a PDF file).
      Returns:
      the PDF file that should be generated
      Throws:
      InstantiationException - on error
    • createFrame

      protected abstract void createFrame()
      Creates the internal frame.
    • execute

      public abstract void execute()
      Executes the tool (in most cases this generates a PDF file).
    • valueHasChanged

      public abstract void valueHasChanged(AbstractArgument arg)
      Indicates that the value of an argument has changed.
      Parameters:
      arg - the argument that has changed