org.jbundle.thin.base.db.FieldList.setEditMode()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.jbundle.thin.base.db.FieldList.setEditMode()方法的一些代码示例,展示了FieldList.setEditMode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FieldList.setEditMode()方法的具体详情如下:
包路径:org.jbundle.thin.base.db.FieldList
类名称:FieldList
方法名:setEditMode

FieldList.setEditMode介绍

[英]Set the current edit mode for this record.
[中]设置此记录的当前编辑模式。

代码示例

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

/**
 * Close the file.
 * Reset the current position.
 */
public void close()
{
  m_bIsOpen = false;
  this.getRecord().setEditMode(Constants.EDIT_NONE);
}
/**

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

/**
 * Get the next record (return a null at EOF).
 * Note: Remember to set the data source before returning a NORMAL_RETURN.
 * @param iRelPosition The relative records to move.
 * @return A record status (NORMAL_RETURN means the move was successful).
 */
public int doMove(int iRelPosition) throws DBException
{
  this.getRecord().setEditMode(Constants.EDIT_NONE);
  return Constants.ERROR_RETURN;  // You better override this.
}
/**

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

/**
 * Reset the current position and open the file.
 * Note: This is called automatically on your first file access.
 */
public void open() throws DBException
{
  m_bIsOpen = true;
  this.getRecord().setEditMode(Constants.EDIT_NONE);
  this.setDataSource(null);
}
/**

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

/**
 * Create a new empty record.
 * Discard the current fields, init all the fields and display them,
 * and set the status to EDIT_ADD.
 */
public void addNew() throws DBException
{
  this.getRecord().initRecord(true);
  this.getRecord().setEditMode(Constants.EDIT_ADD);
}
/**

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

/**
 * Reset all the fields to their default value.
 * <p />NOTE: After executing, this records edit mode is set to NONE.
 * @param bDisplay The the new values (on work in the thick model).
 * @throws Exception An exception on initing a field.
 */
public void initRecord(boolean bDisplay) throws DBException
{
  int iFieldCount = this.getFieldCount();      // Number of fields to read in
  for (int iFieldSeq = Constants.MAIN_FIELD; iFieldSeq < iFieldCount + Constants.MAIN_FIELD; iFieldSeq++)
  {
    FieldInfo field = this.getField(iFieldSeq);
    field.initField(bDisplay);
  }
  this.setEditMode(Constants.EDIT_NONE);
}
/**

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

/**
 * Read the record that matches this record's current key.
 * <p>NOTE: You do not need to Open to do a seek or addNew.
 * @param strSeekSign - Seek sign:
 * @return true if successful, false if not found.
 * @exception FILE_NOT_OPEN.
 * @exception KEY_NOT_FOUND - The key was not found on read.
 */
public boolean seek(String strSeekSign) throws DBException
{
  this.getRecord().setEditMode(Constants.EDIT_NONE);
  if (strSeekSign == null)
    strSeekSign = Constants.EQUALS;
  boolean bSuccess = this.doSeek(strSeekSign);
  if (bSuccess)
  {
    this.dataToFields(this.getRecord());
    this.setDataSource(null);
    this.getRecord().setEditMode(Constants.EDIT_CURRENT);
    return true;
  }
  else
    return false; // Not found
}
/**

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

/**
 * Get the next record (return a null at EOF).
 * @param iRelPosition The relative records to move.
 * @return next FieldList or null if EOF.
 */
public FieldList move(int iRelPosition) throws DBException
{
  if (!m_bIsOpen)
    this.open();        // This will requery the table the first time
  this.getRecord().setEditMode(Constants.EDIT_NONE);
  int iRecordStatus = this.doMove(iRelPosition);
  if (iRecordStatus == Constants.NORMAL_RETURN)
  {
    this.dataToFields(this.getRecord());
    //  Usually, you would setDataSource(null), but if in hasNext(), you will need the dataSource.
    this.getRecord().setEditMode(Constants.EDIT_CURRENT);
    return m_record;
  }
  else
    return null;    // Usually EOF
}
/**

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

this.getRecord().setEditMode(Constants.EDIT_NONE);
Object objData = this.doGet(iRowIndex);
if (objData instanceof Integer)
    this.getRecord().setEditMode(Constants.EDIT_NONE);   // Invalid record
    return m_record;
  this.dataToFields(this.getRecord());
  this.getRecord().setEditMode(Constants.EDIT_CURRENT);
  return m_record;

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

/**
 * Remove the current record.
 */
public void remove() throws DBException
{
  if ((this.getRecord().getEditMode() != Constants.EDIT_CURRENT)
    && ((this.getRecord().getEditMode() != Constants.EDIT_IN_PROGRESS)))
      throw new DBException(Constants.INVALID_RECORD);
  this.doRemove();
  this.getRecord().setEditMode(Constants.EDIT_NONE);
}
/**

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

/**
 * Add this record to this table.
 * Add this record to the table and set the current edit mode to NONE.
 * @param record The record to add.
 * @throws Exception
 */
public void add(Rec record) throws DBException
{
  if (this.getRecord().getEditMode() != Constants.EDIT_ADD)
    throw new DBException(Constants.INVALID_RECORD);
  m_record = (FieldList)record;
  this.fieldsToData(record);
  this.doAdd(record);
  this.setDataSource(null);
  this.getRecord().setEditMode(Constants.EDIT_NONE);
}
/**

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.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.
 * NOTE: For a remote table it is not necessary to call edit, as edit will
 * be called automatically by the set() call.
 */
public int edit() throws DBException
{
  if ((this.getRecord().getEditMode() != Constants.EDIT_CURRENT)
    && (this.getRecord().getEditMode() != Constants.EDIT_IN_PROGRESS))
    throw new DBException(Constants.INVALID_RECORD);
  int iErrorCode = this.doEdit(); // Only call if edit is supported by remote db
  if (iErrorCode == Constants.NORMAL_RETURN)
    this.getRecord().setEditMode(Constants.EDIT_IN_PROGRESS);
  return iErrorCode;
}
/**

代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db

/**
 * Set the current record to this (new) record.
 * NOTE: In the thin model, it is not necessary to call edit() before set.
 * @exception Throws an exception if there is no current record.
 */
public void set(Rec record) throws DBException
{
  if ((this.getRecord().getEditMode() != Constants.EDIT_CURRENT)
    && ((this.getRecord().getEditMode() != Constants.EDIT_IN_PROGRESS)))
      throw new DBException(Constants.INVALID_RECORD);
  m_record = (FieldList)record;
  this.fieldsToData(record);
  this.doSet(record);
  this.setDataSource(null);
  this.getRecord().setEditMode(Constants.EDIT_NONE);
}
/**

代码示例来源:origin: com.tourgeek.thin.app/com.tourgeek.thin.app.booking

fieldListNew.setEditMode(Constants.EDIT_ADD);
fieldListNew.setEditMode(Constants.EDIT_NONE);

相关文章