Package hidb2.gui.util

Examples of hidb2.gui.util.FormEntryAdapter


          }
      });

    _fDescrImgIdx.setEditable(fde.isEditable());

    _tLayoutAttr = new PoserTableViewer(container);
    _tLayoutAttr.addROAttribut("Attr", AttrType.T_Object, "Attribut", 120);
    _tLayoutAttr.addAttribut("Width", AttrType.T_Integer, "Width", 80);
    _tLayoutAttr.addAttribut("Height", AttrType.T_Integer, "Height", 80);

    _tLayoutAttr.createMMI();
View Full Code Here


    panel.setLayout(new GridLayout(1, false));

//    Label labA = new Label(panel, SWT.NONE);
//    labA.setText("Attributes");

    _tbl = new PoserTableViewer(panel, SWT.SINGLE | SWT.FULL_SELECTION);

    GridData gdTbl = new GridData();
    gdTbl.grabExcessHorizontalSpace = true;
    gdTbl.horizontalAlignment = SWT.FILL;
    gdTbl.minimumHeight = 200;
View Full Code Here

    Composite container = toolkit.createComposite(section, SWT.NONE);
    container.setLayout(FormLayoutFactory.createSectionClientTableWrapLayout(false, 2));
    TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
    container.setLayoutData(data);

    _tabvDp = new PoserTableViewer(container, SWT.SINGLE | SWT.FULL_SELECTION);

    TableWrapData data_tabv = new TableWrapData(TableWrapData.FILL_GRAB);
    data_tabv.grabVertical = true;
    data_tabv.heightHint = 100 + 100 + 200;
    _tabvDp.getTable().setLayoutData(data_tabv);
View Full Code Here

    setContentProvider(new GenericTabContentProvider());
    setLabelProvider(new GenericTabLabelProvider());

    // Create Columns
    TableColumn colonne;
    TableSortSelectionListener listener;

    for (int indice = 0; indice < _fd.getAttributList().size(); indice++)
      {
      int wicon = 0;

      Attribut attr = _mapAttr[indice];

      colonne = new TableColumn(tabFile, SWT.LEFT);
      colonne.setText(attr.getName());

      if (attr.getType() == AttrType.T_Image)
        {
        wicon = ((AttrImageChecker) attr.getChecker()).getIconSize();
        if (wicon > _maxIconSize)
          {
          _maxIconSize = wicon;
          }
        }

      colonne.setWidth(Math.max(attr.getColumnWidth(), wicon));

      // Create sorter
      listener = new TableSortSelectionListener(this, colonne, new GenericTabSorter(indice), SWT.UP, false);

      // Initialise sort for 1st column
      if (indice == 0)
        {
        listener.chooseColumnForSorting();
        }
      }

    // Set the editors, cell modifier, and column properties
    setColumnProperties(_columnProp);
View Full Code Here

                      "Give range:", MessageDialog.INFORMATION, new String[]
                        {
                            "Ok", "Cancel"
                        }, 0);

                  AttrChecker curAck = (AttrChecker) getValue();

                  int rmsg = dlg.open(curAck);

                  return (rmsg == 0) ? curAck : null;
                  }
View Full Code Here

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

      if ((attr.getType() == AttrType.T_RefList) && (o != null))
        {
        AttrEnumItemChecker aei = (AttrEnumItemChecker) attr.getChecker();

        int idxName = aei.getLstEnumItem().indexOf(o);

        o = new Integer(idxName);
        }

      return o;
View Full Code Here

            break;

          case T_RefList:
            int index = (Integer) value;

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

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

        vi.setValue(_mapIdx[idx], value);
View Full Code Here

      case T_Color: // Color
        cellEdt = new ColorCellEditor(table);
        break;

      case T_RefList:
        AttrEnumItemChecker aei = (AttrEnumItemChecker) attr.getChecker();

        List<EnumItem> lstEnumItems = aei.getLstEnumItem();

        String[] tabRefListNames = new String[lstEnumItems.size()];

        int ii = 0;
View Full Code Here

                // Check card images files status
                monitor.subTask("Card checking");
                for (Card cd : f.getLstCard())
                  {
                  AttrFile ai = (AttrFile) cd.getValue(attrIdx);

                  if (ai != null)
                    {
                    String absCardFileName = ai.getAbsolutePath();

                    File foundMMFile = null;
                    for (Iterator<File> itfic = lstMMFile.iterator(); itfic.hasNext() && (foundMMFile == null);)
                      {
                      File floc = itfic.next();

                      if (absCardFileName.equals(floc.getAbsolutePath()))
                        {
                        foundMMFile = floc;
                        itfic.remove();
                        }
                      }

                    if (foundMMFile == null)
                      {
                      // Suggest Card Deletion
                      DeltaMMFile dlt = new DeltaMMFile(cd, attrIdx, FileStatus.MISSING);
                      lstDelta.add(dlt);
                      }
                    else
                      {
                      // Check Last modification Date and size
                      Date dateBase = ai.getLastModificationDate();

                      // Get the actual file last modification date
                      long lmd = foundMMFile.lastModified();

                      if (dateBase.getTime() < lmd)
                        {
                        // Suggest Card Update
                        DeltaMMFile dlt = new DeltaMMFile(cd, attrIdx, FileStatus.UPDATED);
                        dlt.setFoundFic(foundMMFile);
                        lstDelta.add(dlt);
                        }
                      else
                        {
                        // Nothing to do with the card, it's up to date
                        }
                      }
                    } // Else the card has a non valued AttrFile
                  }

                monitor.subTask("New File Importation");

                // If the list of read files is not empty, it means that some MM files are not recorded
                // in the database ==> Suggest to create them
                for (File fic : lstMMFile)
                  {
                  DeltaMMFile dlt = new DeltaMMFile(fic);
                  dlt.setFoundFic(fic);

                  AttrImage imgAttr = (AttrImage) a1.create(Application.getDataStore(), fic);

                  if (imgAttr != null)
                    {
                    dlt.setAttrFile(imgAttr);
                    }

                  lstDelta.add(dlt);

                  monitor.worked(1);
                  }

                monitor.done();
                }
            });
          }

        catch (InvocationTargetException e1)
          {
          e1.printStackTrace();
          }

        catch (InterruptedException e1)
          {
          e1.printStackTrace();
          }

        DlgDeltaFile dlg = new DlgDeltaFile(parent);

        res = dlg.open(lstDelta);
        if (res == C_OK)
          {
          for (DeltaMMFile dmmfic : lstDelta)
            {
            Card fcd = dmmfic.getFoundCard();

            switch (dmmfic.getAction())
              {
              case CREATE:
                Card nc = Application.getDataStore().createCard(f);
                nc.setValue(attrIdx, dmmfic.getAttrFile());
                break;

              case DELETE:
                Application.getDataStore().remove(f, fcd);
                break;

              case UPDATE:
                AttrFile atf = (AttrFile) fcd.getValue(attrIdx);
                atf.setLastModificationDate(new Date(dmmfic.getFoundFic().lastModified()));

                if (atf.getStatus() == StatusCycle.UNCHANGED)
                  {
                  atf.setStatus(StatusCycle.MODIFIED);
                  }

                if (fcd.getStatus() == StatusCycle.UNCHANGED)
                  {
                  fcd.setStatus(StatusCycle.MODIFIED);
View Full Code Here

      // 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);
          }
        }

      return img;
      }
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.