本文整理了Java中org.jbundle.base.db.Record.setEditMode
方法的一些代码示例,展示了Record.setEditMode
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.setEditMode
方法的具体详情如下:
包路径:org.jbundle.base.db.Record
类名称:Record
方法名:setEditMode
暂无
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Clear all the fields and leave record in an indeterminate state.
* This method is frequently used to prepare a record for a seek command. This prevents
* the Edit command from being called because the record was changed. (Edit usually called the database).
* @param bDisplayOption Display the new field values.
*/
public void initRecord(boolean bDisplayOption) //, boolean bDisplayOption)
{
this.handleNewRecord(bDisplayOption);
this.setEditMode(Constants.EDIT_NONE); // No Status
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Clear all the fields and leave record in an indeterminate state.
* This method is frequently used to prepare a record for a seek command. This prevents
* the Edit command from being called because the record was changed. (Edit usually called the database).
* @param bDisplayOption Display the new field values.
*/
public void initRecord(boolean bDisplayOption) //, boolean bDisplayOption)
{
this.handleNewRecord(bDisplayOption);
this.setEditMode(Constants.EDIT_NONE); // No Status
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Clear all the fields and leave record in an indeterminate state.
* This method is frequently used to prepare a record for a seek command. This prevents
* the Edit command from being called because the record was changed. (Edit usually called the database).
* @param bDisplayOption Display the new field values.
*/
public void initRecord(boolean bDisplayOption) //, boolean bDisplayOption)
{
this.handleNewRecord(bDisplayOption);
this.setEditMode(Constants.EDIT_NONE); // No Status
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Create/Clear the current object (Always called from the record class).
* @exception DBException File exception.
*/
public void addNew() throws DBException
{
this.getRecord().setEditMode(Constants.EDIT_NONE);
m_objectID = null;
m_dataSource = null;
try {
this.doAddNew();
m_iRecordStatus = DBConstants.RECORD_NEW;
} catch (DBException ex) {
throw ex;
}
this.getRecord().setEditMode(Constants.EDIT_ADD); // I do this before the handleNewRecord behaviors do anything
this.getRecord().handleNewRecord(); // Display Fields
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Create/Clear the current object (Always called from the record class).
* @exception DBException File exception.
*/
public void addNew() throws DBException
{
this.getRecord().setEditMode(Constants.EDIT_NONE);
m_objectID = null;
m_dataSource = null;
try {
this.doAddNew();
m_iRecordStatus = DBConstants.RECORD_NEW;
} catch (DBException ex) {
throw ex;
}
this.getRecord().setEditMode(Constants.EDIT_ADD); // I do this before the handleNewRecord behaviors do anything
this.getRecord().handleNewRecord(); // Display Fields
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Create/Clear the current object (Always called from the record class).
* @exception DBException File exception.
*/
public void addNew() throws DBException
{
this.getRecord().setEditMode(Constants.EDIT_NONE);
m_objectID = null;
m_dataSource = null;
try {
this.doAddNew();
m_iRecordStatus = DBConstants.RECORD_NEW;
} catch (DBException ex) {
throw ex;
}
this.getRecord().setEditMode(Constants.EDIT_ADD); // I do this before the handleNewRecord behaviors do anything
this.getRecord().handleNewRecord(); // Display Fields
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Free this table object.
* Don't call this directly, freeing the record will free the table correctly.
* You never know, another table may have been added to the table chain.
* First, closes this table, then removes me from the database.
*/
public void free()
{
int iOldEditMode = 0;
if (m_record != null) // First, release the record for this table
{
iOldEditMode = this.getRecord().getEditMode();
this.getRecord().setEditMode(iOldEditMode | DBConstants.EDIT_CLOSE_IN_FREE); // This is a cludge... signals tables that this is the last close()!
}
this.close();
if (m_record != null) // First, release the record for this table
this.getRecord().setEditMode(iOldEditMode); // This is a cludge... signals tables that this is the last close()!
super.free(); // Set the record's table reference to null.
if (m_database != null)
m_database.removeTable(this);
m_database = null;
m_dataSource = null;
m_objectID = null;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Free this table object.
* Don't call this directly, freeing the record will free the table correctly.
* You never know, another table may have been added to the table chain.
* First, closes this table, then removes me from the database.
*/
public void free()
{
int iOldEditMode = 0;
if (m_record != null) // First, release the record for this table
{
iOldEditMode = this.getRecord().getEditMode();
this.getRecord().setEditMode(iOldEditMode | DBConstants.EDIT_CLOSE_IN_FREE); // This is a cludge... signals tables that this is the last close()!
}
this.close();
if (m_record != null) // First, release the record for this table
this.getRecord().setEditMode(iOldEditMode); // This is a cludge... signals tables that this is the last close()!
super.free(); // Set the record's table reference to null.
if (m_database != null)
m_database.removeTable(this);
m_database = null;
m_dataSource = null;
m_objectID = null;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Do the physical Open on this table (requery the table).
* @exception DBException File exception.
*/
public void open() throws DBException
{
super.open();
this.getRecord().setEditMode(DBConstants.EDIT_NONE); // Being careful
Iterator<BaseTable> iterator = this.getTables();
while (iterator.hasNext())
{
BaseTable table = iterator.next();
if ((table != null) && (table != this.getNextTable()))
{
this.syncRecordToBase(table.getRecord(), this.getRecord()); // Note: I am syncing the base to the alt here
table.open();
}
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Do the physical Open on this table (requery the table).
* @exception DBException File exception.
*/
public void open() throws DBException
{
super.open();
this.getRecord().setEditMode(DBConstants.EDIT_NONE); // Being careful
Iterator<BaseTable> iterator = this.getTables();
while (iterator.hasNext())
{
BaseTable table = iterator.next();
if ((table != null) && (table != this.getNextTable()))
{
this.syncRecordToBase(table.getRecord(), this.getRecord(), true); // Note: I am syncing the base to the alt here
table.open();
}
}
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Do the physical Open on this table (requery the table).
* @exception DBException File exception.
*/
public void open() throws DBException
{
super.open();
this.getRecord().setEditMode(DBConstants.EDIT_NONE); // Being careful
Iterator<BaseTable> iterator = this.getTables();
while (iterator.hasNext())
{
BaseTable table = iterator.next();
if ((table != null) && (table != this.getNextTable()))
{
this.syncRecordToBase(table.getRecord(), this.getRecord()); // Note: I am syncing the base to the alt here
table.open();
}
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Lock the current record.
* This method responds differently depending on what open mode the record is in:
* OPEN_DONT_LOCK - A physical lock is not done. This is usually where deadlocks are possible
* (such as screens) and where transactions are in use (and locks are not needed).
* OPEN_LOCK_ON_EDIT - Holds a lock until an update or close. (Update crucial data, or hold records for processing)
* Returns false is someone alreay has a lock on this record.
* OPEN_WAIT_FOR_LOCK - Don't return from edit until you get a lock. (ie., Add to the total).
* Returns false if someone has a hard lock or time runs out.
* @return true if successful, false is lock failed.
* @exception DBException FILE_NOT_OPEN
* @exception DBException INVALID_RECORD - Record not current.
*/
public int edit() throws DBException
{
int iErrorCode = super.edit();
this.getCurrentTable().getRecord().setEditMode(this.getBaseRecord().getEditMode()); // In case the screen has this.
return iErrorCode;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Lock the current record.
* This method responds differently depending on what open mode the record is in:
* OPEN_DONT_LOCK - A physical lock is not done. This is usually where deadlocks are possible
* (such as screens) and where transactions are in use (and locks are not needed).
* OPEN_LOCK_ON_EDIT - Holds a lock until an update or close. (Update crucial data, or hold records for processing)
* Returns false is someone alreay has a lock on this record.
* OPEN_WAIT_FOR_LOCK - Don't return from edit until you get a lock. (ie., Add to the total).
* Returns false if someone has a hard lock or time runs out.
* @return true if successful, false is lock failed.
* @exception DBException FILE_NOT_OPEN
* @exception DBException INVALID_RECORD - Record not current.
*/
public int edit() throws DBException
{
int iErrorCode = super.edit();
this.getCurrentTable().getRecord().setEditMode(this.getBaseRecord().getEditMode()); // In case the screen has this.
return iErrorCode;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Set the current table target.
* @param table The new current table.
*/
public void copyRecordInfo(Record recDest, Record recSource, boolean bCopyEditMode, boolean bOnlyModifiedFields)
{
if (recDest == null)
recDest = this.getCurrentRecord();
if (recDest != recSource)
{
boolean bAllowFieldChange = false; // This will disable field behaviors on move
boolean bMoveModifiedState = true; // This will move the modified status to the new field
Object[] rgobjEnabledFieldsOld = recSource.setEnableFieldListeners(false);
recDest.moveFields(recSource, null, DBConstants.DONT_DISPLAY, DBConstants.READ_MOVE, bAllowFieldChange, bOnlyModifiedFields, bMoveModifiedState);
recSource.setEnableFieldListeners(rgobjEnabledFieldsOld);
if (bCopyEditMode)
recDest.setEditMode(recSource.getEditMode()); // Okay?
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Set the current table target.
* @param table The new current table.
*/
public void copyRecordInfo(Record recDest, Record recSource, boolean bCopyEditMode, boolean bOnlyModifiedFields)
{
if (recDest == null)
recDest = this.getCurrentRecord();
if (recDest != recSource)
{
boolean bAllowFieldChange = false; // This will disable field behaviors on move
boolean bMoveModifiedState = true; // This will move the modified status to the new field
Object[] rgobjEnabledFieldsOld = recSource.setEnableFieldListeners(false);
recDest.moveFields(recSource, null, DBConstants.DONT_DISPLAY, DBConstants.READ_MOVE, bAllowFieldChange, bOnlyModifiedFields, bMoveModifiedState, false);
recSource.setEnableFieldListeners(rgobjEnabledFieldsOld);
if (bCopyEditMode)
recDest.setEditMode(recSource.getEditMode()); // Okay?
}
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Lock the current record.
* This method responds differently depending on what open mode the record is in:
* OPEN_DONT_LOCK - A physical lock is not done. This is usually where deadlocks are possible
* (such as screens) and where transactions are in use (and locks are not needed).
* OPEN_LOCK_ON_EDIT - Holds a lock until an update or close. (Update crucial data, or hold records for processing)
* Returns false is someone alreay has a lock on this record.
* OPEN_WAIT_FOR_LOCK - Don't return from edit until you get a lock. (ie., Add to the total).
* Returns false if someone has a hard lock or time runs out.
* @return true if successful, false is lock failed.
* @exception DBException FILE_NOT_OPEN
* @exception DBException INVALID_RECORD - Record not current.
*/
public int edit() throws DBException
{
int iErrorCode = super.edit();
this.getCurrentTable().getRecord().setEditMode(this.getBaseRecord().getEditMode()); // In case the screen has this.
return iErrorCode;
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Set the current table target.
* @param table The new current table.
*/
public void copyRecordInfo(Record recDest, Record recSource, boolean bCopyEditMode, boolean bOnlyModifiedFields)
{
if (recDest == null)
recDest = this.getCurrentRecord();
if (recDest != recSource)
{
boolean bAllowFieldChange = false; // This will disable field behaviors on move
boolean bMoveModifiedState = true; // This will move the modified status to the new field
Object[] rgobjEnabledFieldsOld = recSource.setEnableFieldListeners(false);
recDest.moveFields(recSource, null, DBConstants.DONT_DISPLAY, DBConstants.READ_MOVE, bAllowFieldChange, bOnlyModifiedFields, bMoveModifiedState);
recSource.setEnableFieldListeners(rgobjEnabledFieldsOld);
if (bCopyEditMode)
recDest.setEditMode(recSource.getEditMode()); // Okay?
}
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Sync the current record's contents and status to the base record
*/
public void syncRecordToBase(Record recBase, Record recAlt)
{
if ((recAlt != null) && (recBase != null))
{
recBase.moveFields(recAlt, null, true, DBConstants.READ_MOVE, false, false, true);
recBase.setEditMode(recAlt.getEditMode());
}
if ((recBase.getEditMode() == DBConstants.EDIT_CURRENT) || (recBase.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
recBase.handleValidRecord(); // Do listeners, Display Fields
else if (recBase.getEditMode() == DBConstants.EDIT_ADD)
recBase.handleNewRecord(); // Do listeners, Display Fields
}
}
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Sync the current record's contents and status to the base record
*/
public void syncRecordToBase(Record recBase, Record recAlt)
{
if ((recAlt != null) && (recBase != null))
{
recBase.moveFields(recAlt, null, true, DBConstants.READ_MOVE, false, false, true);
recBase.setEditMode(recAlt.getEditMode());
}
if ((recBase.getEditMode() == DBConstants.EDIT_CURRENT) || (recBase.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
recBase.handleValidRecord(); // Do listeners, Display Fields
else if (recBase.getEditMode() == DBConstants.EDIT_ADD)
recBase.handleNewRecord(); // Do listeners, Display Fields
}
}
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Sync the current record's contents and status to the base record
* @param syncSelection Sync selected fields?
*/
public void syncRecordToBase(Record recBase, Record recAlt, boolean syncSelection)
{
if ((recAlt != null) && (recBase != null))
{
recBase.moveFields(recAlt, null, true, DBConstants.READ_MOVE, false, false, true, syncSelection);
recBase.setEditMode(recAlt.getEditMode());
}
if ((recBase.getEditMode() == DBConstants.EDIT_CURRENT) || (recBase.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
recBase.handleValidRecord(); // Do listeners, Display Fields
else if (recBase.getEditMode() == DBConstants.EDIT_ADD)
recBase.handleNewRecord(); // Do listeners, Display Fields
//?recBase.setKeyArea(recAlt.getDefaultOrder());
}
}
内容来源于网络,如有侵权,请联系作者删除!