mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +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.Field;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import org.diylc.core.IDIYComponent;
|
import org.diylc.core.IDIYComponent;
|
||||||
import org.diylc.core.Project;
|
import org.diylc.core.Project;
|
||||||
import org.diylc.core.annotations.EditableProperty;
|
import org.diylc.core.annotations.EditableProperty;
|
||||||
@@ -87,8 +88,15 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValueForDisplay() {
|
public String getValueForDisplay() {
|
||||||
return getValue() == null ? "" : getValue().toString();
|
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>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>NEW_FEATURE</changeType>
|
<changeType>NEW_FEATURE</changeType>
|
||||||
<description>Added 'PCB Terminal Block' component</description>
|
<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>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
|||||||
Binary file not shown.
@@ -49,7 +49,6 @@ AWG
|
|||||||
Alternate
|
Alternate
|
||||||
And
|
And
|
||||||
Angle Offset
|
Angle Offset
|
||||||
Apply Model
|
|
||||||
B-C-E BJT
|
B-C-E BJT
|
||||||
Background
|
Background
|
||||||
Box
|
Box
|
||||||
@@ -148,7 +147,6 @@ Source Style
|
|||||||
Source Type
|
Source Type
|
||||||
Srpski
|
Srpski
|
||||||
Stroke
|
Stroke
|
||||||
TB2
|
|
||||||
Ten
|
Ten
|
||||||
Terminal
|
Terminal
|
||||||
Timing
|
Timing
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user