Exemplo n.º 1
0
 /* (non-Javadoc)
  * @see com.mg.framework.api.ui.MasterModelListener#masterChange(com.mg.framework.api.ui.ModelChangeEvent)
  */
 public void masterChange(ModelChangeEvent event) {
   analitFirstProperties.put("FinAcc", event.getEntity());
   analitSecondProperties.put("FinAcc", event.getEntity());
   analitThirdProperties.put("FinAcc", event.getEntity());
   analitFourthProperties.put("FinAcc", event.getEntity());
   analitFifthProperties.put("FinAcc", event.getEntity());
 }
Exemplo n.º 2
0
  public FinAccountMt() throws Exception {
    setMasterDetail(true);
    analitService =
        (AnalyticsServiceLocal)
            ApplicationDictionaryLocator.locate().getBusinessService("merp/finance/Analytics");

    analitFirstProperties.put("AnlLevel", 1);
    analitFirst = new MaintenanceTableController(analitFirstProperties);
    analitFirst.initController(
        analitService,
        new FinAnlMaintenanceEJBQLTableModel() {

          protected String createQueryText() {
            super.createQueryText();
            Set<TableEJBQLFieldDef> fieldDefs = getFieldDefsSet();
            fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
            fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
            paramsName.clear();
            paramsValue.clear();
            paramsName.add("finacc");
            paramsValue.add(getEntity());
            paramsName.add("anlLevel");
            paramsValue.add((short) 1);
            return String.format(INIT_QUERY_TEXT, fieldsList, fromList);
          }

          /* (non-Javadoc)
           * @see com.mg.framework.generic.ui.DefaultMaintenanceEJBQLTableModel#getPrimaryKeyFieldIndex()
           */
          @Override
          protected int getPrimaryKeyFieldIndex() {
            return 0;
          }
        });
    addMasterModelListener(analitFirst);

    analitSecondProperties.put("AnlLevel", 2);
    analitSecond = new MaintenanceTableController(analitSecondProperties);
    analitSecond.initController(
        analitService,
        new FinAnlMaintenanceEJBQLTableModel() {

          protected String createQueryText() {
            super.createQueryText();
            Set<TableEJBQLFieldDef> fieldDefs = getFieldDefsSet();
            fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
            fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
            paramsName.clear();
            paramsValue.clear();
            paramsName.add("finacc");
            paramsValue.add(getEntity());
            paramsName.add("anlLevel");
            paramsValue.add((short) 2);
            return String.format(INIT_QUERY_TEXT, fieldsList, fromList);
          }

          /* (non-Javadoc)
           * @see com.mg.framework.generic.ui.DefaultMaintenanceEJBQLTableModel#getPrimaryKeyFieldIndex()
           */
          @Override
          protected int getPrimaryKeyFieldIndex() {
            return 0;
          }
        });

    addMasterModelListener(analitSecond);

    analitThirdProperties.put("AnlLevel", 3);
    analitThird = new MaintenanceTableController(analitThirdProperties);
    analitThird.initController(
        analitService,
        new FinAnlMaintenanceEJBQLTableModel() {

          protected String createQueryText() {
            super.createQueryText();
            Set<TableEJBQLFieldDef> fieldDefs = getFieldDefsSet();
            fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
            fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
            paramsName.clear();
            paramsValue.clear();
            paramsName.add("finacc");
            paramsValue.add(getEntity());
            paramsName.add("anlLevel");
            paramsValue.add((short) 3);
            return String.format(INIT_QUERY_TEXT, fieldsList, fromList);
          }

          /* (non-Javadoc)
           * @see com.mg.framework.generic.ui.DefaultMaintenanceEJBQLTableModel#getPrimaryKeyFieldIndex()
           */
          @Override
          protected int getPrimaryKeyFieldIndex() {
            return 0;
          }
        });

    addMasterModelListener(analitThird);

    analitFourthProperties.put("AnlLevel", 4);
    analitFourth = new MaintenanceTableController(analitFourthProperties);
    analitFourth.initController(
        analitService,
        new FinAnlMaintenanceEJBQLTableModel() {

          protected String createQueryText() {
            super.createQueryText();
            Set<TableEJBQLFieldDef> fieldDefs = getFieldDefsSet();
            fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
            fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
            paramsName.clear();
            paramsValue.clear();
            paramsName.add("finacc");
            paramsValue.add(getEntity());
            paramsName.add("anlLevel");
            paramsValue.add((short) 4);
            return String.format(INIT_QUERY_TEXT, fieldsList, fromList);
          }

          /* (non-Javadoc)
           * @see com.mg.framework.generic.ui.DefaultMaintenanceEJBQLTableModel#getPrimaryKeyFieldIndex()
           */
          @Override
          protected int getPrimaryKeyFieldIndex() {
            return 0;
          }
        });

    addMasterModelListener(analitFourth);

    analitFifthProperties.put("AnlLevel", 5);
    analitFifth = new MaintenanceTableController(analitFifthProperties);
    analitFifth.initController(
        analitService,
        new FinAnlMaintenanceEJBQLTableModel() {

          protected String createQueryText() {
            super.createQueryText();
            Set<TableEJBQLFieldDef> fieldDefs = getFieldDefsSet();
            fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
            fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
            paramsName.clear();
            paramsValue.clear();
            paramsName.add("finacc");
            paramsValue.add(getEntity());
            paramsName.add("anlLevel");
            paramsValue.add((short) 5);
            return String.format(INIT_QUERY_TEXT, fieldsList, fromList);
          }

          /* (non-Javadoc)
           * @see com.mg.framework.generic.ui.DefaultMaintenanceEJBQLTableModel#getPrimaryKeyFieldIndex()
           */
          @Override
          protected int getPrimaryKeyFieldIndex() {
            return 0;
          }
        });

    addMasterModelListener(analitFifth);

    addMasterModelListener(this);
  }
Exemplo n.º 3
0
 /* (non-Javadoc)
  * @see com.mg.framework.api.ui.MasterModelListener#masterChange(com.mg.framework.api.ui.ModelChangeEvent)
  */
 public void masterChange(ModelChangeEvent event) {
   originalProperties.put("Offer", event.getEntity()); // $NON-NLS-1$
 }
 /* (non-Javadoc)
  * @see com.mg.framework.api.ui.MasterModelListener#masterChange(com.mg.framework.api.ui.ModelChangeEvent)
  */
 public void masterChange(ModelChangeEvent event) {
   positionFillProperties.put("PersonalAccount", event.getEntity()); // $NON-NLS-1$
   feeProperties.put("PersonalAccount", event.getEntity()); // $NON-NLS-1$
 }