Examples of ChildPropertyTreeModel


Examples of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

        SurveyPage processChoiceBar3 = new SurveyPage("/components/navigation/processChoiceBar/processChoiceBar3.xhtml", "Third Step");
        processChoiceBar3.setOutcome("processChoiceBar3");
        _processChoiceBarPageList.add(processChoiceBar3);

        ChildPropertyTreeModel childProperty = new ChildPropertyTreeModel();
        childProperty.setWrappedData(_processChoiceBarPageList);
        this.setWrappedData(childProperty);
    }
View Full Code Here

Examples of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

    public NavigationTreeBean() {
    }

    public TreeModel getModel() throws IntrospectionException {
        if (_model == null) {
            _model = new ChildPropertyTreeModel(new TreeDataDemo().getRoot(), "children");
        }
        return _model;
    }
View Full Code Here

Examples of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

      try
      {
        if (_menu == null)
        {
          List<PageImpl> al = _createPageList();
          TreeModel treeModel = new ChildPropertyTreeModel(al, "children");
          _menu = new MenuModelImpl(treeModel, "viewId", "/4.jspx");
        }

        return _menu;
      }
      catch(IntrospectionException e)
      {
        _LOG.severe(e);
        return null;
      }
    }
    else if ("navigationpath".equals(name))
    {
      try
      {
        if (_navigationpath == null)
        {
          List<PageImpl> al = _createPageList();
          TreeModel treeModel = new ChildPropertyTreeModel(al, "children");
          _navigationpath = new MenuModelImpl(treeModel, "viewId", "/7.jspx");
        }

        return _navigationpath;
      }
      catch(IntrospectionException e)
      {
        _LOG.severe(e);
        return null;
      }
    }
    else if ("simpleList".equals(name))
    {
      if (_simpleList == null)
      {
        _simpleList = new ArrayList<Map<String, Object>>();
        _simpleList.add(_createHashMap("First", 1));
        _simpleList.add(_createHashMap("Second", 2));
        _simpleList.add(_createHashMap("Three", 3));
        _simpleList.add(_createHashMap("Four", 4));
        _simpleList.add(_createHashMap("Five", 5));
        _simpleList.add(_createHashMap("Six", 6));
      }

      return _simpleList;
    }
    else if ("numberList".equals(name))
    {
      // A simple out-of-order list of numeric strings,
      // for use in the selectManyListbox test
      List<String> list = new ArrayList<String>(2);
      list.add("8");
      list.add("2");
      return list;
    }
    else if("iteratorList".equals(name))
    {
      if (_iteratorList == null)
      {
        // -= Simon Lessard =-
        // FIXME: _iteratorList will contains 5 null value since
        //        put return the value before the insertion at 
        //        specified key.
        // Ref: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html#put(K, V)
        _iteratorList = new ArrayList<String>();
        _iteratorList.add(new HashMap<String, String>().put("data","One"));
        _iteratorList.add(new HashMap<String, String>().put("data","Two"));
        _iteratorList.add(new HashMap<String, String>().put("data","Three"));
        _iteratorList.add(new HashMap<String, String>().put("data","Four"));
        _iteratorList.add(new HashMap<String, String>().put("data","Five"));
      }

      return _iteratorList;
    }
    else if("colorList".equals(name))
    {
      ArrayList<Color> colorList = new ArrayList<Color>();
      colorList.add(new Color(255, 0, 0));
      colorList.add(new Color(0, 0, 255));
      colorList.add(new Color(255, 255, 0));
      colorList.add(new Color(0, 255, 0));
      return colorList;
    }
    else if("treeModel".equals(name))
    {
      if (_treeModel == null)
      {
        Person john = new Person("John Smith");
        Person kim = new Person("Kim Smith");
        Person tom = new Person("Tom Smith");
        Person zoe = new Person("Zoe Smith");
        Person ira = new Person("Ira Wickrememsinghe");
        Person mallika = new Person("Mallika Wickremesinghe");

        john.getKids().add(kim);
        john.getKids().add(tom);
        tom.getKids().add(zoe);
        ira.getKids().add(mallika);

        List<Person> people = new ArrayList<Person>();
        people.add(john);
        people.add(ira);

        _treeModel = new ChildPropertyTreeModel(people, "kids");
      }

      return _treeModel;
    }
    else if("pathSet".equals(name))
View Full Code Here

Examples of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

        if (TrainDemo.VARIANTS.MaxVisited == navigationHandler.getCurrentComponentVariantDemo().getVariantId()) {
            setMaxPathKey("TRAIN_DEMO_MAX_PATH_KEY");
        }
       
        setWrappedData(new ChildPropertyTreeModel(arrayList,null));
    }
View Full Code Here

Examples of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

  {
    _rootFolders = rootFolders;

    List<Object> rootFolderList = Arrays.asList((Object[]) _rootFolders);

    TreeModel folderTreeModel = new ChildPropertyTreeModel(rootFolderList, "subFolders");
    setFolderModel(folderTreeModel);
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

      try
      {
        if (_menu == null)
        {
          List<PageImpl> al = _createPageList();
          TreeModel treeModel = new ChildPropertyTreeModel(al, "children");
          _menu = new MenuModelImpl(treeModel, "viewId", "/4.jspx");
        }

        return _menu;
      }
      catch(IntrospectionException e)
      {
        _LOG.severe(e);
        return null;
      }
    }
    else if ("navigationpath".equals(name))
    {
      try
      {
        if (_navigationpath == null)
        {
          List<PageImpl> al = _createPageList();
          TreeModel treeModel = new ChildPropertyTreeModel(al, "children");
          _navigationpath = new MenuModelImpl(treeModel, "viewId", "/7.jspx");
        }

        return _navigationpath;
      }
      catch(IntrospectionException e)
      {
        _LOG.severe(e);
        return null;
      }
    }
    else if ("simpleList".equals(name))
    {
      if (_simpleList == null)
      {
        _simpleList = new ArrayList<Map<String, Object>>();
        _simpleList.add(_createHashMap("First", 1));
        _simpleList.add(_createHashMap("Second", 2));
        _simpleList.add(_createHashMap("Three", 3));
        _simpleList.add(_createHashMap("Four", 4));
        _simpleList.add(_createHashMap("Five", 5));
        _simpleList.add(_createHashMap("Six", 6));
      }

      return _simpleList;
    }
    else if ("numberList".equals(name))
    {
      // A simple out-of-order list of numeric strings,
      // for use in the selectManyListbox test
      List<String> list = new ArrayList<String>(2);
      list.add("8");
      list.add("2");
      return list;
    }
    else if("iteratorList".equals(name))
    {
      if (_iteratorList == null)
      {
        // -= Simon Lessard =-
        // FIXME: _iteratorList will contains 5 null value since
        //        put return the value before the insertion at 
        //        specified key.
        // Ref: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html#put(K, V)
        _iteratorList = new ArrayList<String>();
        _iteratorList.add(new HashMap<String, String>().put("data","One"));
        _iteratorList.add(new HashMap<String, String>().put("data","Two"));
        _iteratorList.add(new HashMap<String, String>().put("data","Three"));
        _iteratorList.add(new HashMap<String, String>().put("data","Four"));
        _iteratorList.add(new HashMap<String, String>().put("data","Five"));
      }

      return _iteratorList;
    }
    else if("colorList".equals(name))
    {
      ArrayList<Color> colorList = new ArrayList<Color>();
      colorList.add(new Color(255, 0, 0));
      colorList.add(new Color(0, 0, 255));
      colorList.add(new Color(255, 255, 0));
      colorList.add(new Color(0, 255, 0));
      return colorList;
    }
    else if("treeModel".equals(name))
    {
      if (_treeModel == null)
      {
        Person john = new Person("John Smith");
        Person kim = new Person("Kim Smith");
        Person tom = new Person("Tom Smith");
        Person zoe = new Person("Zoe Smith");
        Person ira = new Person("Ira Wickrememsinghe");
        Person mallika = new Person("Mallika Wickremesinghe");

        john.getKids().add(kim);
        john.getKids().add(tom);
        tom.getKids().add(zoe);
        ira.getKids().add(mallika);

        List<Person> people = new ArrayList<Person>();
        people.add(john);
        people.add(ira);

        _treeModel = new ChildPropertyTreeModel(people, "kids");
      }

      return _treeModel;
    }
    else if("pathSet".equals(name))
View Full Code Here

Examples of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

      // Empty tree is created to prevent
      // later NPEs if menu model methods are called.
      _LOG.warning ("CREATE_TREE_WARNING: Empty Tree!");
     
      // Create empty treeModel
      ChildPropertyTreeModel treeModel = new ChildPropertyTreeModel();
                   
      // Put it in the map
      _treeModelMap.put(_currentTreeModelMapKey, treeModel);    
    }
    else
    {
      _menuList = _menuNodes.get(0);
     
      // Create the treeModel
      ChildPropertyTreeModel treeModel =
                    new ChildPropertyTreeModel(_menuList, "children");
                   
      // Put it in the map
      _treeModelMap.put(_currentTreeModelMapKey, treeModel);
     
      // If Model is the Root, then build Model's hashmaps
      // and set them on the Root Model.
      XMLMenuModel rootModel = getRootModel();
     
      if (rootModel == getModel())
      {
        _viewIdFocusPathMap = new HashMap<String,List<Object>>();
        _nodeFocusPathMap   = new HashMap<Object, List<Object>>();
        _idNodeMap          = new HashMap<String, Object>();
        Object oldPath      = treeModel.getRowKey();
    
        treeModel.setRowKey(null);
    
        // Populate the maps
        _addToMaps(treeModel, _viewIdFocusPathMap, _nodeFocusPathMap, _idNodeMap);
       
        // Cache the maps.  There is a possibility of multiple
        // root models so we must cache the maps on a per root model
        // basis.
        _viewIdFocusPathMapMap.put(_currentTreeModelMapKey, _viewIdFocusPathMap);
        _nodeFocusPathMapMap.put(_currentTreeModelMapKey, _nodeFocusPathMap);
        _idNodeMapMap.put(_currentTreeModelMapKey, _idNodeMap);
       
        treeModel.setRowKey(oldPath);
      }
    }
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

    }
  }

  public static TreeModel createModel() throws IntrospectionException
  {
    TreeModel model = new ChildPropertyTreeModel(_ROOTS, "kids");
    return model;
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

  public TreeModel getModel() throws IntrospectionException
  {
    if (_model == null)
    {
      _model = new ChildPropertyTreeModel(getInstance(), getChildProperty());
    }
    return _model;
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

      // Empty tree is created to prevent
      // later NPEs if menu model methods are called.
      _LOG.warning ("CREATE_TREE_WARNING: Empty Tree!");
     
      // Create empty treeModel
      ChildPropertyTreeModel treeModel = new ChildPropertyTreeModel();
                   
      // Put it in the map
      _treeModelMap.put(_currentTreeModelMapKey, treeModel);    
    }
    else
    {
      _menuList = _menuNodes.get(0);
     
      // Create the treeModel
      ChildPropertyTreeModel treeModel =
                    new ChildPropertyTreeModel(_menuList, "children");
                   
      // Put it in the map
      _treeModelMap.put(_currentTreeModelMapKey, treeModel);
     
      // If Model is the Root, then build Model's hashmaps
      // and set them on the Root Model.
      XMLMenuModel rootModel = getRootModel();
     
      if (rootModel == getModel())
      {
        _viewIdFocusPathMap = new HashMap<String,List<Object>>();
        _nodeFocusPathMap   = new HashMap<Object, List<Object>>();
        _idNodeMap          = new HashMap<String, Object>();
        Object oldPath      = treeModel.getRowKey();
    
        treeModel.setRowKey(null);
    
        // Populate the maps
        _addToMaps(treeModel, _viewIdFocusPathMap, _nodeFocusPathMap, _idNodeMap);
       
        // Cache the maps.  There is a possibility of multiple
        // root models so we must cache the maps on a per root model
        // basis.
        _viewIdFocusPathMapMap.put(_currentTreeModelMapKey, _viewIdFocusPathMap);
        _nodeFocusPathMapMap.put(_currentTreeModelMapKey, _nodeFocusPathMap);
        _idNodeMapMap.put(_currentTreeModelMapKey, _idNodeMap);
       
        treeModel.setRowKey(oldPath);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.