net.sf.dc.core.modules
Class DCModule

java.lang.Object
  extended bynet.sf.dc.core.modules.DCModule
Direct Known Subclasses:
AudioCDModule, AudioTrackModule, BookCategoryModule, BookModule, MovieModule, MusicFileModule, 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:
1.00
Author:
Robert-Jan van der Waals
See Also:
DCModules, DCModule

Field Summary
protected  DCModule childModule
           
protected  DCFieldDefinition[] fields
           
protected  TableInsertPanel insertPanel
           
protected  SearchForm searchForm
           
protected  TableSearchPanel searchPanel
           
protected  java.lang.String tableJoin
           
protected  java.lang.String tableName
           
protected  java.lang.String tableShortName
           
 
Constructor Summary
DCModule(int index, java.lang.String name, java.lang.String tableName, java.lang.String tableShortName, java.lang.String tableJoin, boolean allowImdbUpdate, boolean allowAmazonUpdate)
          Initializes this module
 
Method Summary
abstract  ImportCDProcess getCDImportProcess(ImportCDDialog ui, java.lang.String sourceDir, boolean confirmEachDir, java.lang.String nameOfCD)
          Returns the module specific CD import process
 DCModule getChildModule()
          Returns the child module (or null)
abstract  DCObject getDCObject()
          Returns an empty Data Crow object, managed by this module
abstract  DCObject[] getDefaultData()
           
 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  DCMenuBar getMenuBar()
           
 java.lang.String getName()
          Returns the display name of this module
abstract  java.lang.String getObjectName()
           
 DCPanel[] getPanels()
          Returns all insert and search panels belonging to this module
abstract  java.lang.String getRequiredFieldsSettingsKey()
           
 SearchForm getSearchForm()
           
 TableSearchPanel getSearchPanel()
          Initializes the search panel (lazy)
 java.lang.String getTableJoin()
           
 java.lang.String getTableName()
           
 java.lang.String getTableShortName()
           
abstract  javax.swing.JMenu getToolsMenu()
          Returns module specific menu items
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
 void setChildModule(DCModule childModule)
          Sets a child module for this module
abstract  void startImport()
           
 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

searchForm

protected SearchForm searchForm

childModule

protected DCModule childModule

fields

protected DCFieldDefinition[] fields

tableName

protected java.lang.String tableName

tableShortName

protected java.lang.String tableShortName

tableJoin

protected java.lang.String tableJoin
Constructor Detail

DCModule

public DCModule(int index,
                java.lang.String name,
                java.lang.String tableName,
                java.lang.String tableShortName,
                java.lang.String tableJoin,
                boolean allowImdbUpdate,
                boolean allowAmazonUpdate)
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
Method Detail

getPanels

public DCPanel[] getPanels()
Returns all insert and search panels belonging to this module

Returns:
array of panels

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

setChildModule

public void setChildModule(DCModule childModule)
Sets a child module for this module

Parameters:
childModule - child module

getChildModule

public DCModule getChildModule()
Returns the child module (or null)


getSearchForm

public SearchForm getSearchForm()

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()

getHiddenFieldsSettingsKey

public abstract java.lang.String getHiddenFieldsSettingsKey()

getRequiredFieldsSettingsKey

public abstract java.lang.String getRequiredFieldsSettingsKey()

getObjectName

public abstract java.lang.String getObjectName()

getMenuBar

public abstract DCMenuBar getMenuBar()

getDefaultData

public abstract DCObject[] getDefaultData()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

startImport

public abstract void startImport()

getDCObject

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


getToolsMenu

public abstract javax.swing.JMenu getToolsMenu()
Returns module specific menu items


initializeUI

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


getCDImportProcess

public abstract ImportCDProcess getCDImportProcess(ImportCDDialog ui,
                                                   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)

getFieldCount

public int getFieldCount()
Returns the amount of fields


getInsertPanel

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


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


getTableName

public java.lang.String getTableName()

getTableShortName

public java.lang.String getTableShortName()

getTableJoin

public java.lang.String getTableJoin()

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