public JournalFilterFrame() {
    try {
      jbInit();

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

      setSize(400, 200);
      MDIFrame.getInstance().add(this);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 /** 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;
     list = ((VOListResponse) res).getRows();
     for (int i = 0; i < list.size(); i++) {
       vo = (ItemTypeVO) list.get(i);
       d.addDomainPair(vo.getProgressiveHie02ITM02(), vo.getDescriptionSYS10());
     }
   }
   controlHierarchy.setDomain(d);
   controlHierarchy
       .getComboBox()
       .addItemListener(
           new ItemListener() {
             public void itemStateChanged(ItemEvent e) {
               if (e.getStateChange() == e.SELECTED) {
                 ItemTypeVO typeVO = (ItemTypeVO) list.get(controlHierarchy.getSelectedIndex());
                 treePanel.setCompanyCode(typeVO.getCompanyCodeSys01ITM02());
                 treePanel.setProgressiveHIE02((BigDecimal) controlHierarchy.getValue());
                 DetailSupplierVO vo =
                     (DetailSupplierVO) supplierPanel.getVOModel().getValueObject();
                 treePanel.setCompanyCode(vo.getCompanyCodeSys01REG04());
                 treePanel.reloadTree();
                 itemsGrid.clearData();
               }
             }
           });
   if (d.getDomainPairList().length == 1) controlHierarchy.getComboBox().setSelectedIndex(0);
   else controlHierarchy.getComboBox().setSelectedIndex(-1);
 }
Exemplo n.º 3
0
  public ClientApplication() {
    //    ClientUtils.setObjectSender(new HessianObjectSender());

    clientFacade = new DemoClientFacade();

    Hashtable domains = new Hashtable();
    Domain sexDomain = new Domain("SEX");
    sexDomain.addDomainPair("M", "male");
    sexDomain.addDomainPair("F", "female");
    domains.put(sexDomain.getDomainId(), sexDomain);

    Properties props = new Properties();
    props.setProperty("deptCode", "Dept Code");
    props.setProperty("description", "Description");
    props.setProperty("address", "Address");
    props.setProperty("tasks", "Tasks");
    props.setProperty("departments", "departments");
    props.setProperty("taskCode", "Task Code");
    props.setProperty("firstName", "First Name");
    props.setProperty("lastName", "Last Name");
    props.setProperty("deptDescription", "Dept. Description");
    props.setProperty("tadkDescription", "Task Description");
    props.setProperty("hire date", "Hire Date");
    props.setProperty("sex", "Sex");
    props.setProperty("male", "Male");
    props.setProperty("female", "Female");
    props.setProperty("salary", "Salary");
    props.setProperty("empCode", "Employee Code");
    props.setProperty("task", "Task");
    props.setProperty("department", "Department");

    ClientSettings clientSettings =
        new ClientSettings(new EnglishOnlyResourceFactory("$", props, true), domains);

    ClientSettings.BACKGROUND = "background4.jpg";
    ClientSettings.TREE_BACK = "treeback2.jpg";
    ClientSettings.VIEW_BACKGROUND_SEL_COLOR = true;
    ClientSettings.VIEW_MANDATORY_SYMBOL = true;

    MDIFrame mdi = new MDIFrame(this);
  }
Exemplo n.º 4
0
  public ClientApplication() {

    Hashtable domains = new Hashtable();
    Properties props = new Properties();
    props.setProperty("category", "Category");
    props.setProperty("subCategory", "Sub Category");
    props.setProperty("item", "Item");
    props.setProperty("sellQty", "Qty");
    props.setProperty("sellAmount", "Sell");
    props.setProperty("orderDate", "Order Date");
    props.setProperty("year", "Year");
    props.setProperty("quarter", "Quarter");
    props.setProperty("sells", "Sells");
    props.setProperty("agent", "Agent");
    props.setProperty("country", "Country");
    props.setProperty("region", "Region");

    ClientSettings clientSettings =
        new ClientSettings(new EnglishOnlyResourceFactory("£", props, true), domains);
    ClientSettings.FILTER_PANEL_ON_GRID = true;

    Domain orderStateDomain = new Domain("ORDERSTATE");
    orderStateDomain.addDomainPair(new Integer(0), "opened");
    orderStateDomain.addDomainPair(new Integer(1), "suspended");
    orderStateDomain.addDomainPair(new Integer(2), "delivered");
    orderStateDomain.addDomainPair(new Integer(3), "closed");
    domains.put(orderStateDomain.getDomainId(), orderStateDomain);
    ClientSettings.ALLOW_OR_OPERATOR = false;
    ClientSettings.INCLUDE_IN_OPERATOR = false;
    ClientSettings.GRID_PROFILE_MANAGER = new FileGridProfileManager();

    // createData();
    long t = System.currentTimeMillis();
    //    ArrayList vos = loadData();
    //    System.out.println("Loading data in "+(System.currentTimeMillis()-t)+"ms");
    //    ArrayList vos = null;
    //    new GridFrame(vos);

    new GridFrame();
  }