Changeset 22688


Ignore:
Timestamp:
03/09/10 11:58:28 (17 months ago)
Author:
dbutano
Message:

Only if the constraint has possible values, the getValidOps method returns a list containing LIKE, NOT LIKE, IN , NOT IN too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mnw21/pathquery_refactor/intermine/web/main/src/org/intermine/web/logic/query/DisplayConstraint.java

    r22651 r22688  
    416416            // <c:if test="${!(editingNode.type == 'String' && (op.value == '<=' 
    417417                                                             //|| op.value == '>='))}"> 
    418  
    419418            // TODO this should show different options if a dropdown is to be used 
    420  
     419            boolean existPossibleValues = 
     420                (getPossibleValues() != null && getPossibleValues().size() > 0) ? true : false; 
    421421            for (ConstraintOp op : allOps) { 
     422                if (!existPossibleValues && (op.getIndex() == 6 || op.getIndex() == 7)) { 
     423                    continue; 
     424                } 
    422425                validOps.add(new DisplayConstraintOption(op.toString(), op.getIndex())); 
    423426            } 
    424  
    425             for (ConstraintOp op : PathConstraintMultiValue.VALID_OPS) { 
    426                 validOps.add(new DisplayConstraintOption(op.toString(), 
     427            if (existPossibleValues) { 
     428                for (ConstraintOp op : PathConstraintMultiValue.VALID_OPS) { 
     429                    validOps.add(new DisplayConstraintOption(op.toString(), 
    427430                        op.getIndex())); 
    428             } 
    429  
     431                } 
     432            } 
    430433        } else if (isLookup()) { 
    431434            // this must be a LOOKUP constraint 
Note: See TracChangeset for help on using the changeset viewer.