Пример #1
0
 @Override
 protected CheckBoxItem newItem(Group group, Object key) {
   CheckBoxItem box = super.newItem(group, key);
   if (group.hasAssociations()) {
     GroupPanel panel = new GroupPanel(box, group, apps, regions);
     panels.put(group.getId(), panel);
     return panel;
   } else {
     return box;
   }
 }
Пример #2
0
  @Override
  public void setValue(List<Group> groups, boolean fireEvents) {
    List<Group> before = this.selectedValues;
    super.setValue(groups, false);

    if (groups != null) {
      for (Group g : groups) {
        GroupPanel panel = panels.get(g.getId());
        if (panel != null) {
          panel.setGroup(g);
        }
      }
    }
    if (fireEvents) {
      ValueChangeEvent.fireIfNotEqual(this, before, groups);
    }
  }
Пример #3
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;
 }