org.jbundle.base.db.Record.isOpen()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(12.6k)|赞(0)|评价(0)|浏览(80)

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

Record.isOpen介绍

[英]Is this record's table open?
[中]这张唱片的桌子开着吗?

代码示例

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

/**
 * Special logic to open a QueryRecord using the tables.
 * @exception DBException File exception.
 */
public void openTableQuery() throws DBException
{
  Record record = null;
  boolean bFirstTime = true;
  for (Enumeration<TableLink> e = m_LinkageList.elements() ; e.hasMoreElements() ;)
  {
    TableLink tableLink = e.nextElement();
    record = tableLink.getLeftRecord();
    if (bFirstTime)
    {
      if (!record.isOpen())
        record.open();
    }
    record = tableLink.getRightRecord();
     if (!record.isOpen())
      record.open();
    bFirstTime = false;
  }
}
/**

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

/**
 * Special logic to open a QueryRecord using the tables.
 * @exception DBException File exception.
 */
public void openTableQuery() throws DBException
{
  Record record = null;
  boolean bFirstTime = true;
  for (Enumeration<TableLink> e = m_LinkageList.elements() ; e.hasMoreElements() ;)
  {
    TableLink tableLink = e.nextElement();
    record = tableLink.getLeftRecord();
    if (bFirstTime)
    {
      if (!record.isOpen())
        record.open();
    }
    record = tableLink.getRightRecord();
     if (!record.isOpen())
      record.open();
    bFirstTime = false;
  }
}
/**

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

/**
 * Special logic to open a QueryRecord using the tables.
 * @exception DBException File exception.
 */
public void openTableQuery() throws DBException
{
  Record record = null;
  boolean bFirstTime = true;
  for (Enumeration<TableLink> e = m_LinkageList.elements() ; e.hasMoreElements() ;)
  {
    TableLink tableLink = e.nextElement();
    record = tableLink.getLeftRecord();
    if (bFirstTime)
    {
      if (!record.isOpen())
        record.open();
    }
    record = tableLink.getRightRecord();
     if (!record.isOpen())
      record.open();
    bFirstTime = false;
  }
}
/**

代码示例来源:origin: org.jbundle.base.screen/org.jbundle.base.screen.model

/**
 * Get the next record.
 * This is the special method for a report. It handles breaks by disabling all listeners
 * except filter listeners, then reenabling and calling the listeners after the footing
 * has been printed, so totals, etc will be in the next break.
 * @param out The out stream.
 * @param iPrintOptions Print options.
 * @param bFirstTime Reading the first record?
 * @param bHeadingFootingExists Does a break exist (skips all the fancy code if not).
 * @return The next record (or null if EOF).
 */
public Record getNextRecord(PrintWriter out, int iPrintOptions, boolean bFirstTime, boolean bHeadingFootingExists)
  throws DBException
{
  Object[] rgobjEnabled = null;
  boolean bAfterRequery = !this.getMainRecord().isOpen();
  if (!this.getMainRecord().isOpen())
    this.getMainRecord().open();    // Make sure any listeners are called before disabling.
  if (bHeadingFootingExists)
    rgobjEnabled = this.getMainRecord().setEnableNonFilter(null, false, false, false, false, true);
  Record record = this.getNextGridRecord(bFirstTime);
  if (bHeadingFootingExists)
  {
    boolean bBreak = this.printHeadingFootingData(out, iPrintOptions | HtmlConstants.FOOTING_SCREEN | HtmlConstants.DETAIL_SCREEN);
    this.getMainRecord().setEnableNonFilter(rgobjEnabled, (record != null), bBreak, bFirstTime | bAfterRequery, (record == null), true);
  }
  return record;
}
/**

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

/**
 * Get the next record.
 * This is the special method for a report. It handles breaks by disabling all listeners
 * except filter listeners, then reenabling and calling the listeners after the footing
 * has been printed, so totals, etc will be in the next break.
 * @param out The out stream.
 * @param iPrintOptions Print options.
 * @param bFirstTime Reading the first record?
 * @param bHeadingFootingExists Does a break exist (skips all the fancy code if not).
 * @return The next record (or null if EOF).
 */
public Record getNextRecord(PrintWriter out, int iPrintOptions, boolean bFirstTime, boolean bHeadingFootingExists)
  throws DBException
{
  Object[] rgobjEnabled = null;
  boolean bAfterRequery = !this.getMainRecord().isOpen();
  if (!this.getMainRecord().isOpen())
    this.getMainRecord().open();    // Make sure any listeners are called before disabling.
  if (bHeadingFootingExists)
    rgobjEnabled = this.getMainRecord().setEnableNonFilter(null, false, false, false, false, true);
  Record record = this.getNextGridRecord(bFirstTime);
  if (bHeadingFootingExists)
  {
    boolean bBreak = this.printHeadingFootingData(out, iPrintOptions | HtmlConstants.FOOTING_SCREEN | HtmlConstants.DETAIL_SCREEN);
    this.getMainRecord().setEnableNonFilter(rgobjEnabled, (record != null), bBreak, bFirstTime | bAfterRequery, (record == null), true);
  }
  return record;
}
/**

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

/**
 * Set the object that owns this listener.
 * @owner The object that this listener is being added to (if null, this listener is being removed).
 */
public void setOwner(ListenerOwner owner)
{
  super.setOwner(owner);
  if (owner == null)
    return;
  try   {     // Open this table and move to the control record
    if (!this.getOwner().isOpen())
      this.getOwner().open();     // Open the control file
    if (this.getOwner().getEditMode() == Constants.EDIT_NONE)
      this.doNewRecord(true);     // Read the control file
  } catch (DBException e)   {
    return;
  }
}
/**

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

/**
 * Set the object that owns this listener.
 * @owner The object that this listener is being added to (if null, this listener is being removed).
 */
public void setOwner(ListenerOwner owner)
{
  super.setOwner(owner);
  if (owner == null)
    return;
  try   {     // Open this table and move to the control record
    if (!this.getOwner().isOpen())
      this.getOwner().open();     // Open the control file
    if (this.getOwner().getEditMode() == Constants.EDIT_NONE)
      this.doNewRecord(true);     // Read the control file
  } catch (DBException e)   {
    return;
  }
}
/**

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

/**
 * Called when a new blank record is required for the table/query.
 * @param bDisplayOption If true, display any changes.
 */
public void doNewRecord(boolean bDisplayOption)
{
  super.doNewRecord(bDisplayOption);
  if (this.getOwner().isOpen())   // Don't do first time!
  {
    String strUserID = ((BaseApplication)this.getOwner().getRecordOwner().getTask().getApplication()).getUserID();
    int iUserID = -1;
    if ((strUserID != null) && (strUserID.length() > 0))
      iUserID = Integer.parseInt(strUserID);
    this.getOwner().getField(UserInfo.kID).setValue(iUserID);
    String strOldKey = this.getOwner().getKeyName();
    try   {
      this.getOwner().setKeyArea(UserInfo.kIDKey);
      if (!this.getOwner().seek("="))
      {
        this.getOwner().addNew(); // Make a new one
      }
    } catch (DBException ex)    {
      ex.printStackTrace();
    } finally   {
      this.getOwner().setKeyArea(strOldKey);
    }
  }
}
/**

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

/**
 * Set the field or file that owns this listener.
 * This method calls doNewRecord when the owner is set.
 * @see doNewRecord.
 * @param owner My owner.
 */
public void setOwner(ListenerOwner owner)
{
  super.setOwner(owner);
  if (owner == null)
    return;
  boolean bEnabledFlag = this.setEnabledListener(true);   // Disabled automatically on setOwner.
  try   {     // Open this table and move to the control record
    if (!this.getOwner().isOpen())
      if (this.isEnabled()) // Not on a slave
        this.getOwner().open();     // Open the control file
    if (this.getOwner().getEditMode() == Constants.EDIT_NONE)
      if (this.isEnabled()) // Not on a slave
        this.doNewRecord(true);     // Read the control file
  } catch (DBException ex)   {
    ex.printStackTrace();
  } finally   {
    this.setEnabledListener(bEnabledFlag);  // Set back
  }
}
/**

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

/**
 * Called when a new blank record is required for the table/query.
 * @param bDisplayOption If true, display any changes.
 */
public void doNewRecord(boolean bDisplayOption)
{
  super.doNewRecord(bDisplayOption);
  if (this.getOwner().isOpen())   // Don't do first time!
  {
    String strUserID = ((BaseApplication)this.getOwner().getRecordOwner().getTask().getApplication()).getUserID();
    int iUserID = -1;
    if ((strUserID != null) && (strUserID.length() > 0))
      iUserID = Integer.parseInt(strUserID);
    this.getOwner().getField(UserInfo.ID).setValue(iUserID);
    String strOldKey = this.getOwner().getKeyName();
    try   {
      this.getOwner().setKeyArea(UserInfo.ID_KEY);
      if (!this.getOwner().seek("="))
      {
        this.getOwner().addNew(); // Make a new one
      }
    } catch (DBException ex)    {
      ex.printStackTrace();
    } finally   {
      this.getOwner().setKeyArea(strOldKey);
    }
  }
}
/**

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

/**
 * Set the field or file that owns this listener.
 * This method calls doNewRecord when the owner is set.
 * @see doNewRecord.
 * @param owner My owner.
 */
public void setOwner(ListenerOwner owner)
{
  super.setOwner(owner);
  if (owner == null)
    return;
  boolean bEnabledFlag = this.setEnabledListener(true);   // Disabled automatically on setOwner.
  try   {     // Open this table and move to the control record
    if (!this.getOwner().isOpen())
      if (this.isEnabled()) // Not on a slave
        this.getOwner().open();     // Open the control file
    if (this.getOwner().getEditMode() == Constants.EDIT_NONE)
      if (this.isEnabled()) // Not on a slave
        this.doNewRecord(true);     // Read the control file
  } catch (DBException ex)   {
    ex.printStackTrace();
  } finally   {
    this.setEnabledListener(bEnabledFlag);  // Set back
  }
}
/**

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

/**
 * Set the field or file that owns this listener.
 * This method calls doNewRecord when the owner is set.
 * @see doNewRecord.
 * @param owner My owner.
 */
public void setOwner(ListenerOwner owner)
{
  super.setOwner(owner);
  if (owner == null)
    return;
  boolean bEnabledFlag = this.setEnabledListener(true);   // Disabled automatically on setOwner.
  try   {     // Open this table and move to the control record
    if (!this.getOwner().isOpen())
      if (this.isEnabled()) // Not on a slave
        this.getOwner().open();     // Open the control file
    if (this.getOwner().getEditMode() == Constants.EDIT_NONE)
      if (this.isEnabled()) // Not on a slave
        this.doNewRecord(true);     // Read the control file
  } catch (DBException ex)   {
    ex.printStackTrace();
  } finally   {
    this.setEnabledListener(bEnabledFlag);  // Set back
  }
}
/**

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

boolean bAfterRequery = !this.getBaseRecord().isOpen();
if (!this.isOpen())
  this.open();    // Make sure any listeners are called before disabling.

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

boolean bAfterRequery = !this.getBaseRecord().isOpen();
if (!this.isOpen())
  this.open();    // Make sure any listeners are called before disabling.

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

boolean bAfterRequery = !this.getBaseRecord().isOpen();
if (!this.isOpen())
  this.open();    // Make sure any listeners are called before disabling.

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

/**
   * Called when a new blank record is required for the table/query.
   * If the file is empty, this does an addNew, otherwise, the first record
   * is read.
   * @param bDisplayOption If true, display any changes.
   */
  public void doNewRecord(boolean bDisplayOption)
  {
    super.doNewRecord(bDisplayOption);
    try   {
      if (this.getOwner().isOpen())   // Don't do first time!
      {
        boolean bOldEnableState = this.isEnabledListener();
        this.setEnabledListener(false);      // Just in case AddNew decides to call this
        this.getOwner().close();
        if (this.getOwner().hasNext())  // records yet?
          this.getOwner().next();
        else
          this.getOwner().addNew(); // Make a new one
        this.setEnabledListener(bOldEnableState);
      }
    } catch (DBException ex)    {
      if (ex.getErrorCode() == DBConstants.FILE_NOT_FOUND)
        if ((this.getOwner().getOpenMode() & DBConstants.OPEN_DONT_CREATE) == DBConstants.OPEN_DONT_CREATE)
          return;   // Special case - they didn't want the table created if not found
      ex.printStackTrace(); // Never
    }
  }
}

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

if (this.isOpen())
  return;   // Can't select after it's open

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

/**
   * Called when a new blank record is required for the table/query.
   * If the file is empty, this does an addNew, otherwise, the first record
   * is read.
   * @param bDisplayOption If true, display any changes.
   */
  public void doNewRecord(boolean bDisplayOption)
  {
    super.doNewRecord(bDisplayOption);
    try   {
      if (this.getOwner().isOpen())   // Don't do first time!
      {
        boolean bOldEnableState = this.isEnabledListener();
        this.setEnabledListener(false);      // Just in case AddNew decides to call this
        this.getOwner().close();
        if (this.getOwner().hasNext())  // records yet?
          this.getOwner().next();
        else
          this.getOwner().addNew(); // Make a new one
        this.setEnabledListener(bOldEnableState);
      }
    } catch (DBException ex)    {
      if (ex.getErrorCode() == DBConstants.FILE_NOT_FOUND)
        if ((this.getOwner().getOpenMode() & DBConstants.OPEN_DONT_CREATE) == DBConstants.OPEN_DONT_CREATE)
          return;   // Special case - they didn't want the table created if not found
      ex.printStackTrace(); // Never
    }
  }
}

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

/**
   * Called when a new blank record is required for the table/query.
   * If the file is empty, this does an addNew, otherwise, the first record
   * is read.
   * @param bDisplayOption If true, display any changes.
   */
  public void doNewRecord(boolean bDisplayOption)
  {
    super.doNewRecord(bDisplayOption);
    try   {
      if (this.getOwner().isOpen())   // Don't do first time!
      {
        boolean bOldEnableState = this.isEnabledListener();
        this.setEnabledListener(false);      // Just in case AddNew decides to call this
        this.getOwner().close();
        if (this.getOwner().hasNext())  // records yet?
          this.getOwner().next();
        else
          this.getOwner().addNew(); // Make a new one
        this.setEnabledListener(bOldEnableState);
      }
    } catch (DBException ex)    {
      if (ex.getErrorCode() == DBConstants.FILE_NOT_FOUND)
        if ((this.getOwner().getOpenMode() & DBConstants.OPEN_DONT_CREATE) == DBConstants.OPEN_DONT_CREATE)
          return;   // Special case - they didn't want the table created if not found
      ex.printStackTrace(); // Never
    }
  }
}

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

if (this.isOpen())
  return;   // Can't select after it's open

相关文章

微信公众号

最新文章

更多

Record类方法