public void onlyKeep(MiniFieldSpec[] allowedSpecs) {
    HashSet allowedSpecSet = new HashSet();
    allowedSpecSet.addAll(Arrays.asList(allowedSpecs));
    Vector newChoices = new Vector();
    for (int i = 0; i < allChoices.size(); ++i) {
      ChoiceItem choice = (ChoiceItem) allChoices.get(i);
      MiniFieldSpec spec = new MiniFieldSpec(choice.getSpec());
      spec.setLabel(fontHelper.getStorable(spec.getLabel()));
      spec.setTopLevelLabel(fontHelper.getStorable(spec.getTopLevelLabel()));
      if (isSpecInAllowed(spec, allowedSpecSet)) newChoices.add(choice);
    }

    allChoices = newChoices;
  }
Exemplo n.º 2
0
 public MartusField getField(MiniFieldSpec miniSpec) {
   return getField(miniSpec.getTag());
 }