Ejemplo n.º 1
0
 @Override
 public List<Group> getValue() {
   List<Group> groups = super.getValue();
   GWT.log("get valle" + groups);
   for (Group g : groups) {
     GroupPanel panel = panels.get(g.getId());
     if (panel != null) {
       GWT.log("get valle" + g.hasRegions());
       if (g.hasApplications()) {
         g.setApplicationIds(panel.getSelectedApplicationIds());
       }
       if (panel.hasRegions()) {
         g.setRegionIds(panel.getSelectedRegionIds());
       }
       GWT.log("get valle" + g.getRegionIds());
     }
   }
   return groups;
 }
Ejemplo n.º 2
0
    GroupPanel(CheckBoxItem box, Group group, List<Application> apps, List<Region> regions) {
      this.group = group;
      this.box = box;
      box.addValueChangeHandler(
          new ValueChangeHandler<Boolean>() {

            public void onValueChange(ValueChangeEvent<Boolean> event) {
              adjustListBox(event.getValue());
            }
          });

      add(box);
      if (group.hasApplications()) {
        add(new Label("applications"));
        add(applications);
        if (apps != null && !apps.isEmpty()) {
          applications.clear();
          for (Application a : apps) {
            applications.addItem(a.toDisplay(), a.getId() + "");
          }
        } else {
          applications.addItem("loading . . .");
        }
        applications.setEnabled(false);
      }
      if (group.hasRegions()) {
        add(new Label("regions"));
        add(this.regions);
        if (regions != null && !regions.isEmpty()) {
          regions.clear();
          for (Region a : regions) {
            this.regions.addItem(a.toDisplay(), a.getId() + "");
          }
        } else {
          this.regions.addItem("loading . . .");
        }
        this.regions.setEnabled(false);
      }
    }