Package org.apache.myfaces.trinidad.model

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


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


    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

  {
     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

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

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

    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

  {
     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

    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

  {
     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

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

Related Classes of org.apache.myfaces.trinidad.model.ChildPropertyTreeModel$Node

Copyright © 2018 www.massapicom. 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.