Пример #1
0
  private void validatePage() {
    List<MapBean> maps = mdfbean.getMaps();
    if (maps.isEmpty()) {
      setPageComplete(false);
      return;
    }
    for (MapBean m : maps) {
      if (!m.checkValid()) {
        setPageComplete(false);
        return;
      }
    }

    setPageComplete(true);
  }
Пример #2
0
  protected void updateOnPageChange() {
    List<MappedBlockBean> blocks = mdfbean.getBlocks();
    if (blocks.isEmpty()) return;
    options = new String[blocks.size()];
    for (int i = 0; i < blocks.size(); i++) options[i] = blocks.get(i).getName();

    if (!mdfbean.getMaps().isEmpty()) {

      Iterator<MapBean> it = mdfbean.getMaps().iterator();

      List<String> l = Arrays.asList(options);

      while (it.hasNext()) {
        MapBean b = it.next();

        if (!datasetNames.containsKey(b.getName()) || !l.contains(b.getParent())) {
          it.remove();
          continue;
        }

        mapToParent.put(b.getName(), l.lastIndexOf(b.getParent()));

        for (Entry<String, int[]> entry : datasetNames.entrySet()) {
          if (entry.getKey().equals(b.getName())) {
            cviewer.setChecked(entry, true);
          }
        }
      }
    }

    validatePage();

    //		if (description != null && description.getBlockNames() != null){
    //			options = description.getBlockNames().toArray(new
    // String[description.getBlockNames().size()]);
    //
    //			if (description.getDataBlockToMapMapping() != null) {
    //				for (Entry<String, List<String>> e : description.getDataBlockToMapMapping().entrySet()) {
    //					if (datasetNames.containsKey(e.getKey())) {
    //
    //						for (String a : e.getValue()) {
    //							if (a != null && datasetNames.containsKey(a)) {
    //								int i = 0;
    //								for (;i< options.length; i++) if (e.getKey().equals(options[i])) break;
    //								mapToParent.put(a, i);
    //								for (Entry<String, int[]> ent : datasetNames.entrySet()) if (ent.getKey().equals(a))
    // cviewer.setChecked(ent, true);
    //							}
    //						}
    //
    //					}
    //				}
    //			}

    //		}
  }
Пример #3
0
 private MapBean updateBean(String name, String parent) {
   MapBean bean = new MapBean();
   bean.setName(name);
   bean.setParent(parent);
   return bean;
 }