ICEfaces
  1. ICEfaces
  2. ICE-2755

Support java.util.Set in ice:dataTable and ice:panelSeries components

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.2, 1.7Beta1
    • Fix Version/s: 1.7RC1, 1.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      any

      Description

      example code may look like:

      SetDataModel:

       public class SetDataModel extends ListDataModel {
       
        public SetDataModel() {
        super();
        }
       
        public SetDataModel(Set set) {
        super();
        List list = new ArrayList(set);
        setWrappedData(list);
        }
       }


      change com.icesoft.faces.component.panelseries.UISeries to:

       private DataModel getDataModel() {
                if (null != this.dataModel) {
                    return (dataModel);
                }
        
                Object currentValue = getValue();
        
                if (null == currentValue) {
                    this.dataModel = new ListDataModel(Collections.EMPTY_LIST);
                } else if (currentValue instanceof DataModel) {
                    this.dataModel = (DataModel) currentValue;
                } else if (currentValue instanceof List) {
                    this.dataModel = new ListDataModel((List) currentValue);
                } else if (Object[].class.isAssignableFrom(currentValue.getClass())) {
                    this.dataModel = new ArrayDataModel((Object[]) currentValue);
                } else if (currentValue instanceof ResultSet) {
                    this.dataModel = new ResultSetDataModel((ResultSet) currentValue);
                } else if (currentValue instanceof Result) {
                    this.dataModel = new ResultDataModel((Result) currentValue);
                } else if (currentValue instanceof TreeModel) {
                    this.dataModel = new TreeDataModel((TreeModel) currentValue);
                } else if (currentValue instanceof Set) {
                    this.dataModel = new SetDataModel((Set) currentValue);
                } else {
                    this.dataModel = new ScalarDataModel(currentValue);
                }
        
                return (dataModel);
       }

        Activity

        Hide
        Adnan Durrani added a comment -

        Michael's suggestion applied.

        revision : 15923

        By adding the Set support, the following concrete types can be used as the dataModel:

        • HashSet
        • LinkedHashSet
          -TreeSet
        Show
        Adnan Durrani added a comment - Michael's suggestion applied. revision : 15923 By adding the Set support, the following concrete types can be used as the dataModel: HashSet LinkedHashSet -TreeSet

          People

          • Assignee:
            Unassigned
            Reporter:
            Michael Thiem
          • Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: