use of org.csstudio.swt.widgets.datadefinition.LongArrayWrapper in project yamcs-studio by yamcs.
the class ArrayEditPart method setValue.
@Override
public void setValue(Object value) {
if (value == null) {
return;
}
if (value.getClass().isArray()) {
var index = getArrayFigure().getIndex();
valueArray = value;
if (value instanceof String[]) {
var a = (String[]) value;
setChildrenValue(index, asList(a), ArrayDataType.STRING_ARRAY);
} else if (value instanceof Object[]) {
var a = (Object[]) value;
setChildrenValue(index, asList(a), ArrayDataType.OBJECT_ARRAY);
} else if (value instanceof double[]) {
setChildrenValue(index, new DoubleArrayWrapper((double[]) value), ArrayDataType.DOUBLE_ARRAY);
} else if (value instanceof long[]) {
setChildrenValue(index, new LongArrayWrapper((long[]) value), ArrayDataType.LONG_ARRAY);
} else if (value instanceof byte[]) {
setChildrenValue(index, new ByteArrayWrapper((byte[]) value), ArrayDataType.BYTE_ARRAY);
} else if (value instanceof float[]) {
setChildrenValue(index, new FloatArrayWrapper((float[]) value), ArrayDataType.FLOAT_ARRAY);
} else if (value instanceof short[]) {
setChildrenValue(index, new ShortArrayWrapper((short[]) value), ArrayDataType.SHORT_ARRAY);
} else if (value instanceof int[]) {
setChildrenValue(index, new IntArrayWrapper((int[]) value), ArrayDataType.INT_ARRAY);
}
return;
}
super.setValue(value);
}
Aggregations