Package org.apache.uima.caseditor.editor

Examples of org.apache.uima.caseditor.editor.ArrayValue


        }
      }
    }
    else if (element instanceof ArrayValue) {

      ArrayValue value = (ArrayValue) element;

      // if primitive array
      if (value.getFeatureStructure() instanceof CommonArrayFS ||
              value.getFeatureStructure() instanceof StringArrayFS) {
        cell.setText(value.get().toString());
      }
      else if (value.getFeatureStructure() instanceof ArrayFS) {
        ArrayFS array = (ArrayFS) value.getFeatureStructure();

        FeatureStructure fs = array.get(value.slot());

        if (fs == null) {
          cell.setText("null");
        }
        else {
View Full Code Here


                document.update(target);

                event.detail = DND.DROP_COPY;
              }
            } else if (tableItem.getData() instanceof ArrayValue) {
              ArrayValue value = (ArrayValue) tableItem.getData();

              if (value.getFeatureStructure() instanceof ArrayFS) {

                ArrayFS array = (ArrayFS) value.getFeatureStructure();

                array.set(value.slot(), (FeatureStructure) event.data);

                document.update(array);

                event.detail = DND.DROP_COPY;
              }
View Full Code Here

        return value.getFeature().getRange().isPrimitive();
      }
      else if (element instanceof ArrayValue) {

        ArrayValue value = (ArrayValue) element;

        FeatureStructure arrayFS = value.getFeatureStructure();

        if (arrayFS instanceof ArrayFS) {
          return false;
        }
        else if (arrayFS instanceof CommonArrayFS ||
View Full Code Here

        else {
          return null;
        }
      } else if (element instanceof ArrayValue) {

        ArrayValue arrayValue = (ArrayValue) element;

        FeatureStructure arrayFS = arrayValue.getFeatureStructure();

        CellEditor editor;

        if (arrayFS instanceof BooleanArrayFS) {
          editor = new ComboBoxCellEditor(viewer.getTree(), new String[]{"false", "true"},
View Full Code Here

        return featureValues.toArray();
      }
      else {
        int size = arraySize(featureStructure);

        ArrayValue arrayValues[] = new ArrayValue[size];

        for (int i = 0; i < size; i++) {
          arrayValues[i] = new ArrayValue(featureStructure, i);
        }

        return arrayValues;
      }
View Full Code Here

        FeatureStructure arrayFS = value.getFeatureStructure().getFeatureValue(value.getFeature());

        return getElements(arrayFS);
      }
    } else if (parentElement instanceof ArrayValue) {
      ArrayValue value = (ArrayValue) parentElement;

      ArrayFS array = (ArrayFS) value.getFeatureStructure();

      return getElements(array.get(value.slot()));
    }
    else {
      throw new TaeError("Unexpected element type!");
    }
  }
View Full Code Here

      else {
        return hasChildren((FeatureStructure) value.getValue());
      }
    } else if (element instanceof ArrayValue) {

      ArrayValue value = (ArrayValue) element;

      if (value.getFeatureStructure() instanceof ArrayFS) {

        ArrayFS array = (ArrayFS) value.getFeatureStructure();

        return hasChildren(array.get(value.slot()));
      }
      else {
        // false for primitive arrays
        return false;
      }
View Full Code Here

      cell.setText(featureValue.getFeature().getShortName());

    }
    else if (element instanceof ArrayValue) {
      ArrayValue arrayValue = (ArrayValue) cell.getElement();

      cell.setText(Integer.toString(arrayValue.slot()));
    }
    else {
      throw new TaeError("Unkown element!");
    }
  }
View Full Code Here

              getBooleanValue(featureValue.getFeature()));
        }

      }
      else if (element instanceof ArrayValue) {
          ArrayValue value = (ArrayValue) element;

          // if not a boolean array return string value
          if (!(value.getFeatureStructure() instanceof BooleanArrayFS)) {
            return value.get().toString();
          }
          else {
            return booleanToInt((Boolean) value.get());
          }
      }
      else {
        throw new TaeError("Unkown element type!");
      }
View Full Code Here

          viewer.update(element, null);

        } else if (element instanceof ArrayValue) {

          ArrayValue arrayValue = (ArrayValue) element;

          if (!(arrayValue.getFeatureStructure() instanceof BooleanArrayFS)) {
            arrayValue.set((String) value);
          }
          else {
            arrayValue.set(Boolean.toString(
                    intToBoolean((Integer) value)).toString());
          }

          document.update(arrayValue.getFeatureStructure());

        } else {
          throw new TaeError("Unkown element type");
        }
      }
View Full Code Here

TOP

Related Classes of org.apache.uima.caseditor.editor.ArrayValue

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.