Exemplo n.º 1
0
 public void setEnabled(boolean isEnabled) {
   treAcctJJ.setEnabled(isEnabled);
   cbxLvl.setEnabled(!USE_NO_USE.equals(cbxUseType.getValue()));
   chkGroupUp.setEnabled(USE_VER.equals(cbxUseType.getValue()));
   treAcctJJ.setIsCheckBoxEnabled(isEnabled);
   if (!isEnabled) {
     treAcctJJ.cancelSelected(false);
   }
 }
Exemplo n.º 2
0
  void init() {
    this.setTitle("经济科目");
    try {

      cbxLvl = new FComboBox();
      cbxLvl.setTitle("级次选择");
      cbxLvl.setRefModel(REF_LEVEL);
      cbxLvl.setValue(IFilterProvider.LVL_1);
      cbxLvl.setPreferredSize(new Dimension(100, 20));
      cbxLvl.addValueChangeListener(
          new ValueChangeListener() {
            public void valueChanged(ValueChangeEvent arg0) {
              setTypeChange(IFilterProvider.TYPE_ACCT_JJ, "" + arg0.getNewValue());
            }
          });
      cbxLvl.setEnabled(false);
      cbxLvl.getEditor().addMouseListener(comCick);

      chkGroupUp = new FCheckBox();
      chkGroupUp.setTitle(" 按级次汇总");
      chkGroupUp.setTitlePosition("right");
      chkGroupUp.setEnabled(false);

      DataSet ds =
          AbastractFilterPanel.getSelectDs(IFilterProvider.TYPE_ACCT_JJ, IFilterProvider.LVL_1);
      treAcctJJ =
          new CustomTree(
              "经济科目",
              ds,
              IPubInterface.BSI_ID,
              IPubInterface.ACCT_FNAME,
              IPubInterface.BSI_PARENT_ID,
              null,
              IPubInterface.ACCT_CODE_JJ,
              true);
      treAcctJJ.setIsCheckBoxEnabled(false);
      if (ds.getRecordCount() < 200) treAcctJJ.expandAll();
      spnlTree = new FScrollPane(treAcctJJ);
      getBodyPanel().add(cbxLvl, BorderLayout.NORTH);
      FPanel pnl = new FPanel();
      pnl.setLayout(new BorderLayout());
      pnl.add(chkGroupUp, BorderLayout.NORTH);
      pnl.add(spnlTree, BorderLayout.CENTER);
      getBodyPanel().add(pnl, BorderLayout.CENTER);

      cbxLvl.addMouseListener(comCick);
      chkGroupUp.addMouseListener(comCick);
      spnlTree.addMouseListener(comCick);
      treAcctJJ.addMouseListener(comCick);
    } catch (Exception e) {
      new MessageBox("初始化经济科目选择失败!", e.getMessage(), MessageBox.ERROR, MessageBox.BUTTON_OK).show();
      e.printStackTrace();
    }
    reset();
  }