mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Handle array value string representation
This commit is contained in:
@@ -30,6 +30,7 @@ import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
import org.diylc.core.IDIYComponent;
|
||||
import org.diylc.core.Project;
|
||||
import org.diylc.core.annotations.EditableProperty;
|
||||
@@ -87,8 +88,15 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue() == null ? "" : getValue().toString();
|
||||
public String getValueForDisplay() {
|
||||
if (getValue() == null)
|
||||
return "";
|
||||
|
||||
Object val = getValue();
|
||||
if (val.getClass().isArray()) {
|
||||
return String.join(" / ", Arrays.stream((Object[])val).map(x -> x == null ? "" : x.toString()).collect(Collectors.toList()));
|
||||
}
|
||||
return val.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4241,6 +4241,10 @@
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Added 'PCB Terminal Block' component</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Show component values in the project explorer</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
|
||||
Binary file not shown.
@@ -49,7 +49,6 @@ AWG
|
||||
Alternate
|
||||
And
|
||||
Angle Offset
|
||||
Apply Model
|
||||
B-C-E BJT
|
||||
Background
|
||||
Box
|
||||
@@ -148,7 +147,6 @@ Source Style
|
||||
Source Type
|
||||
Srpski
|
||||
Stroke
|
||||
TB2
|
||||
Ten
|
||||
Terminal
|
||||
Timing
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user