Package org.openswing.swing.domains.java

Examples of org.openswing.swing.domains.java.Domain


        t = vo.getColumnSqlType();

        if (vo.getColumnValues()!=null && vo.getColumnValues().size()>0) {
          // column is a combo box...
          col = new ComboColumn();
          Domain domain = new Domain(vo.getColumnName());
          for(int j=0;j<vo.getColumnValues().size();j++)
            domain.addDomainPair(vo.getColumnValues().get(j),vo.getColumnValues().get(j).toString());
          ((ComboColumn)col).setDomain(domain);
        }
        else if (fks.containsKey(vo.getColumnName()) &&
                 t!=Types.DATE && t!=Types.TIMESTAMP && t!=Types.TIME) {
          // lookup...
View Full Code Here


  /**
   * Retrieve item types and fill in the item types combo box.
   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    colItemType.setDomain(d);
    colItemType.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED) {
          PriceVO vo = (PriceVO)pricesGrid.getVOListTableModel().getObjectForRow(pricesGrid.getSelectedRow());
          PricelistVO pricelistVO = (PricelistVO)getPricesGrid().getOtherGridParams().get(ApplicationConsts.PRICELIST);
          vo.setItemCodeItm01SAL02(null);
          int selIndex = ((JComboBox)e.getSource()).getSelectedIndex();
          Object selValue = d.getDomainPairList()[selIndex].getCode();
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,pricelistVO.getCompanyCodeSys01SAL01());
          itemDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);
          itemDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);
          itemDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,pricelistVO.getCompanyCodeSys01SAL01());
View Full Code Here

  /**
   * Retrieve item types and fill in the item types combo box.
   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    colItemType.setDomain(d);

    HashSet buttonsToDisable = new HashSet();
View Full Code Here

    colUmCode.setPreferredWidth(40);

    deleteButton1.setEnabled(false);
    exportButton1.setEnabled(false);

    Domain saleDocTypeDomain = new Domain("SALE_DOC_TYPE_2");
    saleDocTypeDomain.addDomainPair(ApplicationConsts.SALE_ORDER_DOC_TYPE,"sale order");
    saleDocTypeDomain.addDomainPair(ApplicationConsts.SALE_CONTRACT_DOC_TYPE,"sale contract");
    saleDocTypeDomain.addDomainPair(ApplicationConsts.SALE_DESK_DOC_TYPE,"desk selling");
    saleDocTypeDomain.addDomainPair(ApplicationConsts.DELIVERY_REQUEST_DOC_TYPE,"delivery request");

    colDocType.setDomain(saleDocTypeDomain);
    colDocType.setColumnDuplicable(true);
    colDocType.setColumnFilterable(true);
    colDocType.setColumnName("docTypeDoc01DOC10");
View Full Code Here

  /**
   * Retrieve item types and fill in the item types combo box.
   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    colItemType.setDomain(d);
    colItemType.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED && grid.getMode()!=Consts.READONLY) {
          GridInDeliveryNoteRowVO vo = (GridInDeliveryNoteRowVO)grid.getVOListTableModel().getObjectForRow(grid.getSelectedRow());
          vo.setItemCodeItm01DOC09(null);
          vo.setSupplierItemCodePur02DOC09(null);
          vo.setDescriptionSYS10(null);
          vo.setUmCodeREG02(null);
          vo.setUmCodeReg02PUR02(null);
          vo.setQtyDOC09(null);
          vo.setSupplierQtyDOC09(null);
          vo.setQtyDOC09(null);

          int selIndex = ((JComboBox)e.getSource()).getSelectedIndex();
          Object selValue = d.getDomainPairList()[selIndex].getCode();
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);
          itemDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);
        }
      }
    });
View Full Code Here

      // set domain in combo box...
      ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
      ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
      ArrayList companiesList = bca.getCompaniesList("WAR03_INVENTORY");
      Domain domain = new Domain("DOMAIN_WAR03_INVENTORY");
      for (int i = 0; i < companiesList.size(); i++) {
        if (applet.getAuthorizations().getCompanyBa().isInsertEnabled(
            "WAR03_INVENTORY",companiesList.get(i).toString()
        ))
          domain.addDomainPair(companiesList.get(i),companiesList.get(i).toString());
      }
      controlCompaniesCombo.setDomain(domain);


      MDIFrame.add(this);
View Full Code Here

      setSize(750,550);
      setMinimumSize(new Dimension(750,550));



      Domain domainState = new Domain("DOMAIN_INVENTORY_STATE");
      domainState.addDomainPair(ApplicationConsts.OPENED,"opened");
      domainState.addDomainPair(ApplicationConsts.CONFIRMED,"items confirmed");
      domainState.addDomainPair(ApplicationConsts.CLOSED,"closed");
      domainState.addDomainPair(ApplicationConsts.IN_PROGRESS,"in progress");
      colState.setDomain(domainState);


      MDIFrame.add(this,true);
    }
View Full Code Here

  /**
   * Retrieve item types and fill in the item types combo box.
   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      itemTypesList = ((VOListResponse)res).getRows();
      for(int i=0;i<itemTypesList.size();i++) {
        vo = (ItemTypeVO)itemTypesList.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlLOB.setDomain(d);
    controlLOB.getComboBox().addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
          progressiveHIE01 = null;
          controlDescr.setText(null);
      }
    });
    if (d.getDomainPairList().length>=1)
      controlLOB.getComboBox().setSelectedIndex(0);
    else
      controlLOB.getComboBox().setSelectedIndex(-1);


    // col item type...
    colItemType.setDomain(d);
    colItemType.addItemListener(new ItemListener() {

      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED) {
          InventoryItemVO vo = (InventoryItemVO)grid.getVOListTableModel().getObjectForRow(grid.getSelectedRow());
          vo.setItemCodeItm01WAR07(null);
          vo.setDescriptionSYS10(null);
          itemController.getLookupDataLocator().getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
          itemController.getLookupDataLocator().getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR07());
          itemController.getLookupDataLocator().getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR07());
          itemController.getLookupDataLocator().getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR07());
        }
      }

    });


    // items level lookup...
    filterLevelDataLocator.setGridMethodName("loadCompanyHierarchy");
    filterLevelDataLocator.setValidationMethodName("");
    filterTreeLevelDataLocator.setServerMethodName("loadCompanyHierarchy");
    filterTreeLevelDataLocator.setNodeNameAttribute("descriptionSYS10");
    filterLevelDataLocator.setTreeDataLocator(filterTreeLevelDataLocator);
    filterLevelDataLocator.setNodeNameAttribute("descriptionSYS10");

    controlItemLevel.setLookupController(levelController);
    levelController.setCodeSelectionWindow(levelController.TREE_FRAME);
    levelController.setAllowTreeLeafSelectionOnly(false);
    levelController.setForm(filterPanel);
    levelController.setLookupDataLocator(filterLevelDataLocator);
    levelController.setFrameTitle("level");
    levelController.setLookupValueObjectClassName("org.jallinone.hierarchies.java.CompanyHierarchyLevelVO");
    levelController.setAllColumnVisible(false);
    levelController.setVisibleColumn("descriptionSYS10", true);
    levelController.setPreferredWidthColumn("descriptionSYS10",200);
    levelController.setFramePreferedSize(new Dimension(400,400));
    levelController.addLookupListener(new LookupListener() {

      public void codeValidated(boolean validated) {}

      public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
        CompanyHierarchyLevelVO vo = (CompanyHierarchyLevelVO)controlItemLevel.getLookupController().getLookupVO();
        controlDescr.setText(vo==null?null:vo.getDescriptionSYS10());
        progressiveHIE01 = vo==null?null:vo.getProgressiveHIE01();
      }

      public void beforeLookupAction(ValueObject parentVO) {
        ItemTypeVO vo = (ItemTypeVO)itemTypesList.get(controlLOB.getSelectedIndex());

        filterTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM02());
        filterTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,controlLOB.getValue());
      }

      public void forceValidate() {}

    });



    // item code lookup...
    itemDataLocator.setGridMethodName("loadItems");
    itemDataLocator.setValidationMethodName("validateItemCode");
    itemDataLocator.getLookupFrameParams().put(ApplicationConsts.SHOW_ONLY_MOVABLE_ITEMS,Boolean.TRUE);
    itemDataLocator.getLookupValidationParameters().put(ApplicationConsts.SHOW_ONLY_MOVABLE_ITEMS,Boolean.TRUE);

    colItemCode.setLookupController(itemController);
    itemController.setLookupDataLocator(itemDataLocator);
    itemController.setFrameTitle("items");
    itemController.setShowErrorMessage(false);

    itemController.setCodeSelectionWindow(itemController.TREE_GRID_FRAME);
    treeLevelDataLocator.setServerMethodName("loadCompanyHierarchy");
    itemDataLocator.setTreeDataLocator(treeLevelDataLocator);
    itemDataLocator.setNodeNameAttribute("descriptionSYS10");

    itemController.setLookupValueObjectClassName("org.jallinone.items.java.GridItemVO");
    itemController.addLookup2ParentLink("companyCodeSys01ITM01", "companyCodeSys01WAR07");
    itemController.addLookup2ParentLink("itemCodeITM01", "itemCodeItm01WAR07");
    itemController.addLookup2ParentLink("descriptionSYS10", "descriptionSYS10");

    itemController.setAllColumnVisible(false);
    itemController.setVisibleColumn("companyCodeSys01ITM01", true);
    itemController.setVisibleColumn("itemCodeITM01", true);
    itemController.setVisibleColumn("descriptionSYS10", true);
    itemController.setPreferredWidthColumn("descriptionSYS10", 200);
    itemController.setFramePreferedSize(new Dimension(650,500));
    itemController.addLookupListener(new LookupListener() {

      public void codeValidated(boolean validated) {}

      public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {}

      public void beforeLookupAction(ValueObject parentVO) {
        InventoryItemVO vo = (InventoryItemVO)parentVO;
        vo.setCompanyCodeSys01WAR07(inventoryVO.getCompanyCodeSys01WAR06());
        itemDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
        itemDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
        treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
        itemController.getLookupDataLocator().getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
        itemController.getLookupDataLocator().getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
        treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02WAR07());
        treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR07());
        itemController.getLookupDataLocator().getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR07());
        itemController.getLookupDataLocator().getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR07());
        itemController.getLookupDataLocator().getLookupValidationParameters().put(ApplicationConsts.SHOW_ITEMS_WITHOUT_VARIANTS,Boolean.TRUE);
        itemController.getLookupDataLocator().getLookupFrameParams().put(ApplicationConsts.SHOW_ITEMS_WITHOUT_VARIANTS,Boolean.TRUE);
      }

      public void forceValidate() {}

    });



    // domain for locations...
    HashMap map = new HashMap();
    map.put(ApplicationConsts.COMPANY_CODE_SYS01,inventoryVO.getCompanyCodeSys01WAR06());
    map.put(ApplicationConsts.PROGRESSIVE_HIE02,inventoryVO.getProgressiveHie02WAR01());
    res = ClientUtils.getData("loadCompanyLeaves",map);
    d = new Domain("WAR_LOCATIONS");
    if (!res.isError()) {
      java.util.List rows = null;
      CompanyHierarchyLevelVO vo = null;
      rows = ((VOListResponse)res).getRows();
      for(int i=0;i<rows.size();i++) {
        vo = (CompanyHierarchyLevelVO)rows.get(i);
        d.addDomainPair(vo.getProgressiveHIE01(),vo.getDescriptionSYS10());
      }
    }
    colProg.setDomain(d);
    colRealProg.setDomain(d);

View Full Code Here

      // fill in the company combo...
      ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
      ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
      ArrayList companiesList = bca.getCompaniesList("REG07");
      Domain domain = new Domain("DOMAIN_REG07");
      for (int i = 0; i < companiesList.size(); i++) {
        if (applet.getAuthorizations().getCompanyBa().isInsertEnabled(
            "REG07",companiesList.get(i).toString()
        ))
          domain.addDomainPair(companiesList.get(i),companiesList.get(i).toString());
      }
      colCompany.setDomain(domain);
//      colCompany.addItemListener(new ItemListener() {
//        public void itemStateChanged(ItemEvent e) {
//          if (e.getStateChange()==e.SELECTED) {
View Full Code Here

  /**
   * Retrieve item types and fill in the item types combo box.
   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlItemType.setDomain(d);
  }
View Full Code Here

TOP

Related Classes of org.openswing.swing.domains.java.Domain

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.