private void fillAssociationTypeList() {
    // cbRelation
    logger.debug("fillAssociationTypeList()");

    ListConceptAssociationTypesResponse.Return response =
        WebServiceHelper.listConceptAssociationTypes(new ListConceptAssociationTypesRequestType());
    logger.debug("response: " + response.getReturnInfos().getMessage());

    if (response.getReturnInfos().getStatus() == Status.OK) {
      final Combobox cb = (Combobox) getFellow("cbRelation");

      cb.setItemRenderer(
          new ComboitemRenderer<CodeSystemEntity>() {
            public void render(Comboitem item, CodeSystemEntity cse, int i) throws Exception {
              item.setValue(cse);
              CodeSystemEntityVersion csev = cse.getCodeSystemEntityVersions().get(0);
              AssociationType assType = csev.getAssociationTypes().get(0);
              item.setLabel(assType.getForwardName() + " <-> " + assType.getReverseName());

              if (cb.getSelectedItem() == null) cb.setSelectedItem(item);
            }
          });

      ListModelList lml = new ListModelList<CodeSystemEntity>(response.getCodeSystemEntity());
      cb.setModel(lml);

      logger.debug("association count: " + lml.getSize());

      // if(lml.getSize() > 0)
      //  cb.setSelectedIndex(0);
    }
  }
Exemple #2
0
  /*
   * (non-Javadoc)
   *
   * @see com.hxzy.base.web.window.ActionWindow#onBind()
   */
  @Override
  public void onBind() {

    list = dictService.findByProperty("parent.code", "productCategory");
    binder.loadComponent(combobox);

    if (member != null) {
      companyName.setValue(member.getCompanyName());
      contacts.setValue(member.getContacts());
      joinTime.setValue(member.getJoinTime());
      endTime.setValue(member.getEndTime());

      combobox.setItemRenderer(
          new ComboitemRenderer() {

            public void render(Comboitem item, Object o) throws Exception {
              Dict d = (Dict) o;
              item.setValue(d);
              item.setLabel(d.getName());
              Dict category = member.getCategory();

              if (d.equals(category)) {
                combobox.setSelectedItem(item);
              }
            }
          });
    }
  }
    private void initializeListboxProgressTypes() {
        if (cbProgressTypes == null) {
            cbProgressTypes = (Combobox) planner.getFellow("cbProgressTypes");
        }
        if (btnShowAdvances == null) {
            btnShowAdvances = (Button) planner.getFellow("showAdvances");
        }

        cbProgressTypes.setModel(new ListModelList(ProgressType.getAll()));
        cbProgressTypes.setItemRenderer(new ProgressTypeRenderer());

        // Update completion of tasks on selecting new progress type
        cbProgressTypes.addEventListener(Events.ON_SELECT, new EventListener() {

            @Override
            public void onEvent(Event event) {
                planner.forcedShowAdvances();
                planner.updateCompletion(getSelectedProgressType().toString());
            }

            private ProgressType getSelectedProgressType() {
                return (ProgressType) cbProgressTypes.getSelectedItem().getValue();
            }

        });

        cbProgressTypes.setVisible(true);

        ProgressType progressType = getProgressTypeFromConfiguration();
        if (progressType != null) {
            planner.updateCompletion(progressType.toString());
        }

    }
 private void renderizarDatosPlanillaDetalle() {
   logger.log(Level.INFO, "[GestionIngresosDescuentosCtrl][renderizarDatosPlanillaDetalle]");
   try {
     planillaDetalleSelected = null;
     if (listaPlanillaDetalles == null) {
       listaPlanillaDetalles = new ArrayList<PlanillaDetalle>();
     }
     cmbEmpleadosPreparaciones.setModel(new ListModelList(listaPlanillaDetalles));
     cmbEmpleadosPreparaciones.setItemRenderer(new VariosComboItemRendered());
     llenarDatosCampos();
     revisarEstadoComponentes();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  private void loadCombobox() {

    // Sucursal
    List<Sucursales> listaSucursales;

    try {
      listaSucursales = sucursalesBean.loadAllSucursal();
      if (listaSucursales != null) {
        cmbSucursal.setModel(new ListModelList(listaSucursales));
        cmbSucursal.setItemRenderer(new CatalogoItemRenderer());
      } else {
        cmbSucursal.setValue("No existen sucursales!!");
        cmbSucursal.setReadonly(true);
        cmbSucursal.setButtonVisible(false);
        cmbSucursal.setDisabled(true);
      }

    } catch (DiservBusinessException ex) {
      Logger.getLogger(DetalleUsuarioCtrl.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
  @Override
  public void render(final Row row, Object object) throws Exception {
    if (inputfmtcombo != null) {
      inputRateSelected = inputfmtcombo.getText();
      if (!inputRateSelected.contains("VFI_")) inputRateSelected = "VFI_" + inputRateSelected;
    }
    final DefaultFormatMapEntries fmtMapEntry = (DefaultFormatMapEntries) object;
    final Combobox inputFormatCombo = new Combobox();
    inputFormatCombo.setReadonly(true);
    String rateFormat = fmtMapEntry.getRateFormat();
    if (rateFormat.contains("VF_")) rateFormat = rateFormat.replaceAll("VF_", "");
    inputFormatCombo.setText(rateFormat);
    rateForamatSelected.add(rateFormat);
    if (fmtMapEntry.isOnEdit()) inputFormatCombo.setDisabled(true);
    final Collection<String> comboRateArray = new ArrayList<String>();
    if (inputRateSelected.equals("VFI_480i")) {

      comboRateArray.add(VideoFormatT.findByValue(21).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(22).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(23).toString().replaceAll("VF_", ""));
    } else {

      comboRateArray.add(VideoFormatT.findByValue(1).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(2).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(3).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(4).toString().replaceAll("VF_", ""));
      comboRateArray.add(VideoFormatT.findByValue(5).toString().replaceAll("VF_", ""));
    }
    comboRateArray.removeAll(rateForamatSelected);
    inputFormatCombo.setModel(new ListModelList(comboRateArray));
    ComboitemRenderer renderer =
        new ComboitemRenderer() {

          @Override
          public void render(Comboitem item, Object data) throws Exception {
            String audiotype = data.toString();
            item.setLabel(audiotype);
          }
        };
    inputFormatCombo.setItemRenderer(renderer);

    inputFormatCombo.addEventListener(
        Events.ON_OPEN,
        new EventListener() {

          public void onEvent(Event event) throws Exception {
            // inputFormatCombo.getModel().getSize();
            comboRateArray.removeAll(rateForamatSelected);
            inputFormatCombo.setModel(new ListModelList(comboRateArray));
          }
        });
    inputFormatCombo.addEventListener(
        Events.ON_CHANGE,
        new EventListener() {

          public void onEvent(Event event) throws Exception {
            String rateformtname = inputFormatCombo.getText();
            if (!rateformtname.contains("VF_")) rateformtname = "VF_" + rateformtname;
            fmtMapEntry.setRateFormat(rateformtname);
            System.out.println("......." + rateForamatSelected + rateformtname);
            rateForamatSelected.add(inputFormatCombo.getText());

            inputFormatCombo.setDisabled(true);
          }
        });

    inputFormatCombo.setParent(row);

    final Intbox bitrateIntBox = new Intbox();
    bitrateIntBox.setMaxlength(5);
    bitrateIntBox.setConstraint(new IntValueConstraint());
    bitrateIntBox.setText(fmtMapEntry.getBitRate());
    bitrateIntBox.addEventListener(
        Events.ON_CHANGE,
        new EventListener() {
          public void onEvent(Event event) throws Exception {

            try {
              fmtMapEntry.setBitRate(bitrateIntBox.getText());
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
        });
    bitrateIntBox.setParent(row);
    final Button cancelBtn = new Button();

    cancelBtn.setSclass("check_off");
    cancelBtn.setTooltiptext("Delete");

    cancelBtn.addEventListener(
        Events.ON_CLICK,
        new EventListener() {
          public void onEvent(Event event) throws Exception {

            if (row.getGrid().getListModel().getSize() > 1) {
              removeRow(row);
            } else {
              Messagebox.show(
                  "Sorry,You will not be able to delete this row.!",
                  "Aereo",
                  Messagebox.OK,
                  Messagebox.INFORMATION);
            }
          }
        });

    cancelBtn.setParent(row);
  }