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.4
Version:
2.4
Author:
Robert Jan van der Waals
See Also:
DCModules, DCModule

Field Summary
protected  DCModule childModule
           
protected  DcField[] fields
           
protected  TableInsertPanel insertPanel
           
protected  QuickViewPanel quickView
           
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, boolean allowFreeDbUpdate)
          Initializes this module
 
Method Summary
abstract  ImportCDProcess getCDImportProcess(ImportCDDialog ui, java.lang.String sourceDir, boolean confirmDirs, boolean recursiveDirs, 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()
           
 DcField getField(int index)
          Returns a specific field definition.
 int getFieldCount()
          Returns the amount of fields
 DcField[] getFieldDefinitions()
          Returns all field definitions.
abstract  java.lang.String getFieldDefinitionsSettingsKey()
           
abstract  javax.swing.ImageIcon getIcon()
           
 int getIndex()
          Returns the index for this module as defined in DCModules
 TableInsertPanel getInsertPanel()
          Initializes the insert panel (lazy)
 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  QuickViewPanel getQuickView()
           
abstract  ReportFieldDefinitions getReportFieldDefinitions()
           
 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 isFreedBUpdateAllowed()
          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 DcField[] fields

quickView

protected QuickViewPanel quickView

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,
                boolean allowFreeDbUpdate)
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

getField

public DcField getField(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

getMenuBar

public DcMenuBar getMenuBar()

getChildModule

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


getFieldDefinitions

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


getSearchForm

public SearchForm getSearchForm()

initializeFields

protected abstract void initializeFields()

getIcon

public abstract javax.swing.ImageIcon getIcon()

getReportFieldDefinitions

public abstract ReportFieldDefinitions getReportFieldDefinitions()

getFieldDefinitionsSettingsKey

public abstract java.lang.String getFieldDefinitionsSettingsKey()

getObjectName

public abstract java.lang.String getObjectName()

getQuickView

public abstract QuickViewPanel getQuickView()

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 confirmDirs,
                                                   boolean recursiveDirs,
                                                   java.lang.String nameOfCD)
Returns the module specific CD import process

Parameters:
sourceDir - directory which is used as source for the import
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)


isFreedBUpdateAllowed

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


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