net.sf.dc.core.modules
Class DCModule

java.lang.Object
  extended bynet.sf.dc.core.modules.DCModule
Direct Known Subclasses:
BookCategoryModule, DcMediaModule, LoanModule, PersonModule, PersonTypeModule, SoftwareCategoryModule

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  java.util.Map 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, boolean topModule, 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
 boolean canBeLended()
           
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)
           
 int getFieldCount()
           
abstract  java.lang.String getFieldDefinitionsSettingsKey()
           
 int[] getFieldIndices()
           
 java.util.Collection getFields()
           
abstract  javax.swing.ImageIcon getIcon()
           
 javax.swing.ImageIcon getIconSmall()
           
 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)
 DcField getSystemField(int index)
           
 java.lang.String getTableJoin()
           
 java.lang.String getTableName()
           
 java.lang.String getTableShortName()
           
abstract  javax.swing.JMenu getToolsMenu()
          Returns module specific menu items
protected  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
 boolean isTopModule()
           
 void setCanBeLended(boolean b)
           
 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 java.util.Map 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,
                boolean topModule,
                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)

getSystemField

public DcField getSystemField(int 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)


getSearchForm

public SearchForm getSearchForm()

getFields

public java.util.Collection getFields()

getFieldIndices

public int[] getFieldIndices()

initializeFields

protected void initializeFields()

isTopModule

public boolean isTopModule()

getFieldCount

public int getFieldCount()

canBeLended

public boolean canBeLended()

setCanBeLended

public void setCanBeLended(boolean b)

getIconSmall

public javax.swing.ImageIcon getIconSmall()

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)

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