Package net.pleso.framework.client.ui.interfaces

Examples of net.pleso.framework.client.ui.interfaces.ISingleColumnBind


        // 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
            && value instanceof DBString) {
          ctrl = new TextAreaDataControl(
              ((IMultilineEditFormItem) item).getRowsCount());
        } else {
          // Creating control depending on retrieved value type.
          if (value instanceof DBHTMLString)
            ctrl = new RichTextAreaDataControl();
          if (value instanceof DBString)
            ctrl = new TextBoxDataControl();
          else if (value instanceof DBInteger)
            ctrl = new IntegerDataControl();
          else if (value instanceof DBBoolean) {
            if (item.isRequired())
              ctrl = new BooleanDataControl();
            else
              ctrl = new BooleanComboBoxDataControl();
          } else if (value instanceof DBBigInt)
            ctrl = new IntegerDataControl();
          else if (value instanceof DBDate)
            ctrl = new CalendarDataControl();
          else if (value instanceof DBStringTime)
            ctrl = new TextBoxDataControl();
          else if (value instanceof DBFloat)
            ctrl = new FloatDataControl();
        }

        // Binding row and column to control.
        ctrl.bind(dataRow, item.getDataColumn());
        addedControl = (IBindableDataControl) ctrl;

      }
      // If this is read only information enumeration item.
      else if (items[i] instanceof IInfoEnumColumnFormItem) {
        // Creating control.
        InfoDataControl ctrl = new InfoDataControl(
            ((IInfoEnumColumnFormItem) items[i]).getEnum());
        // Binding row and column to control.
        ctrl.bind(dataRow, ((IInfoFormItem) items[i]).getDataColumn());
        addedControl = ctrl;
      } else
      // If this is read only information item.
      if (items[i] instanceof IInfoFormItem) {
        // Creating control.
        InfoDataControl ctrl = new InfoDataControl();
        // Binding row and column to control.
        ctrl.bind(dataRow, ((IInfoFormItem) items[i]).getDataColumn());
        addedControl = ctrl;
      } else
        // Throwing exception for unknown item type.
        throw new NotImplementedFeatureException(
            "Can't build control for type "
View Full Code Here

TOP

Related Classes of net.pleso.framework.client.ui.interfaces.ISingleColumnBind

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.