edu.uchsc.ccp.knowtator.textsource.files
Class FileTextSourceCollection

java.lang.Object
  extended by edu.uchsc.ccp.knowtator.textsource.TextSourceCollection
      extended by edu.uchsc.ccp.knowtator.textsource.files.FileTextSourceCollection

public class FileTextSourceCollection
extends TextSourceCollection


Field Summary
static String CLS_NAME
           
static String DISPLAY_NAME
           
static String PROJECT_SETTING_RECENT_CHARSET
           
static String PROJECT_SETTING_RECENT_DIRECTORY
           
 
Constructor Summary
FileTextSourceCollection(File directory, Charset charset)
           
FileTextSourceCollection(String directoryName, Charset charset)
           
 
Method Summary
 void addTextSourceToCollection(File fileToAdd)
          This method allows a text source to be added to this TextSourceCollection on the fly.
static void createCls(KnowledgeBase kb)
           
 TextSource find(Component parent)
           
 TextSource get(int index)
           
 TextSource get(String textSourceName)
           
 File getDirectory()
           
 int getIndex(TextSource textSource)
           
 String getName()
           
 TextSourceIterator iterator()
          provides an easy way for a script to iterate through all TextSources in a collection.
static TextSourceCollection open(Project project)
           
static TextSourceCollection open(Project project, Component parent)
           
 void save(Project project)
          contribution from Angus Roberts saves a relative path if the directory is under the protege project directory
 TextSource select(Component parent)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPLAY_NAME

public static final String DISPLAY_NAME
See Also:
Constant Field Values

CLS_NAME

public static String CLS_NAME

PROJECT_SETTING_RECENT_DIRECTORY

public static final String PROJECT_SETTING_RECENT_DIRECTORY

PROJECT_SETTING_RECENT_CHARSET

public static final String PROJECT_SETTING_RECENT_CHARSET
Constructor Detail

FileTextSourceCollection

public FileTextSourceCollection(String directoryName,
                                Charset charset)
                         throws IOException
Throws:
IOException

FileTextSourceCollection

public FileTextSourceCollection(File directory,
                                Charset charset)
                         throws IOException
Throws:
IOException
Method Detail

addTextSourceToCollection

public void addTextSourceToCollection(File fileToAdd)
This method allows a text source to be added to this TextSourceCollection on the fly.

Parameters:
fileToAdd - the file to add to this FileTextSourceCollection

getDirectory

public File getDirectory()

size

public int size()
Specified by:
size in class TextSourceCollection

get

public TextSource get(int index)
               throws TextSourceAccessException
Specified by:
get in class TextSourceCollection
Throws:
TextSourceAccessException

get

public TextSource get(String textSourceName)
               throws TextSourceAccessException
Specified by:
get in class TextSourceCollection
Returns:
the text source that has the given name. A text source collection should have no name collisions.
Throws:
TextSourceAccessException

getIndex

public int getIndex(TextSource textSource)
Specified by:
getIndex in class TextSourceCollection
Returns:
-1 if text source does not exist.

getName

public String getName()
Specified by:
getName in class TextSourceCollection
Returns:
The name of the text source collection. Might correspond to the name of the directory, database or file that the text source collection accesses to get text sources.

select

public TextSource select(Component parent)
Specified by:
select in class TextSourceCollection
Returns:
a TextSource selected by a human user through a user interface. Implementations of this method might provide a dialog with a list of available text sources.

find

public TextSource find(Component parent)
Specified by:
find in class TextSourceCollection
Returns:
a TextSource selected by a human user through a user interface. Implementations of this method might provide a dialog with a text field that requires the user to enter the name of a text source or some text that s/he is looking for.

save

public void save(Project project)
contribution from Angus Roberts saves a relative path if the directory is under the protege project directory

Specified by:
save in class TextSourceCollection

open

public static TextSourceCollection open(Project project)

open

public static TextSourceCollection open(Project project,
                                        Component parent)

createCls

public static void createCls(KnowledgeBase kb)

iterator

public TextSourceIterator iterator()
Description copied from class: TextSourceCollection
provides an easy way for a script to iterate through all TextSources in a collection.

Specified by:
iterator in class TextSourceCollection