mckay.utilities.gui.templates
Interface ListInputParser

All Known Implementing Classes:
ListInputTextParser

public interface ListInputParser

An interface for use by the ListInputParser class in choosing and parsing files. Each implementing class must be able to display a file chooser and parse the selected file(s).


Method Summary
 java.lang.String[] getStrings()
          Open a file browser and load strings from the selected file.
 void setProgressBar(SimpleProgressBarDialog progress_bar)
          Stores a progress bar that can be manipulated to display parsing progress.
 

Method Detail

getStrings

java.lang.String[] getStrings()
                              throws java.lang.Exception
Open a file browser and load strings from the selected file. The parsed items should comprise a list. An array of strings should then be created with one entry for each item in the list. It is not necessary to sort or otherwise organize this array, but no entries may be null. Null may be returned if the load is cancelled. A descriptive exception should be thrown if a problem occurs.

Returns:
The parsed contents of the file.
Throws:
java.lang.Exception - An informative description of any problem that occurs during parsing.

setProgressBar

void setProgressBar(SimpleProgressBarDialog progress_bar)
Stores a progress bar that can be manipulated to display parsing progress. This is not necessary for all parsers, as a ListInputPanel will generate and display a progress bar in any case, but it can be preferable in some parsing situations to hand the progress bar directly to the parser.

Parameters:
progress_bar - The progress bar.