コード例 #1
0
  public PrimaryKeyController(
      BPMNMinerController bpmnMinerController, List<PrimaryKeyData> pKeyData)
      throws IOException, NoEntityException {
    this.bpmnMinerController = bpmnMinerController;

    this.primaryKeyW =
        (Window)
            bpmnMinerController
                .portalContext
                .getUI()
                .createComponent(
                    getClass().getClassLoader(), "zul/selectPrimaryKey.zul", null, null);
    this.primaryKeyW.setTitle("Select Primary Keys");

    this.cancelButton = (Button) this.primaryKeyW.getFellow("cancelButton");
    this.nextButton = (Button) this.primaryKeyW.getFellow("okButton");

    this.cancelButton.addEventListener(
        "onClick",
        new EventListener<Event>() {
          public void onEvent(Event event) throws Exception {
            cancel();
          }
        });
    this.nextButton.addEventListener(
        "onClick",
        new EventListener<Event>() {
          public void onEvent(Event event) throws Exception {
            next();
          }
        });

    this.rows = (Rows) this.primaryKeyW.getFellow("rows");

    this.data = pKeyData;
    chosenKeysIndex = new int[data.size()];
    int dataIndex = 0;
    // create a new property item for each event type
    for (PrimaryKeyData currentData : data) {

      chosenKeysIndex[dataIndex] = 0;

      // build a list of all keys (sets of attribute names)
      String[] keyList =
          new String
              [currentData
                  .primaryKeys
                  .length]; // change if user can select any attributes for identifiers
      for (int i = 0; i < currentData.primaryKeys.length; i++) {
        HashSet<String> attr = currentData.primaryKeys[i];
        keyList[i] = DiscoverERmodel.keyToString(attr);
      }

      Row row = new Row();
      row.setParent(rows);

      Label activity = new Label(currentData.name);
      activity.setParent(row);

      if (keyList.length > 1) {
        Selectbox selectbox = new Selectbox();
        selectbox.setModel(new ListModelArray<Object>(keyList));
        selectbox.setId("" + dataIndex);
        selectbox.setParent(row);
      } else {
        Label key = new Label(Arrays.toString(keyList));
        key.setParent(row);
      }

      dataIndex++;
    }

    this.primaryKeyW.doModal();
  }
コード例 #2
0
  public void onSelect$ListagemDisciplina() {

    di =
        (RegistroDeDisciplina)
            ListagemDisciplina.getModel().getElementAt(ListagemDisciplina.getSelectedIndex());

    disciplina.setValue(di.getDisciplina().getNome());
    professor.setValue(di.getProfessor().getNome());
    id.setValue(String.valueOf(di.getDisciplina().getId()));
    cargaHoraria.setValue(String.valueOf(di.getDisciplina().getCargaHoraria()));

    JanelaFiltroParaListarDisciplina.setVisible(false);
    janelaDisciplinaAluno.setVisible(true);
    janelaDisciplina.setVisible(false);

    nomeTurma.setValue(turmav.getNome());
    turno.setValue(turmav.getTurno());
    modalidade.setValue(turmav.getModalidade());
    qtdAluno.setValue(String.valueOf(turmav.getQtdAluno()));
    anoLetivo.setValue(String.valueOf(turmav.getAnoLetivo().getAno()));
    sala.setValue(turmav.getSala().getDescricao());
    serie.setValue(turmav.getSerie().getDescricao());
    nivelEscolar.setValue(turmav.getSerie().getNivelEscolar().getNivel());

    Row rows = new Row();
    rows.setAlign("center");
    new Label(di.getDisciplina().getNome() + " | " + di.getProfessor().getNome()).setParent(rows);
    new Label("Carga Horária - " + di.getDisciplina().getCargaHoraria()).setParent(rows);
    rows.setParent(rowFrequencias);

    rowss.add(rows);

    for (Aluno a : Facade.getInstance().listarAlunoTurma(turmav.getId())) {

      Listitem li = new Listitem();

      for (Matricula m1 : a.getMatricula()) {
        if (turmav.getId() == m1.getTurma().getId()) {

          new Listcell(m1.getNumero()).setParent(li);

          Row row = new Row();

          new Label(m1.getNumero() + " | " + a.getNome()).setParent(row);

          Intbox t = new Intbox();

          t.setConstraint(c);

          t.setId(String.valueOf(a.getId()));

          intbox.add(t);

          t.setParent(row);
          t.setConstraint("no empty, no zero, no negative");

          row.setParent(rowFrequencias);
          rowss.add(row);
        }
      }

      new Listcell(a.getNome()).setParent(li);
      li.setParent(ListagemAluno);
    }

    binder.loadComponent(indexFrequencia);
    binder.loadComponent(rowFrequencias);
  }