if (featureValue.getFeature().getRange().isPrimitive()) {
cell.setText(featureValue.getFeatureStructure().getFeatureValueAsString(
featureValue.getFeature()));
}
else {
FeatureStructure value = (FeatureStructure) featureValue.getValue();
if (value == null) {
cell.setText("null");
} else {
cell.setText("[" + value.getType().getShortName() + "]");
}
}
}
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 {
cell.setText("[" + fs.getType().getShortName() + "]");
}
}
else {
throw new TaeError("Unexpected array type!");
}