Examples of ChildPropertyTreeModel


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

      getInstance().getDiscs().add(new Disc(getInstance()));
   }
  
   public TreeModel getTree()
   {
      return new ChildPropertyTreeModel(artists, "discs")
      {
         @Override
         protected Object getChildData(Object parentData)
         {
            if (parentData instanceof Artist)
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

  public void endDocument()
  {
    _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

      // 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

  {
    _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

  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

    else
    {
      _menuList = _menuNodes.get(0);

      // Create the treeModel
      ChildPropertyTreeModel treeModel =
                    new ChildPropertyTreeModel(_menuList, "children");


      if (_isRootHandler)
      {
        _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);

        treeModel.setRowKey(oldPath);
      }
    }
  }
View Full Code Here

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

  {
     List<MenuNode> list = _menuList;
    
    // If we have a cached model, return it.
    if (list != null)
      return new ChildPropertyTreeModel(list,"children");

    synchronized(this)
    {
      list = _menuList;
      if (list == null)// double check inside lock
      {
        // Build a Tree model.  Parsing puts the tree model
        // in the map, see method endDocument().
        _currentTreeModelMapKey = uri;
        try
        {
          // Get a parser.  NOTE: we are using the jdk's 1.5 SAXParserFactory
          // and SAXParser here.
          SAXParser parser = _SAX_PARSER_FACTORY.newSAXParser();

          // Call the local menu model's getStream() method. This is a model
          // method so that it can be overridden by any model extending
          // XmlMenuModel.
          InputStream inStream = getModel().getStream(uri);

          // Parse the metadata
          parser.parse(inStream, this);

          inStream.close();
        } catch (SAXException saxex)
        {
          _LOG.severe("SAX Parse Exception parsing " + uri + ": " +
              saxex.getMessage(), saxex);
        } catch (IOException ioe)
        {
          _LOG.severe("Unable to open an InputStream to " + uri, ioe);
        } catch (IllegalArgumentException iae)
        {
          _LOG.severe("InputStream to " + iae + " is null", iae);
        } catch (ParserConfigurationException pce)
        {
          _LOG.severe("Unable to create SAX parser for " + uri, pce);
        }
        list = _menuList;
      }
    }
    return new ChildPropertyTreeModel(list,"children");
  }
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

      // 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.