コード例 #1
0
  /**
   * call this at least for the parent Node, to make sure all common properties are displayed as
   * columns (since we are doing lazy child Node load we need to preinitialize properties when
   * sending parent Node)
   *
   * @param toSet property set map for a Node
   */
  public static void initCommonProperties(Map<String, Object> toSet) {
    CommonPropertyTypes[] commonTypes = CommonPropertyTypes.values();
    final int COMMON_PROPS_LEN = commonTypes.length;
    for (int i = 0; i < COMMON_PROPS_LEN; ++i) {
      toSet.put(commonTypes[i].toString(), "");
    }

    AbstractAbstractFileNode.AbstractFilePropertyType[] fsTypes =
        AbstractAbstractFileNode.AbstractFilePropertyType.values();
    final int FS_PROPS_LEN = fsTypes.length;
    for (int i = 0; i < FS_PROPS_LEN; ++i) {
      toSet.put(fsTypes[i].toString(), "");
    }
  }
コード例 #2
0
 public static void setCommonProperty(
     Map<String, Object> toSet, CommonPropertyTypes type, Boolean value) {
   final String typeStr = type.toString();
   toSet.put(typeStr, value);
 }