Package hidb2.kern

Examples of hidb2.kern.ValuedInstance


      Image img = null;

      // The Element is a ValuedInstance
      if (_mapAttr[columnIndex].getType() == AttrType.T_Image)
        {
        ValuedInstance vi = (ValuedInstance) element;

        AttrImage ai = (AttrImage) vi.getValue(_mapIdx[columnIndex]);

        if (ai != null)
          {
          img = ai.getSqrImage(getTable().getDisplay(), _maxIconSize);
          }
View Full Code Here


      }

    public String getColumnText(Object element, int columnIndex)
      {
      // The Element is a ValuedInstance
      ValuedInstance vi = (ValuedInstance) element;

      Object val = vi.getValue(_mapIdx[columnIndex]);

      String s = _mapAttr[columnIndex].format(val);

      return s;
      }
View Full Code Here

      _colIdx = colIndex;
      }

    public int compare(Viewer viewer, Object e1, Object e2)
      {
      ValuedInstance vi1 = (ValuedInstance) e1;
      ValuedInstance vi2 = (ValuedInstance) e2;

      return Util.compare((Comparable<?>) vi1.getValue(_mapIdx[_colIdx]), (Comparable<?>) vi2
          .getValue(_mapIdx[_colIdx]));
      }
View Full Code Here

    @Override
    public Object getValue(Object element, String property)
      {
      int idx = getPropIndex(property);

      ValuedInstance vi = (ValuedInstance) element;

      Object o = vi.getValue(_mapIdx[idx]);

      Attribut attr = _fd.getAttributList().get(_mapIdx[idx]);

      if ((attr.getType() == AttrType.T_RefList) && (o != null))
        {
View Full Code Here

    public void modify(Object element, String property, Object value)
      {
      if (value != null)
        {
        int idx = getPropIndex(property);
        ValuedInstance vi = (ValuedInstance) ((TableItem) element).getData();

        Attribut attr = _fd.getAttributList().get(_mapIdx[idx]);

        switch (attr.getType())
          {
          case T_Date:
            value = new java.sql.Date(((Date) value).getTime());
            break;

          case T_Time:
            value = new Time(((Date) value).getTime());
            break;

          case T_TimeStamp:
            value = new Timestamp(((Date) value).getTime());
            break;

          case T_RefList:
            int index = (Integer) value;

            AttrEnumItemChecker aei = (AttrEnumItemChecker) attr.getChecker();

            value = aei.getLstEnumItem().get(index);
            break;
          }

        vi.setValue(_mapIdx[idx], value);

        update(vi, new String[]
          {
            property
          });
View Full Code Here

      Image img = null;

      // The Element is a ValuedInstance
      if (_mapAttr[columnIndex].getType() == AttrType.T_Image)
        {
        ValuedInstance vi = (ValuedInstance) element;

        AttrImage ai = (AttrImage) vi.getValue(_mapIdx[columnIndex]);

        if (ai != null)
          {
          img = ai.getSqrImage(getTable().getDisplay(), _maxIconSize);
          }
View Full Code Here

      }

    public String getColumnText(Object element, int columnIndex)
      {
      // The Element is a ValuedInstance
      ValuedInstance vi = (ValuedInstance) element;

      Object val = vi.getValue(_mapIdx[columnIndex]);
     
      String s = _mapAttr[columnIndex].format(val);

      return s;
      }
View Full Code Here

      _colIdx = colIndex;
      }

    public int compare(Viewer viewer, Object e1, Object e2)
      {
      ValuedInstance vi1 = (ValuedInstance) e1;
      ValuedInstance vi2 = (ValuedInstance) e2;

      return Util.compare((Comparable<?>) vi1.getValue(_mapIdx[_colIdx]), (Comparable<?>) vi2
          .getValue(_mapIdx[_colIdx]));
      }
View Full Code Here

    @Override
    public Object getValue(Object element, String property)
      {
      int idx = getPropIndex(property);

      ValuedInstance vi = (ValuedInstance) element;

      Object o = vi.getValue(_mapIdx[idx]);

      Attribut attr = _fd.getAttributList().get(_mapIdx[idx]);

      if ((attr.getType() == AttrType.T_RefList) && (o!=null))
        {
View Full Code Here

    public void modify(Object element, String property, Object value)
      {
      if (value != null)
        {
        int idx = getPropIndex(property);
        ValuedInstance vi = (ValuedInstance) ((TableItem) element).getData();

        Attribut attr = _fd.getAttributList().get(_mapIdx[idx]);

        switch (attr.getType())
          {
          case T_Date:
            value = new java.sql.Date(((Date) value).getTime());
            break;

          case T_Time:
            value = new Time(((Date) value).getTime());
            break;

          case T_TimeStamp:
            value = new Timestamp(((Date) value).getTime());
            break;

          case T_RefList:
            int index = (Integer) value;

            AttrEnumItemChecker aei = (AttrEnumItemChecker) attr.getChecker();

            value = aei.getLstEnumItem().get(index);
            break;
          }

        vi.setValue(_mapIdx[idx], value);

        update(vi, new String[]
          {
            property
          });
View Full Code Here

TOP

Related Classes of hidb2.kern.ValuedInstance

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.