org.jbundle.model.Task.setLastError()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(13.7k)|赞(0)|评价(0)|浏览(96)

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

Task.setLastError介绍

暂无

代码示例

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

/**
   * 
   */
  public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
  {
    BaseField field = (BaseField)this.getField();
    if ((strValue == null) || (strValue.length() == 0))
      return super.setString(strValue, bDisplayOption, iMoveMode);  // Don't trip change or display
    if (m_iMinimumLength != -1)
      if (strValue.length() < m_iMinimumLength)
    {
      Task task = field.getRecord().getRecordOwner().getTask();
      App application = task.getApplication();
      return task.setLastError(MessageFormat.format(application.getResources(ResourceConstants.ERROR_RESOURCE, true).getString("Too Short"), m_iMinimumLength));
    }
    return super.setString(strValue, bDisplayOption, iMoveMode);
  }
}

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

/**
   * 
   */
  public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
  {
    BaseField field = (BaseField)this.getField();
    if ((strValue == null) || (strValue.length() == 0))
      return super.setString(strValue, bDisplayOption, iMoveMode);  // Don't trip change or display
    if (m_iMinimumLength != -1)
      if (strValue.length() < m_iMinimumLength)
    {
      Task task = field.getRecord().getRecordOwner().getTask();
      App application = task.getApplication();
      return task.setLastError(MessageFormat.format(application.getResources(ResourceConstants.ERROR_RESOURCE, true).getString("Too Short"), m_iMinimumLength));
    }
    return super.setString(strValue, bDisplayOption, iMoveMode);
  }
}

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

/**
   * 
   */
  public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
  {
    BaseField field = (BaseField)this.getField();
    if ((strValue == null) || (strValue.length() == 0))
      return super.setString(strValue, bDisplayOption, iMoveMode);  // Don't trip change or display
    if (m_iMinimumLength != -1)
      if (strValue.length() < m_iMinimumLength)
    {
      Task task = field.getRecord().getRecordOwner().getTask();
      App application = task.getApplication();
      return task.setLastError(MessageFormat.format(application.getResources(ResourceConstants.ERROR_RESOURCE, true).getString("Too Short"), m_iMinimumLength));
    }
    return super.setString(strValue, bDisplayOption, iMoveMode);
  }
}

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

/**
   * Convert and move string to this field.
   * @param strString the state to set the data to.
   * @param bDisplayOption Display the data on the screen if true.
   * @param iMoveMode INIT, SCREEN, or READ move mode.
   * @return The error code (or NORMAL_RETURN).
   */
  public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
  {
    NumberField numberField = (NumberField)this.getField();
    if ((strValue == null) || (strValue.length() == 0))
      return super.setString(strValue, bDisplayOption, iMoveMode);  // Don't trip change or display
    Number tempBinary = null;
    try   {
      tempBinary = (Number)numberField.stringToBinary(strValue);
    } catch (Exception ex)  {
      Task task = numberField.getRecord().getRecordOwner().getTask();
      return task.setLastError(ex.getMessage());
    }
    double dValue = tempBinary.doubleValue();
    if (dValue != 0)
      dValue = dValue / 100;
    return this.setValue(dValue, bDisplayOption, iMoveMode);
  }
}

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

/**
   * Convert and move string to this field.
   * @param strString the state to set the data to.
   * @param bDisplayOption Display the data on the screen if true.
   * @param iMoveMode INIT, SCREEN, or READ move mode.
   * @return The error code (or NORMAL_RETURN).
   */
  public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
  {
    NumberField numberField = (NumberField)this.getField();
    if ((strValue == null) || (strValue.length() == 0))
      return super.setString(strValue, bDisplayOption, iMoveMode);  // Don't trip change or display
    Number tempBinary = null;
    try   {
      tempBinary = (Number)numberField.stringToBinary(strValue);
    } catch (Exception ex)  {
      Task task = numberField.getRecord().getRecordOwner().getTask();
      return task.setLastError(ex.getMessage());
    }
    double dValue = tempBinary.doubleValue();
    if (dValue != 0)
      dValue = dValue / 100;
    return this.setValue(dValue, bDisplayOption, iMoveMode);
  }
}

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

/**
   * Convert and move string to this field.
   * @param strString the state to set the data to.
   * @param bDisplayOption Display the data on the screen if true.
   * @param iMoveMode INIT, SCREEN, or READ move mode.
   * @return The error code (or NORMAL_RETURN).
   */
  public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
  {
    NumberField numberField = (NumberField)this.getField();
    if ((strValue == null) || (strValue.length() == 0))
      return super.setString(strValue, bDisplayOption, iMoveMode);  // Don't trip change or display
    Number tempBinary = null;
    try   {
      tempBinary = (Number)numberField.stringToBinary(strValue);
    } catch (Exception ex)  {
      Task task = numberField.getRecord().getRecordOwner().getTask();
      return task.setLastError(ex.getMessage());
    }
    double dValue = tempBinary.doubleValue();
    if (dValue != 0)
      dValue = dValue / 100;
    return this.setValue(dValue, bDisplayOption, iMoveMode);
  }
}

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

/**
 * Convert and move string to this field.
 * @param strString the state to set the data to.
 * @param bDisplayOption Display the data on the screen if true.
 * @param iMoveMode INIT, SCREEN, or READ move mode.
 * @return The error code (or NORMAL_RETURN).
 */
public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
{        
  try {
    strValue = this.encodeString(strValue);
  } catch (Exception ex) {
    Task task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask();
    return task.setLastError(ex.getMessage());
  }
  return super.setString(strValue, bDisplayOption, iMoveMode);
}
/**

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

/**
 * Convert and move string to this field.
 * @param strString the state to set the data to.
 * @param bDisplayOption Display the data on the screen if true.
 * @param iMoveMode INIT, SCREEN, or READ move mode.
 * @return The error code (or NORMAL_RETURN).
 */
public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
{        
  try {
    strValue = this.encodeString(strValue);
  } catch (Exception ex) {
    Task task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask();
    return task.setLastError(ex.getMessage());
  }
  return super.setString(strValue, bDisplayOption, iMoveMode);
}
/**

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

/**
 * Convert and move string to this field.
 * @param strString the state to set the data to.
 * @param bDisplayOption Display the data on the screen if true.
 * @param iMoveMode INIT, SCREEN, or READ move mode.
 * @return The error code (or NORMAL_RETURN).
 */
public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
{        
  try {
    strValue = this.encodeString(strValue);
  } catch (Exception ex) {
    Task task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask();
    return task.setLastError(ex.getMessage());
  }
  return super.setString(strValue, bDisplayOption, iMoveMode);
}
/**

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

/**
 * Convert and move string to this field.
 * Override this method to convert the String to the actual Physical Data Type.
 * @param bState the state to set the data to.
 * @param bDisplayOption Display the data on the screen if true.
 * @param iMoveMode INIT, SCREEN, or READ move mode.
 * @return The error code (or NORMAL_RETURN).
 */
public int setString(String strString, boolean bDisplayOption, int iMoveMode) // init this field override for other value
{
  try {
    Object objData = Converter.convertObjectToDatatype(strString, this.getDataClass(), null, m_ibScale);
    if (objData == null)
      if (this.getDataClass() != Boolean.class)
        if (!(Number.class.isAssignableFrom(this.getDataClass())))
          if (this.getDataClass() != java.util.Date.class)
            objData = Constants.BLANK;    // To set a null internally, you must call setData directly
    return this.setData(objData, bDisplayOption, iMoveMode);
  } catch (Exception ex)  {
    String strError = ex.getMessage();
    if (strError == null)
      strError = ex.getClass().getName();
    if (this.getRecord() != null)
      if (this.getRecord().getTask() != null)
        return this.getRecord().getTask().setLastError(strError);
    return Constants.ERROR_RETURN;
  }
}
/**

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

/**
 * Convert this source message to the ECXML format.
 * Typically you do not override this method, you override the getTransformer method
 * to supply a XSLT document to do the conversion.
 * @param source The source XML document.
 */
public int convertInternalToExternal(Object recordOwner)
{
  if (this.getConvertToNative() == null)
    return ((RecordOwner)recordOwner).getTask().setLastError("Converter does not exist");
  Object root = this.getConvertToNative().convertInternalToMarshallableObject((RecordOwner)recordOwner);
  if (root != null)
  {
    this.setRawData(root);
    return DBConstants.NORMAL_RETURN;    // Success
  }
  return super.convertInternalToExternal(recordOwner);
}
/**

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

/**
   * The Field has Changed.
   * Make sure this is a valid modulus-7 number, if not, return an error.
   * @param bDisplayOption If true, display the change.
   * @param iMoveMode The type of move being done (init/read/screen).
   * @return The error code (or NORMAL_RETURN if okay).
   */
  public int fieldChanged(boolean bDisplayOption, int iMoveMode)
  { // Read a valid record
    int value = (int)((NumberField)this.getOwner()).getValue();
    if ((value / 10) % 7 != value - (value / 10 * 10))
    {
      Task task = null;
      if (this.getOwner() != null)
        if (this.getOwner().getRecord() != null)
          task = this.getOwner().getRecord().getTask();
      String strError = "Incorrect Magic number";
      if (task != null)
      {
        strError = ((BaseApplication)task.getApplication()).getResources(ResourceConstants.ERROR_RESOURCE, true).getString(strError);
        return task.setLastError(strError);
      }
      return DBConstants.ERROR_RETURN;
    }
    return super.fieldChanged(bDisplayOption, iMoveMode);
  }
}

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.acctpay.screen

/**
 * FieldChanged Method.
 */
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
  int iErrorCode = super.fieldChanged(bDisplayOption, iMoveMode);
  Record recVendor = ((ReferenceField)this.getOwner()).getReference();
  if (recVendor != null)
  {
    if (!recVendor.getField(m_fsVendorCurrency).equals(m_fldBankCurrency))
    {
      Task task = this.getOwner().getRecord().getRecordOwner().getTask();
      BaseApplication app = (BaseApplication)task.getApplication();
      String strError = app.getResources(ResourceConstants.ACCTPAY_RESOURCE, true).getString("Vendor currency must match bank currency");
      iErrorCode = task.setLastError(strError);
      this.getOwner().setData(null);
    }
  }
  return iErrorCode;
}

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

/**
   * The Field has Changed.
   * Make sure this is a valid modulus-7 number, if not, return an error.
   * @param bDisplayOption If true, display the change.
   * @param iMoveMode The type of move being done (init/read/screen).
   * @return The error code (or NORMAL_RETURN if okay).
   */
  public int fieldChanged(boolean bDisplayOption, int iMoveMode)
  { // Read a valid record
    int value = (int)((NumberField)this.getOwner()).getValue();
    if ((value / 10) % 7 != value - (value / 10 * 10))
    {
      Task task = null;
      if (this.getOwner() != null)
        if (this.getOwner().getRecord() != null)
          task = this.getOwner().getRecord().getTask();
      String strError = "Incorrect Magic number";
      if (task != null)
      {
        strError = ((BaseApplication)task.getApplication()).getResources(ResourceConstants.ERROR_RESOURCE, true).getString(strError);
        return task.setLastError(strError);
      }
      return DBConstants.ERROR_RETURN;
    }
    return super.fieldChanged(bDisplayOption, iMoveMode);
  }
}

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

/**
   * The Field has Changed.
   * Make sure this is a valid modulus-7 number, if not, return an error.
   * @param bDisplayOption If true, display the change.
   * @param iMoveMode The type of move being done (init/read/screen).
   * @return The error code (or NORMAL_RETURN if okay).
   */
  public int fieldChanged(boolean bDisplayOption, int iMoveMode)
  { // Read a valid record
    int value = (int)((NumberField)this.getOwner()).getValue();
    if ((value / 10) % 7 != value - (value / 10 * 10))
    {
      Task task = null;
      if (this.getOwner() != null)
        if (this.getOwner().getRecord() != null)
          task = this.getOwner().getRecord().getTask();
      String strError = "Incorrect Magic number";
      if (task != null)
      {
        strError = ((BaseApplication)task.getApplication()).getResources(ResourceConstants.ERROR_RESOURCE, true).getString(strError);
        return task.setLastError(strError);
      }
      return DBConstants.ERROR_RETURN;
    }
    return super.fieldChanged(bDisplayOption, iMoveMode);
  }
}

代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.acctpay.screen

/**
 * FieldChanged Method.
 */
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
  int iErrorCode = super.fieldChanged(bDisplayOption, iMoveMode);
  Record recVendor = ((ReferenceField)this.getOwner()).getReference();
  if (recVendor != null)
  {
    if (!recVendor.getField(m_fsVendorCurrency).equals(m_fldBankCurrency))
    {
      Task task = this.getOwner().getRecord().getRecordOwner().getTask();
      BaseApplication app = (BaseApplication)task.getApplication();
      String strError = app.getResources(ResourceConstants.ACCTPAY_RESOURCE, true).getString("Vendor currency must match bank currency");
      iErrorCode = task.setLastError(strError);
      this.getOwner().setData(null);
    }
  }
  return iErrorCode;
}

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

return this.getOwner().getTask().setLastError("Main key cannot be null");
return DBConstants.ERROR_RETURN;    // Key can't be null!

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

/**
 * Field must be non-numeric.
 */
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
  String string = this.getOwner().toString();
  if (Utility.isNumeric(string))
  {
    Task task = null;
    if (this.getOwner() != null)
      if (this.getOwner().getRecord() != null)
        if (this.getOwner().getRecord().getRecordOwner() != null)
          task = this.getOwner().getRecord().getRecordOwner().getTask();
    if (task == null)
      task = BaseApplet.getSharedInstance();
    return task.setLastError("Must be non-numeric");
  }
  return super.fieldChanged(bDisplayOption, iMoveMode);
}

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

/**
 * Field must be non-numeric.
 */
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
  String string = this.getOwner().toString();
  if (Utility.isNumeric(string))
  {
    Task task = null;
    if (this.getOwner() != null)
      if (this.getOwner().getRecord() != null)
        if (this.getOwner().getRecord().getRecordOwner() != null)
          task = this.getOwner().getRecord().getRecordOwner().getTask();
    if (task == null)
      task = BaseApplet.getSharedInstance();
    return task.setLastError("Must be non-numeric");
  }
  return super.fieldChanged(bDisplayOption, iMoveMode);
}

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.booking.db

return this.getOwner().getRecord().getRecordOwner().getTask().setLastError("Can't se-select options");

相关文章