Package hidb2.kern

Examples of hidb2.kern.AttrLayout


              if (rc == C_OK)
                {
                // Display search results
                for (FolderSearchResult fsr : lstSR)
                  {
                  FolderDescription fd = null;
                  CardDescription cd = null;
                  boolean isCard = false;

                  // Retrieve FolderDescription
                  AttributedDescription ad = das.find(fsr.getTableName());
View Full Code Here


   */
  protected void pageChange(int newPageIndex)
    {
    super.pageChange(newPageIndex);

    FolderDescription fd = getFD();

    switch (newPageIndex)
      {
      case 0:
        setPartName(fd.getName());

        _fNameEntry.setValue(fd.getName(), true);

        _fCmtEntry.setValue(fd.getComment(), true);

        _fIdxIconEntry.setValue(Integer.toString(fd.getIconAttrIndex()), true);

        _fIdxLabelEntry.setValue(Integer.toString(fd.getLabelAttrIndex()), true);

        // Fill Statistic fields
        _fMainTable.setValue(fd.getTName(), true);
        _fCardTable.setValue(fd.getCardDescription().getTName(), true);

        fd.updateStats(Application.getDataStore());
        _fNbInstance.setValue(Long.toString(fd.getNbInstance()), true);
        break;

      case 1:
        _tabvFdAttr.setDescr(fd);
        break;

      case 2:
        _tabvCdAttr.setDescr(fd.getCardDescription());
        break;

      case 3:
        // Check if layout data are created or read
        if (_adLayout == null)
          {
          _adLayout = Application.getDataStore().readLayout(fd);
          }

        if (_cdLayout == null)
          {
          _cdLayout = Application.getDataStore().readLayout(fd.getCardDescription());
          }

        // Fill layout general fields
        _lsMainLayout.setLayout(_adLayout);
        _lsCardLayout.setLayout(_cdLayout);
View Full Code Here

    try
      {
      // Open the default database
      String dbDir = Activator.getDefault().getPreferenceStore().getString(PrefConst.P_DB_DIR);

      _das = new H2DataStore(dbDir);

      int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
      if (returnCode == PlatformUI.RETURN_RESTART)
        {
        return IApplication.EXIT_RESTART;
View Full Code Here

    try
      {
      // Open the default database
      String dbDir = Activator.getDefault().getPreferenceStore().getString(PrefConst.P_DB_DIR);

      _das = new H2DataStore(dbDir);

      if (_das.getOpenStatus() == HIDBConst.C_OK)
        {
        int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
        if (returnCode == PlatformUI.RETURN_RESTART)
View Full Code Here

    /*Button btnAddAfter =*/toolkit.createGridButton(containerBtn, "Add", new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          QueryAttr qa = new QueryAttr();
          _query.lstQAttr.add(qa);
          _tbl.refresh();
          }
      });

    /*Button btnRem =*/toolkit.createGridButton(containerBtn, "Delete", new SelectionAdapter()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
          {
          ISelection selection = _tbl.getSelection();
          if (!selection.isEmpty())
            {
            Object obj = ((IStructuredSelection) selection).getFirstElement();
            QueryAttr qattr = (QueryAttr) obj;

            // Execute the deletion
            _query.lstQAttr.remove(qattr);

            _tbl.refresh();
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.AttrLayout

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.