Example #1
0
 public void setFilterConditionItem(FilterConditionItem filterConditionItem) {
   this.filterConditionItem = filterConditionItem;
   textField.setText(String.valueOf(filterConditionItem.getLeft().getText()));
   criteriaCombo.setSelectedItem(filterConditionItem.getCriteria());
   colValCheckBox.setSelected(
       filterConditionItem.getRight() != null
           && filterConditionItem.getRight()[0] instanceof CellValue);
   casecheckBox.setSelected(!filterConditionItem.isCaseSensitive());
   if (filterConditionItem.getCriteria() == Criteria.IS_IN
       || filterConditionItem.getCriteria() == Criteria.IS_NOT_IN) {
     setMultiTextbox(true);
     ((ComparedValuePanel) lowerPanel.getComponent(0))
         .textField_1.setText(filterConditionItem.getRight()[0].getText());
     for (int i = 0; i < filterConditionItem.getRight().length; i++) {
       IValue val = filterConditionItem.getRight()[i];
       if (i == 0) {
         ((ComparedValuePanel) lowerPanel.getComponent(0)).textField_1.setText(val.getText());
       } else {
         addComparedValuePanel().textField_1.setText(val.getText());
       }
     }
   } else {
     setMultiTextbox(false);
     ((ComparedValuePanel) lowerPanel.getComponent(0))
         .textField_1.setText(filterConditionItem.getRight()[0].getText());
   }
 }
  @Override
  public String toString() {
    StringBuffer buffer = new StringBuffer("[");
    if (elements.size() > 0) {
      buffer.append(elements.get(0).toString());
      for (int i = 1; i < elements.size(); i++) {
        IValue el = elements.get(i);
        buffer.append("," + el.toString());
      }
    }
    buffer.append("]");

    return buffer.toString();
  }
Example #3
0
 public IValue multiply(IValue other) {
   DataType dataType = getDataType().evaluate(OperatorKind.MULTIPLY, other.getDataType());
   if (dataType instanceof InvalidDataType) {
     return InvalidValue.SINGLETON;
   }
   if (other instanceof AnyValue) {
     return new AnyValue(getContext(), dataType);
   }
   if (other instanceof UninitializedValue || other instanceof InvalidValue) {
     return InvalidValue.SINGLETON;
   }
   return doMultiply(other, dataType);
 }
Example #4
0
 public IValue subtract(IValue other) {
   DataType dataType = getDataType().evaluate(OperatorKind.SUBTRACT, other.getDataType());
   if (dataType instanceof InvalidDataType) {
     return InvalidValue.SINGLETON;
   }
   if (other instanceof AnyValue) {
     return new AnyValue(getContext(), dataType);
   }
   if (other instanceof UninitializedValue || other instanceof InvalidValue) {
     return InvalidValue.SINGLETON;
   }
   return doSubtract(other, dataType);
 }
Example #5
0
 public IValue notEqualTo(IValue other) {
   DataType dataType = getDataType().evaluate(OperatorKind.NOT_EQUAL_TO, other.getDataType());
   if (dataType instanceof InvalidDataType) {
     return InvalidValue.SINGLETON;
   }
   if (other instanceof AnyValue) {
     return new AnyValue(getContext(), dataType);
   }
   if (other instanceof UninitializedValue || other instanceof InvalidValue) {
     return InvalidValue.SINGLETON;
   }
   return doNotEqualTo(other, dataType);
 }
Example #6
0
 public IValue greaterThan(IValue other) {
   DataType dataType = getDataType().evaluate(OperatorKind.GREATER_THAN, other.getDataType());
   if (dataType instanceof InvalidDataType) {
     return InvalidValue.SINGLETON;
   }
   if (other instanceof AnyValue) {
     return new AnyValue(getContext(), dataType);
   }
   if (other instanceof UninitializedValue || other instanceof InvalidValue) {
     return InvalidValue.SINGLETON;
   }
   return doGreaterThan(other, dataType);
 }
Example #7
0
 public IValue divide(IValue other) {
   DataType dataType = getDataType().evaluate(OperatorKind.DIVIDE, other.getDataType());
   if (dataType instanceof InvalidDataType) {
     return InvalidValue.SINGLETON;
   }
   if (other instanceof AnyValue) {
     return new AnyValue(getContext(), dataType);
   }
   if (other instanceof UninitializedValue || other instanceof InvalidValue) {
     return InvalidValue.SINGLETON;
   }
   return doDivide(other, dataType);
 }