public void moveItemToGroupAtIndex(
     SearchConditionItem i, SearchConditionGroupItem g, int newIndex) {
   i.removeListener(this);
   items.remove(i);
   i.setParent(null);
   g.addItem(i);
   g.moveItemToIndex(i, newIndex);
   fireSearchConditionOrderChangedEvent();
 }
  public void moveItemToGroup(SearchConditionItem i, SearchConditionGroupItem g) {
    i.removeListener(this);
    items.remove(i);
    i.setParent(null);
    g.addItem(i);

    if (items.size() < 1) {
      if (getParent() != null) {
        getParent().removeItem(this);
      }
    } else {
      fireSearchConditionOrderChangedEvent();
    }
  }