Package net.pleso.framework.client.dal.db

Examples of net.pleso.framework.client.dal.db.IDBValue


 
  /**
   * Validation of rule "start date must be earlier than end date"
   */
  private void validateStartLessEqualEnd(){
    IDBValue startValue = calendarDataControlStart.getValue();
    IDBValue endValue = calendarDataControlEnd.getValue();
    if (!startValue.isNull() && !endValue.isNull()){
      // the value 0 if the argument Date is equal to this Date;
      // a value less than 0 if this Date is before the Date argument;
      // and a value greater than 0 if this Date is after the Date argument.
      if (((DBDate) startValue).getDate().compareTo(((DBDate) endValue).getDate()) > 0){
        showError(FrameworkLocale.messages().startdate_less_or_equal_enddate());
View Full Code Here


   * @see net.pleso.framework.client.ui.controls.dataGrid.interfaces.IDataBinder#bindRow(net.pleso.framework.client.ui.controls.dataGrid.interfaces.IDataGridRow)
   */
  public void bindRow(IDataGridRow dataGridRow) {
    for (int i = 0; i < columns.length; ++i) {
      // by default value in cell is empty string value
      IDBValue value = new DBString();

      // first check parent data column type - IRBDataColumn
      if (columns[i] instanceof IRBDataColumn) {
        value = ((IDataRow) dataGridRow.getDataRow())
            .getCell(((IRBDataColumn) columns[i]).getDataColumn());

        if (value != null) {
          // if value is boolean value
          if (value instanceof DBBoolean) {
            // set special widget for boolean values
            // all another types shows default handler
            dataGridRow.setCellWidget(i, new BooleanValueWidget((DBBoolean) value));
            continue;
          }
        }
      }

      // check IRBEnumDataColumn
      if (columns[i] instanceof IRBEnumDataColumn) {
        String stringValue = getEnumValue(value,
            ((IRBEnumDataColumn) columns[i]).getEnum());

        if (stringValue == null)
          dataGridRow.setCellWidget(i, new HTML("&nbsp;"));
        else
          dataGridRow.setCellText(i, stringValue);
        continue;
      }

      // insert handlers for your IRB data solumns types HERE !

      // default handler of value without check columns types
      if (value == null) {
        dataGridRow.setCellWidget(i, new HTML("&nbsp;"));
      } else {
        if (value.isNull())
          dataGridRow.setCellWidget(i, new HTML("&nbsp;"));
        else
          dataGridRow.setCellText(i, value.getValue());
      }
    }

    checkRowClassifier(dataGridRow);
  }
View Full Code Here

      // If this is range edit item.
      if (items[i] instanceof IEditRangeFormItem) {
        // Interface type cast.
        IEditRangeFormItem item = (IEditRangeFormItem) items[i];
        // Getting values for DB type detecting.
        IDBValue valueLow = dataRow.getCell(item
            .getLowBoundDataColumn());
        IDBValue valueHigh = dataRow.getCell(item
            .getHighBoundDataColumn());

        // If this is date range.
        if (valueLow instanceof DBDate && valueHigh instanceof DBDate) {
          DateRangeControl ctrl = new DateRangeControl();
          ctrl.bind(dataRow, item.getLowBoundDataColumn(), item
              .getHighBoundDataColumn());
          addedControl = ctrl;
        }
        // If this is floats range.
        else if (valueLow instanceof DBFloat
            && valueHigh instanceof DBFloat) {
          FloatRangeControl ctrl = new FloatRangeControl();
          ctrl.bind(dataRow, item.getLowBoundDataColumn(), item
              .getHighBoundDataColumn());
          addedControl = ctrl;
        }
        // If this is time range.
        else if (valueLow instanceof DBStringTime
            && valueHigh instanceof DBStringTime) {
          TimeRangeControl ctrl = new TimeRangeControl();
          ctrl.bind(dataRow, item.getLowBoundDataColumn(), item
              .getHighBoundDataColumn());
          addedControl = ctrl;
        } else
          throw new NotImplementedFeatureException(
              "There is no implementation to edit range of types "
                  + GWT.getTypeName(valueLow) + " and "
                  + GWT.getTypeName(valueHigh) + ".");
       
      } else
      // If this is simple editable column.
      if (items[i] instanceof IEditColumnFormItem) {
        // Interface type cast.
        IEditColumnFormItem item = (IEditColumnFormItem) items[i];
        // Getting value for DB type detecting.
        IDBValue value = dataRow.getCell(item.getDataColumn());

        ISingleColumnBind ctrl = null;

        // If this is multiline edited item.
        if (item instanceof IMultilineEditFormItem
View Full Code Here

 
  /**
   * Validation of rule "start time must be earlier than end time"
   */
  private void validateStartLessEqualEnd(){
    IDBValue startValue = textBoxDataControlStart.getValue();
    IDBValue endValue = textBoxDataControlEnd.getValue();
    if (!startValue.isNull() && !endValue.isNull()){
      // the value 0 if the argument Date is equal to this Date;
      // a value less than 0 if this Date is before the Date argument;
      // and a value greater than 0 if this Date is after the Date argument.
      if (((DBStringTime) startValue).getStringDate().compareTo(((DBStringTime) endValue).getStringDate()) > 0){
        showError(FrameworkLocale.messages().starttime_less_or_equal_enddate());
View Full Code Here

 
  /**
   * Validation of rule "start value must be less than end value"
   */
  private void validateStartLessEqualEnd(){
    IDBValue startValue = floatDataControlStart.getValue();
    IDBValue endValue = floatDataControlEnd.getValue();
    if (!startValue.isNull() && !endValue.isNull()){
      if (((DBFloat) startValue).getFloat().compareTo(((DBFloat) endValue).getFloat()) > 0){
        showError(FrameworkLocale.messages().start_float_less_or_equal_end_float());
      }
    }
  }
View Full Code Here

   * Sets null value in column
   * @param row row with value
   * @param column column of value
   */
  public static void setNull(IDataRow row, IDataColumn column) {
    IDBValue value = row.getCell(column);
    value.setNull();
    row.setCell(column, value);
  }
View Full Code Here

TOP

Related Classes of net.pleso.framework.client.dal.db.IDBValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.