Package com.projity.grouping.core

Examples of com.projity.grouping.core.Node


    if (col == 0)
      return false;
    Field field=getFieldInColumn(col);
    if (field.getLookupTypes() != null)
      return false;
    Node node = getNodeInRow(row);
    NodeModel nodeModel=getCache().getModel();
//     if (!nodeModel.isLocal()&&!nodeModel.isMaster()&&!Environment.getStandAlone()) return false;
   
    if (node.isVoid()&&!(nodeModel.isLocal()||nodeModel.isMaster())&&"Field.userRole".equals(field.getId()))
      return false;

    if (node.isVoid())
      return true;
    return !field.isReadOnly(node, getCache().getWalkersModel(), null);
  }
View Full Code Here


  public LeafWalker(Closure visitor) {
    super(visitor);
  }
 
  public void execute(Object arg0) {
    Node node = (Node)arg0;
    Collection nodeList = nodeModel.getChildren(node);
    if (nodeList == null || nodeList.isEmpty()) { // if has no children
      if (visitor != null
        visitor.execute(node); // add value
    } else {
View Full Code Here

  }
  public static Field getFieldInColumn(int col,SpreadSheetColumnModel colModel) {
    return colModel.getFieldInColumn(col);
  }
  public static Object getValueAt(int row, int col,int rowMultiple,NodeModelCache cache,SpreadSheetColumnModel colModel,FieldContext context) {
    Node node = getNodeInRow(row,rowMultiple,cache);
    return getValueAt(node, col, cache, colModel, context);
  }
View Full Code Here

* For internal use only
*/
public class NotAssignmentFilter extends NodeFilter {
  private boolean writableOnly = false;
  public boolean evaluate(Object obj) {
    Node node=(Node)obj;
    Object impl = node.getImpl();
    if (impl == null)
      return false;
    if (impl instanceof VoidNodeImpl)
      return false;
    if  (impl instanceof Assignment)
View Full Code Here

 
  public void execute(Object arg0) {
    if (findClosure.result != null)
      return;
    Node node = (Node) arg0;
    if (node != null)
      closure.execute(node);
    Collection nodeList = nodeModel.getChildren(node);
    if (nodeList != null)
      CollectionUtils.forAllDo(nodeList, this);
View Full Code Here

        showAssignments=Boolean.valueOf(arg).booleanValue();
    else showAssignments=false;
  }

  public boolean evaluate(Object obj) {
    Node node=(Node)obj;
    return showAssignments||!(node.getImpl() instanceof Assignment);
  }
View Full Code Here

    Object result = null;
    FindClosure(Predicate condition) {
      this.condition = condition;
    }
    public void execute(Object arg0) {
      Node node = (Node) arg0;
      Object impl = node.getImpl();
      if (condition.evaluate(impl))
        result = impl;
    }
View Full Code Here

    super();
  }
   

  public boolean evaluate(Object obj) {
    Node node=(Node)obj;
    Object impl = node.getImpl();
    if (impl == null)
      return false;
    if (impl instanceof ResourceImpl)
      return filterTeam?((ResourceImpl)impl).isInTeam():true;
    else if (impl instanceof AssignmentEntry)
View Full Code Here

    private void setSubprojectLevel(Node node,int level){
      node.setSubprojectLevel(level);
      int subprojectLevel=getChildrenSubprojectLevel(node);
      for (Enumeration e=node.children();e.hasMoreElements();){
        Node child=(Node)e.nextElement();
        setSubprojectLevel(child, subprojectLevel);
      }

    }
View Full Code Here

      else
        return parent.getSubprojectLevel();
    }

    public void add(Node parent,List children,int position,int actionType){
      Node p=(parent==null)?root:parent;
//      ArrayList trees=new ArrayList();
//      extractParents(children,trees);
      if (/*trees*/children.size()==0) return;

      int subprojectLevel=getChildrenSubprojectLevel(parent);

      int childCount=p.getChildCount();
      if (position>childCount){
        NodeFactory nodeFactory=NodeFactory.getInstance();
        for (int i=childCount;i<position;i++){
          Node node=nodeFactory.createVoidNode();
          setSubprojectLevel(node,subprojectLevel);
          p.add(node);
        }
      }

      int j=position;
         for (Iterator i=/*trees*/children.iterator();i.hasNext();){
           Node node=(Node)i.next();
          //if (node.getImpl() instanceof Task) System.out.println("ADD parent="+parent+":"+(parent==null?"X":parent.isInSubproject())+", node="+node+":"+node.isInSubproject());
      setSubprojectLevel(node,subprojectLevel);
      //if (node.getImpl() instanceof Task) System.out.println("ADD node in sub="+node.isInSubproject());
        if (position==-1) p.add(node);
      else p.insert(node,j++);
View Full Code Here

TOP

Related Classes of com.projity.grouping.core.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.