Package org.openbp.cockpit.plugins.finder.treemodel

Examples of org.openbp.cockpit.plugins.finder.treemodel.PropertyNode


  /**
   * @see org.openbp.cockpit.plugins.finder.treemodel.DataMapper#createPropertyNode(int)
   */
  public PropertyNode createPropertyNode(int level)
  {
    PropertyNode node = new PropertyNode();
    node.setNodeMapper(nodeMapper);
    node.setPropertyData(list.get(level));
    return node;
  }
View Full Code Here


    public void init(Object leafObj)
    {
      this.leafObject = (ModelObject) leafObj;
      ModelQualifier qualifier = leafObject.getQualifier();

      PropertyNode modelNode = new PropertyNode();
      ModelQualifier modelQualifier = ModelQualifier.constructModelQualifier(qualifier.getModel());
      try
      {
        // Try to load the model. If it can be loaded, then store it
        // in the node. This makes it possible to toggle between the
        // display name and the name
        Model model = ModelConnector.getInstance().getModelByQualifier(modelQualifier);
        modelNode.setNodeMapper(displayMapper);
        modelNode.setPropertyData(model);
      }
      catch (OpenBPException e)
      {
        modelNode.setNodeMapper(stringMapper);
        modelNode.setPropertyData(modelQualifier.toString());
      }

      // Add properties for the comparator and the renderer
      modelNode.addProperty(ITEMTYPE_KEY, ItemTypes.MODEL);
      modelNode.addProperty(PRIORITY_KEY, new Integer(1));
      list.add(modelNode);

      // If the found references is no item, then add the item the
      // model object belongs to a part of the 'tree path'
      if (qualifier.getObjectPath() != null)
      {
        // Add the itemtype to the tree as a group
        PropertyNode objectPathNode = new PropertyNode();
        try
        {
          Item item = ModelConnector.getInstance().getItemByQualifier(qualifier, true);
          objectPathNode.setNodeMapper(displayMapper);
          objectPathNode.setPropertyData(item);
        }
        catch (OpenBPException e)
        {
          objectPathNode.setNodeMapper(stringMapper);
          objectPathNode.setPropertyData(qualifier.getItem());
        }

        // Add properties for the comparator and the renderer
        objectPathNode.addProperty(ITEMTYPE_KEY, qualifier.getItemType());
        objectPathNode.addProperty(PRIORITY_KEY, new Integer(2));
        list.add(objectPathNode);
      }
    }
View Full Code Here

TOP

Related Classes of org.openbp.cockpit.plugins.finder.treemodel.PropertyNode

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.