Package hidb2.gui.util

Examples of hidb2.gui.util.FormEntryAdapter


      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;
          }
View Full Code Here


    _mapIdx = new int[nbcol];
    _mapCompEditor = new PojoCompEditor[nbcol];

    for (int i = 0; i < nbcol; i++)
      {
      Attribut attr = _layout.getDescr().getAttributList().get(i);
      _mapIdx[attr.getDisplayOrder()] = i;

      if (i != _layout.getImageIdx())
        {
        _mapCompEditor[attr.getDisplayOrder()] = new PojoCompEditor(_edPart, compColumn, _layout.getLstLayout().get(i));
        }
      }
    }
View Full Code Here

    tabv.createMMI(new ITableLabelProvider()
      {
        public Image getColumnImage(Object element, int columnIndex)
          {
          Attribut attr = (Attribut) element;

          if (columnIndex == 0)
            {
            if (attr.getDisplayOrder() == getFD().getIconAttrIndex())
              {
              return RscMan.getImage(RscMan.IN_BOSS);
              }
            else
              {
              if (attr.getDisplayOrder() == getFD().getLabelAttrIndex())
                {
                return RscMan.getImage(RscMan.IN_GREENBOOKMARK);
                }
              }
            }
View Full Code Here

            }
          else
            {
            Object obj = ((IStructuredSelection) selection).getFirstElement();

            Attribut a = (Attribut) obj;

            addidx = a.getDisplayOrder() + 1;
            }

          Attribut at0 = new Attribut(getFD().getID(), T_String);

          getFD().addAttribut(at0, addidx);

          _tabvFdAttr.refresh();
          }
      }, new SelectionAdapter()
      {
        /**
        * Add Before Callback
        */
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          ISelection selection = _tabvFdAttr.getSelection();
          int addidx = 0;

          if (selection.isEmpty())
            {
            Object obj = ((IStructuredSelection) selection).getFirstElement();

            Attribut a = (Attribut) obj;

            addidx = Math.max(0, a.getDisplayOrder() - 1);
            }

          Attribut at0 = new Attribut(getFD().getID(), T_String);

          getFD().addAttribut(at0, addidx);

          _tabvFdAttr.refresh();
          }
      }, new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          ISelection selection = _tabvFdAttr.getSelection();
          Object obj = ((IStructuredSelection) selection).getFirstElement();
          Attribut attr = (Attribut) obj;

          // Get confirmation
          boolean rb = MessageDialog.openConfirm(_tabvFdAttr.getControl().getShell(), "Delete Attribute",
              "Do you confirm the deletion of Attribut:" + attr.getName() + "\nType:" + attr.getType().name);

          if (rb)
            {
            // Execute the deletion
            getFD().removeAttribut(attr);

            _tabvFdAttr.refresh();
            }
          }
      }, new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          ISelection selection = _tabvFdAttr.getSelection();

          if (!selection.isEmpty())
            {
            Object obj = ((IStructuredSelection) selection).getFirstElement();

            Attribut a = (Attribut) obj;

            int r = getFD().changeAttributPosition(a, false);
            if (r == C_OK)
              {
              setDirty(true);
              }

            _tabvFdAttr.refresh();
            }
          }
      }, new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          ISelection selection = _tabvFdAttr.getSelection();

          if (!selection.isEmpty())
            {
            Object obj = ((IStructuredSelection) selection).getFirstElement();

            Attribut a = (Attribut) obj;

            int r = getFD().changeAttributPosition(a, true);
            if (r == C_OK)
              {
              setDirty(true);
View Full Code Here

    _tabvCdAttr = createTabAttrSection(form, "Card Attributes", new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          Attribut at0 = new Attribut(getFD().getCardDescription().getID(), T_String);

          getFD().getCardDescription().addAttribut(at0, 0);

          _tabvCdAttr.refresh();
          }
      }, new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          Attribut at0 = new Attribut(getFD().getCardDescription().getID(), T_String);

          getFD().getCardDescription().addAttribut(at0, 0);

          _tabvCdAttr.refresh();
          }
      }, new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          ISelection selection = _tabvCdAttr.getSelection();
          Object obj = ((IStructuredSelection) selection).getFirstElement();
          Attribut attr = (Attribut) obj;

          // Get confirmation
          boolean rb = MessageDialog.openConfirm(_tabvFdAttr.getControl().getShell(), "Delete Attribute",
              "Do you confirm the deletion of Attribut:" + attr.getName() + "\nType:" + attr.getType().name);

          if (rb)
            {
            // Execute the deletion
            getFD().getCardDescription().removeAttribut(attr);

            _tabvCdAttr.refresh();
            }
          }
      }, new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          ISelection selection = _tabvCdAttr.getSelection();

          if (!selection.isEmpty())
            {
            Object obj = ((IStructuredSelection) selection).getFirstElement();

            Attribut a = (Attribut) obj;

            int r = getFD().getCardDescription().changeAttributPosition(a, false);
            if (r == C_OK)
              {
              setDirty(true);
              }

            _tabvCdAttr.refresh();
            }
          }
      }, new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          ISelection selection = _tabvCdAttr.getSelection();

          if (!selection.isEmpty())
            {
            Object obj = ((IStructuredSelection) selection).getFirstElement();

            Attribut a = (Attribut) obj;

            int r = getFD().getCardDescription().changeAttributPosition(a, true);
            if (r == C_OK)
              {
              setDirty(true);
View Full Code Here

    ISelection selection = _tabvFolder.getSelection();
    if (!selection.isEmpty())
      {
      Folder f = (Folder) ((IStructuredSelection) selection).getFirstElement();

      Attribut a1 = null;
      for (Attribut a : _inpFd.getCardDescription().getAttributList())
        {
        if (a.getType() == AttrType.T_Image)
          {
          a1 = a;
View Full Code Here

      Object obj = ((IStructuredSelection) selection).getFirstElement();

      addidx = _descr.getAttributList().indexOf(obj) + 1;
      }

    Attribut at0 = new Attribut(_descr.getID(), T_String);

    _descr.addAttribut(at0, addidx);

    refresh();
    }
View Full Code Here

      Object obj = ((IStructuredSelection) selection).getFirstElement();

      addidx = Math.max(0, _descr.getAttributList().indexOf(obj) - 1);
      }

    Attribut at0 = new Attribut(_descr.getID(), T_String);

    _descr.addAttribut(at0, addidx);

    refresh();
    }
View Full Code Here

   */
  public static void BrowseCard(Shell parent, Folder f)
    {
    AttributedDescription descr = ((FolderDescription) f.getDescription()).getCardDescription();

    Attribut a1 = descr.find(AttrType.T_Image);
    if (a1 != null)
      {
      int attrIdx = descr.getAttributList().indexOf(a1);

      List<Card> lstCard = f.getLstCard();
View Full Code Here

  public static int massImport(Shell parent, Folder f)
    {
    int res = C_OK;

    // Open the mapping dialog (does not exist for the moment)
    Attribut a1 = ((FolderDescription) f.getDescription()).getCardDescription().find(AttrType.T_Image);
    if (a1 != null)
      {
      // Keep previous dialog -> Keep memory of last directory
      if (_dd == null)
        {
View Full Code Here

TOP

Related Classes of hidb2.gui.util.FormEntryAdapter

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.