net.sf.dc.core.modules
Class DCModule

java.lang.Object
  extended bynet.sf.dc.core.modules.DCModule
Direct Known Subclasses:
MovieModule, MusicModule, SoftwareCategoryModule, SoftwareModule

public abstract class DCModule
extends java.lang.Object

Contains all generic information for this module. Only static data can be found in here, such as the column and table information. The UI representation can also be retrieved thru this class (insert and search panels) Hidden field information and such, which can be changed during a session is contained within the Data Crow Objects themselves. Main reason for this setup is to keep the Data Crow Objects as small as possible, they can be stored in memory by thousands at a time..

Since:
1.3
Version:
DC1.00
Author:
Robert-Jan van der Waals
See Also:
DCModules

Field Summary
protected  DCFieldDefinition[] fields
           
protected  TableInsertPanel insertPanel
           
protected  TableSearchPanel searchPanel
           
protected  java.lang.String tableName
           
 
Constructor Summary
DCModule(int index, java.lang.String name, boolean allowImdbUpdate, boolean allowAmazonUpdate, boolean standalone)
          Initializes this module
 
Method Summary
abstract  ImportCDProcess getCDImportProcess(java.lang.String sourceDir, boolean confirmEachDir, java.lang.String nameOfCD)
          Returns the module specific CD import process
abstract  DCObject getDataCrowObject()
          Returns an empty Data Crow object, managed by this module
 int getFieldCount()
          Returns the amount of fields
 DCFieldDefinition getFieldDefinition(int index)
          Returns a specific field definition.
 DCFieldDefinition[] getFieldDefinitions()
          Returns all field definitions.
abstract  java.lang.String getHiddenFieldsSettingsKey()
           
abstract  javax.swing.ImageIcon getIcon()
           
 int getIndex()
          Returns the index for this module as defined in DCModules
 TableInsertPanel getInsertPanel()
          Initializes the insert panel (lazy)
abstract  javax.swing.JButton[] getMenuItems()
          Returns module specific menu items
 java.lang.String getName()
          Returns the display name of this module
abstract  java.lang.String getRequiredFieldsSettingsKey()
           
 TableSearchPanel getSearchPanel()
          Initializes the search panel (lazy)
protected abstract  void initializeFields()
           
protected abstract  void initializeUI()
          Creates the panels for this module
 boolean isAmazonUpdateAllowed()
          Indicates if this module has an Amazon update implementation
 boolean isImdbUpdateAllowed()
          Indicates if this module has an IMDB update implementation
 boolean isStandalone()
           
 java.lang.String toString()
          Creates a string representation for this module
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

insertPanel

protected TableInsertPanel insertPanel

searchPanel

protected TableSearchPanel searchPanel

fields

protected DCFieldDefinition[] fields

tableName

protected java.lang.String tableName
Constructor Detail

DCModule

public DCModule(int index,
                java.lang.String name,
                boolean allowImdbUpdate,
                boolean allowAmazonUpdate,
                boolean standalone)
Initializes this module

Parameters:
index - static final module index
name - name of this module
allowImdbUpdate - internet updates, thru imdb, allowed y/n
allowAmazonUpdate - internet updates, thru amazon, allowed y/n
standalone - is this a standalone or a composite module
Method Detail

getFieldDefinition

public DCFieldDefinition getFieldDefinition(int index)
Returns a specific field definition. A field definition describes if the field is required, what datatype it represents, etc.

Parameters:
index - field index

getFieldDefinitions

public DCFieldDefinition[] getFieldDefinitions()
Returns all field definitions. A field definition describes if the field is required, what datatype it represents, etc.


initializeFields

protected abstract void initializeFields()

getIcon

public abstract javax.swing.ImageIcon getIcon()

getDataCrowObject

public abstract DCObject getDataCrowObject()
Returns an empty Data Crow object, managed by this module


getMenuItems

public abstract javax.swing.JButton[] getMenuItems()
Returns module specific menu items


getHiddenFieldsSettingsKey

public abstract java.lang.String getHiddenFieldsSettingsKey()

getRequiredFieldsSettingsKey

public abstract java.lang.String getRequiredFieldsSettingsKey()

initializeUI

protected abstract void initializeUI()
Creates the panels for this module


getCDImportProcess

public abstract ImportCDProcess getCDImportProcess(java.lang.String sourceDir,
                                                   boolean confirmEachDir,
                                                   java.lang.String nameOfCD)
Returns the module specific CD import process

Parameters:
sourceDir - directory which is used as source for the import
confirmEachDir - indicates whether for each directory confirmation should be asked if the underlying data of this directory should be read or not.
nameOfCD - cd name (used as the location name)
Returns:

getFieldCount

public int getFieldCount()
Returns the amount of fields


getInsertPanel

public TableInsertPanel getInsertPanel()
Initializes the insert panel (lazy)


isStandalone

public boolean isStandalone()

getSearchPanel

public TableSearchPanel getSearchPanel()
Initializes the search panel (lazy)


isAmazonUpdateAllowed

public boolean isAmazonUpdateAllowed()
Indicates if this module has an Amazon update implementation


isImdbUpdateAllowed

public boolean isImdbUpdateAllowed()
Indicates if this module has an IMDB update implementation


getName

public java.lang.String getName()
Returns the display name of this module


getIndex

public int getIndex()
Returns the index for this module as defined in DCModules

See Also:
DCModules

toString

public java.lang.String toString()
Creates a string representation for this module