|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.datacrow.core.modules.DcModule
public class DcModule
A module represents items. The module dictates among other things where the
items are stored, which views they can be displayed, which fields they have and
which online services are available to update or search for new items.
The module is where it all comes together.
Modules can have relationships between each other and come in different types. An
important property of the module is the top module boolean which indicates if the
module can be displayed within module bar and if the module can be disabled and or
enabled by the user.
Furthermore is it important to know that modules are generic. They can be created
from an XmlModule
which holds a flexible XML definition of the module.
The DcModules
class creates and holds all modules.
XmlModule
,
DcModules
,
DcPropertyModule
,
DcMediaModule
,
DcChildModule
,
DcMediaChildModule
,
DcParentModule
,
DcMediaParentModule
Field Summary | |
---|---|
static int |
_TYPE_ASSOCIATE_MODULE
|
static int |
_TYPE_EXTERNALREFERENCE_MODULE
|
static int |
_TYPE_MAPPING_MODULE
|
static int |
_TYPE_MEDIA_MODULE
|
static int |
_TYPE_MODULE
|
static int |
_TYPE_PROPERTY_MODULE
|
static int |
_TYPE_TEMPLATE_MODULE
|
protected MasterView |
insertView
|
protected MasterView |
searchView
|
Constructor Summary | |
---|---|
|
DcModule(int index,
boolean topModule,
java.lang.String name,
java.lang.String description,
java.lang.String objectName,
java.lang.String objectNamePlural,
java.lang.String tableName,
java.lang.String tableShortName)
Creates a new instance. |
protected |
DcModule(int index,
java.lang.String name,
java.lang.String description,
java.lang.String objectName,
java.lang.String objectNamePlural,
java.lang.String tableName,
java.lang.String tableShortName,
boolean topModule)
Creates a new instance. |
|
DcModule(XmlModule module)
Creates a new module based on a XML definition. |
Method Summary | |
---|---|
void |
addField(DcField field)
Adds a field to this module. |
void |
addValueEnhancer(IValueEnhancer enhancer,
int field)
Registers a value enhancer for a specific field. |
void |
applySettings()
Applies the field settings on this module. |
boolean |
canBeLend()
Indicates if items belonging to this module can be lend. |
int |
compareTo(DcModule module)
Compares the supplied module with the current module. |
protected DcObject |
createItem()
Creates a new instance of an item belonging to this module. |
void |
delete()
Deletes this module. |
boolean |
deliversOnlineService()
Indicates if this module has online services at its disposal. |
boolean |
equals(java.lang.Object o)
|
ChartPanel |
getChartPanel(boolean create)
Creates the chart panel (if not created already). |
DcModule |
getChild()
Retrieves the child module instance. |
View |
getCurrentInsertView()
Returns the current insert view. |
View |
getCurrentSearchView()
Returns the current search view. |
java.util.Collection<DcObject> |
getDefaultData()
Retrieves the default data for this module. |
int |
getDefaultSortFieldIdx()
Retrieves the index of the field on which is sorted by default. |
java.lang.String |
getDescription()
The description for this module. |
int |
getDisplayFieldIdx()
Educated guess.. |
int |
getDisplayIndex()
The location of the module in the module bar. |
DcField |
getField(int index)
Retrieves the field definition for the given index. |
DcField |
getField(java.lang.String columnName)
Retrieves the field definition for the given index. |
int |
getFieldCount()
The number of fields belonging to this module. |
DcFieldDefinitions |
getFieldDefinitions()
Gets the field definitions. |
int[] |
getFieldIndices()
Retrieves all field indices. |
java.util.Collection<DcField> |
getFields()
Retrieves all fields. |
DcField |
getFileField()
|
FileRenamerDialog |
getFileRenamerDialog(boolean create)
Creates the file renamer dialog (if not created already). |
FilterDialog |
getFilterForm(boolean create)
Creates the filter form (if not created already). |
DcImageIcon |
getIcon16()
The small icon used to represent the module. |
java.lang.String |
getIcon16Filename()
|
DcImageIcon |
getIcon32()
The large icon used to represent the module. |
java.lang.String |
getIcon32Filename()
|
DcField |
getIconField()
|
FileImporter |
getImporter()
Creates a new instance of the file importer. |
java.lang.Class |
getImporterClass()
The import class. |
int |
getIndex()
Retrieves the index of the module (unique!) |
MasterView |
getInsertView()
The insert view (shown in the new tab) |
DcObject |
getItem()
Creates a new instance of an item belonging to this module. |
ItemForm |
getItemForm(DcTemplate template,
boolean readonly,
boolean update,
DcObject o,
boolean applyTemplate)
Creates a new item form. |
java.lang.String |
getItemPluralResourceKey()
|
java.lang.String |
getItemResourceKey()
|
javax.swing.KeyStroke |
getKeyStroke()
The keys combination associated with this module. |
java.lang.String |
getLabel()
|
MainFrameMenuBar |
getMenuBar()
Creates the menu bar for this module. |
int[] |
getMinimalFields(java.util.Collection<java.lang.Integer> include)
|
java.lang.String |
getModuleResourceKey()
|
java.lang.String |
getName()
The name of this module. |
int |
getNameFieldIdx()
The field index holding the title of the item. |
java.lang.String |
getObjectName()
The name of the items belonging to this module. |
java.lang.String |
getObjectNamePlural()
The plural name of the items belonging to this module. |
OnlineServices |
getOnlineServices()
The online services available for this module. |
DcModule |
getParent()
Retrieves the parent module instance. |
int |
getParentReferenceFieldIndex()
Retrieves the index for the field holding the reference to the parent item. |
DcField |
getPersistentField(int fieldIdx)
|
DcPropertyModule |
getPropertyModule(int modIdx)
Retrieve the property module for the given index used by this module. |
QuickViewPanel |
getQuickView()
Creates a new quick view panel. |
QuickViewFieldDefinitions |
getQuickViewFieldDefinitions()
Retrieves the quick view field definitions / settings |
MasterView |
getSearchView()
Returns the search view. |
java.lang.Object |
getSetting(java.lang.String key)
Retrieves the module setting value. |
Settings |
getSettings()
The module settings. |
int[] |
getSupportedViews()
|
Synchronizer |
getSynchronizer()
The mass updater or synchronizer. |
int |
getSystemDisplayFieldIdx()
|
DcField |
getSystemField(int index)
Retrieves the system field for the given index. |
java.lang.String |
getSystemObjectName()
The name of the items belonging to this module without translating it. |
java.lang.String |
getSystemObjectNamePlural()
The plural name of the items belonging to this module without translating it. |
java.lang.String |
getTableName()
The name of the table used to store its items. |
java.lang.String |
getTableShortName()
The short name of the table used to store its items. |
TemplateModule |
getTemplateModule()
Returns the template module. |
int |
getType()
|
MasterView[] |
getViews()
Returns all views. |
WebFieldDefinitions |
getWebFieldDefinitions()
Retrieves the web field definitions / settings |
XmlModule |
getXmlModule()
Retrieves the XML definition of this module. |
boolean |
hasActualReferenceTo(int module)
Tells if the module holds a reference to the given module. |
boolean |
hasDependingModules()
Indicates if other modules depend on this module. |
int |
hashCode()
|
boolean |
hasInsertView()
Indicates if this module has an insert view available. |
boolean |
hasReferenceTo(int module)
Tells if the module holds a reference to the given module. |
boolean |
hasReports()
|
boolean |
hasSearchView()
Indicates if this module has a search view available. |
protected void |
initializeFields()
Initializes the default fields. |
void |
initializeMultiReferenceFields()
Creates a simple reference field for each multiple references field for ordering purposes. |
void |
initializeSettings()
Initializes and corrects the module settings (if necessary) |
protected void |
initializeSystemFields()
Initializes the system fields. |
protected void |
initializeUI()
Creates the various views. |
boolean |
isAbstract()
Indicates if the module is abstract. |
boolean |
isChildModule()
Indicates if this module is a child of another module. |
boolean |
isContainerManaged()
Indicates if the module is managed by (can belong to) a container. |
boolean |
isCustomFieldsAllowed()
Indicates if this module is allowed to be customized. |
boolean |
isCustomModule()
Tells if the module is created by a user. |
boolean |
isDefaultDataLoaded()
|
boolean |
isEditingAllowed()
Indicates if the user is allowed to edit items belonging to this module. |
boolean |
isEnabled()
Tells whether the module is enabled. |
void |
isEnabled(boolean b)
Marks the module as enabled or disabled. |
boolean |
isFileBacked()
Indicates if the module holds items with a reference to a file. |
boolean |
isHasImages()
|
boolean |
isHasReferences()
|
boolean |
isNew()
Returns whether this module is new for this installation. |
boolean |
isParentModule()
Indicates if this module is a parent to another module. |
boolean |
isSearchViewInitialized()
|
boolean |
isSelectableInUI()
Indicates if the module can be selected from the module bar. |
boolean |
isServingMultipleModules()
Indicates if this module is used by multiple modules. |
boolean |
isTopModule()
Indicates if this module is a top module. |
boolean |
isValid()
Indicate if this module is valid (fully functional). |
void |
release(DcObject dco)
|
void |
removeEnhancers()
Removes all enhancers. |
void |
setChild(int module)
Register a child module. |
void |
setDefaultDataLoaded(boolean b)
|
void |
setIcon16(DcImageIcon icon16)
Sets the small icon used to represent this module. |
void |
setIcon32(DcImageIcon icon32)
Sets the large icon used to represent this module. |
void |
setNew(boolean isNew)
Indicate this module as new for this installation |
void |
setServingMultipleModules(boolean isServingMultipleModules)
Indicates if this module is used by multiple modules. |
void |
setSetting(java.lang.String key,
java.lang.Object value)
Sets the module setting value. |
void |
setValid(boolean isValid)
Indicate if this module is valid (fully functional). |
void |
setXmlModule(XmlModule xmlModule)
Sets the XML definition for this module. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int _TYPE_MODULE
public static final int _TYPE_PROPERTY_MODULE
public static final int _TYPE_MEDIA_MODULE
public static final int _TYPE_ASSOCIATE_MODULE
public static final int _TYPE_EXTERNALREFERENCE_MODULE
public static final int _TYPE_MAPPING_MODULE
public static final int _TYPE_TEMPLATE_MODULE
protected MasterView insertView
protected MasterView searchView
Constructor Detail |
---|
protected DcModule(int index, java.lang.String name, java.lang.String description, java.lang.String objectName, java.lang.String objectNamePlural, java.lang.String tableName, java.lang.String tableShortName, boolean topModule)
index
- The module index.name
- The internal unique name of the module.description
- The module descriptionobjectName
- The name of the items belonging to this module.objectNamePlural
- The plural name of the items belonging to this module.tableName
- The database table name for this module.tableShortName
- The database table short name for this module.topModule
- Indicates if the module is a top module. Top modules are allowed
to be displayed in the module bar and can be enabled or disabled.public DcModule(int index, boolean topModule, java.lang.String name, java.lang.String description, java.lang.String objectName, java.lang.String objectNamePlural, java.lang.String tableName, java.lang.String tableShortName)
index
- The module index.topModule
- Indicates if the module is a top module. Top modules are allowed
to be displayed in the module bar and can be enabled or disabled.name
- The internal unique name of the module.description
- The module descriptionobjectName
- The name of the items belonging to this module.objectNamePlural
- The plural name of the items belonging to this module.tableName
- The database table name for this module.tableShortName
- The database table short name for this module.public DcModule(XmlModule module)
module
- Method Detail |
---|
public boolean hasReports()
public int getType()
public boolean isHasImages()
public boolean isHasReferences()
public DcField getIconField()
public boolean isAbstract()
public int[] getSupportedViews()
public boolean isNew()
public void setNew(boolean isNew)
isNew
- public boolean isValid()
public void setValid(boolean isValid)
isValid
- public boolean isDefaultDataLoaded()
public void setDefaultDataLoaded(boolean b)
public boolean isEditingAllowed()
public boolean isChildModule()
public boolean isParentModule()
public int getIndex()
public DcImageIcon getIcon16()
public DcImageIcon getIcon32()
public java.lang.String getModuleResourceKey()
public java.lang.String getItemResourceKey()
public java.lang.String getItemPluralResourceKey()
public java.lang.String getObjectName()
public java.lang.String getSystemObjectName()
public java.lang.String getObjectNamePlural()
public java.lang.String getSystemObjectNamePlural()
public javax.swing.KeyStroke getKeyStroke()
public void setIcon16(DcImageIcon icon16)
icon16
- public void setIcon32(DcImageIcon icon32)
icon16
- public boolean isEnabled()
DcModuleSettings
public void isEnabled(boolean b)
DcModuleSettings
public java.lang.String getName()
public java.lang.String getDescription()
public java.lang.String getTableName()
public java.lang.String getTableShortName()
public OnlineServices getOnlineServices()
public boolean deliversOnlineService()
public boolean isCustomModule()
protected DcObject createItem()
public void release(DcObject dco)
public final DcObject getItem()
public DcField getFileField()
public int getSystemDisplayFieldIdx()
public int getDisplayFieldIdx()
public int[] getMinimalFields(java.util.Collection<java.lang.Integer> include)
public ItemForm getItemForm(DcTemplate template, boolean readonly, boolean update, DcObject o, boolean applyTemplate)
template
- The template to be applied on the item.readonly
- Indicates if the item form should be opened in read only mode.update
- Indicates if the item is an existing or a new item.o
- The item to be displayed in the form.applyTemplate
- Indicates if the supplied template should be applied.public Synchronizer getSynchronizer()
public boolean isSearchViewInitialized()
public MasterView getInsertView()
public MasterView getSearchView()
public View getCurrentSearchView()
public View getCurrentInsertView()
public DcPropertyModule getPropertyModule(int modIdx)
modIdx
- public TemplateModule getTemplateModule()
public boolean isSelectableInUI()
public void addField(DcField field)
field
- public MasterView[] getViews()
public DcField getField(int index)
index
- The field index.public DcField getField(java.lang.String columnName)
columnName
- The database column name.public void addValueEnhancer(IValueEnhancer enhancer, int field)
enhancer
- field
- public void removeEnhancers()
public DcField getSystemField(int index)
index
- The field index.public void setChild(int module)
module
- public MainFrameMenuBar getMenuBar()
public DcModule getParent()
public DcModule getChild()
public int getParentReferenceFieldIndex()
public FilterDialog getFilterForm(boolean create)
create
- Indicates if the form should be created when it does not yet exist.
public FileRenamerDialog getFileRenamerDialog(boolean create)
create
- Indicates if the dialog should be created when it does not yet exist.
public ChartPanel getChartPanel(boolean create)
create
- Indicates if the panel should be created when it does not yet exist.
public boolean isServingMultipleModules()
public void setServingMultipleModules(boolean isServingMultipleModules)
isServingMultipleModules
- public boolean isTopModule()
public int getFieldCount()
public boolean canBeLend()
public boolean hasDependingModules()
public java.lang.Object getSetting(java.lang.String key)
key
- The setting key DcRepository.ModuleSettings
.public void setSetting(java.lang.String key, java.lang.Object value)
key
- The setting key DcRepository.ModuleSettings
.value
- The value to set.public QuickViewPanel getQuickView()
public boolean hasReferenceTo(int module)
module
- The module index.public boolean hasActualReferenceTo(int module)
module
- The module index.public java.util.Collection<DcField> getFields()
public DcFieldDefinitions getFieldDefinitions()
DcFieldDefinition
public WebFieldDefinitions getWebFieldDefinitions()
WebFieldDefinition
public QuickViewFieldDefinitions getQuickViewFieldDefinitions()
QuickViewFieldDefinition
public int[] getFieldIndices()
public java.lang.Class getImporterClass()
public FileImporter getImporter()
public boolean isCustomFieldsAllowed()
public Settings getSettings()
DcRepository.ModuleSettings
public void applySettings()
public boolean isContainerManaged()
ContainerModule
,
Container
public DcField getPersistentField(int fieldIdx)
public void initializeMultiReferenceFields()
protected void initializeFields()
public void initializeSettings()
protected void initializeSystemFields()
public boolean hasInsertView()
public boolean hasSearchView()
protected void initializeUI()
public boolean isFileBacked()
public int getDefaultSortFieldIdx()
public int getDisplayIndex()
public int getNameFieldIdx()
public java.lang.String getIcon16Filename()
public java.lang.String getIcon32Filename()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public XmlModule getXmlModule()
public void setXmlModule(XmlModule xmlModule)
public java.lang.String getLabel()
public int compareTo(DcModule module)
compareTo
in interface java.lang.Comparable<DcModule>
public java.lang.String toString()
toString
in class java.lang.Object
public void delete() throws java.lang.Exception
java.lang.Exception
public java.util.Collection<DcObject> getDefaultData() throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |