Example #1
0
  /**
   * 刷新父目录,在创建或删除目录时使用。
   *
   * @param categoryName
   */
  public void refreshParentCategory(String categoryName) {
    if (categoryName == null || "".equals(categoryName)) {
      rootCategory.refresh();
    }

    int index = categoryName.lastIndexOf(".");
    if (index != -1) {
      String name = categoryName.substring(0, index);
      Category category = this.getCategory(name);
      if (category != null) {
        category.refresh();
      } else {
        refreshParentCategory(name);

        category = this.getCategory(name);
        if (category != null) {
          category.refresh();
        }
      }
    }
  }
Example #2
0
 /*
  * (non-Javadoc)
  * @see org.xmeta.ThingManager#refresh(java.lang.String)
  */
 public void refresh(String categoryName, boolean includeChildCategory) {
   Category category = getCategory(categoryName);
   if (category != null) {
     category.refresh(includeChildCategory);
   }
 }