Package com.lowagie.toolbox
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
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 Summary
FieldsModifier and TypeFieldDescriptionprotected ArrayList
<AbstractArgument> The list of arguments needed by the tool.private Desktop
awtdesktopprotected JInternalFrame
The internal frame of the tool.static final int
a menu optionstatic final int
a menu optionstatic final int
a menu optionstatic final int
a menu optionprivate JMenuBar
protected int
Execute menu optionsAn array with the plugin_versions of the tool. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected static void
addVersion
(String version) Add the version of the plugin to the plugin_versions array.protected abstract void
Creates the internal frame.abstract void
execute()
Executes the tool (in most cases this generates a PDF file).private String
getArgs()
Gets the current arguments of the tool.Gets the arguments.protected abstract File
Gets the PDF file that should be generated (or null if the output isn't a PDF file).Returns the internal frame.Gets the menubar.getUsage()
Gets the usage of the tool.Gets the value of a given argument.void
setArguments
(ArrayList<AbstractArgument> arguments) Sets the arguments.void
setInternalFrame
(JInternalFrame internalFrame) Sets the internal frame.void
setMainArguments
(String[] args) Sets the arguments.void
setMenubar
(JMenuBar menubar) abstract void
Indicates that the value of an argument has changed.
-
Field Details
-
MENU_EXECUTE
public static final int MENU_EXECUTEa menu option- See Also:
-
MENU_EXECUTE_SHOW
public static final int MENU_EXECUTE_SHOWa menu option- See Also:
-
MENU_EXECUTE_PRINT
public static final int MENU_EXECUTE_PRINTa menu option- See Also:
-
MENU_EXECUTE_PRINT_SILENT
public static final int MENU_EXECUTE_PRINT_SILENTa menu option- See Also:
-
versionsarray
An array with the plugin_versions of the tool. -
internalFrame
The internal frame of the tool. -
arguments
The list of arguments needed by the tool. -
awtdesktop
awtdesktop
-
-
Constructor Details
-
AbstractTool
public AbstractTool()AbstractTool
-
-
Method Details
-
addVersion
Add the version of the plugin to the plugin_versions array.- Parameters:
version
- the version to add.
-
setMainArguments
Sets the arguments.- Parameters:
args
- the arguments as String-array.
-
getArguments
Gets the arguments.- Returns:
- Returns the arguments.
-
setArguments
Sets the arguments.- Parameters:
arguments
- The arguments to set.
-
getValue
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
Returns the internal frame. Creates one if it's null.- Returns:
- Returns the internalFrame.
-
setInternalFrame
Sets the internal frame.- Parameters:
internalFrame
- The internalFrame to set.
-
getMenubar
Gets the menubar.- Returns:
- a menubar for this tool
-
setMenubar
-
getUsage
Gets the usage of the tool.- Returns:
- a String describing how to use the tool.
-
getArgs
Gets the current arguments of the tool.- Returns:
- a String with the list of arguments and their values.
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
evt
- ActionEvent- See Also:
-
getDestPathPDF
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
Indicates that the value of an argument has changed.- Parameters:
arg
- the argument that has changed
-