What is the logic behind .form file format design? Follow
IntelliJ IDEA uses .form file format for describing Swing forms.
Let's take MyForm.form file as an example (irrelevant content is skipped)
<component id="d32e0" >
<properties>
<text value="CheckBox"/>
</properties>
</component>
My question is simple: why not to make this way? (see difference in bold)
<component id="d32e0" text="CheckBox">
</component>
My interest is to understand logic behind .form file format design.
Dmitry
Please sign in to leave a comment.
The logic is very simple: there are a number of property types (colors and fonts, for example) which are stored as multiple attributes (font name, size and style, for example), and it makes no sense to try and fit them into a single attribute value.
I'd like to change the way I ask. Why don't use id attribute more actively to avoid extra tag sections like <constraints>, <properties>, etc? For example, instead of
<component id="e01f1" >
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" fill="1" indent="0">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<font name="Angsana New" size="9" />
<text value="text"/>
</properties>
</component>
why not to use
<component id="e01f1" >
<array id="constraints">
<grid id="grid" row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" fill="1" indent="0">
<preferred-size width="150" height="-1"/>
</grid>
</array>
<array id="properties">
<font id="font" name="Angsana New" size="9" />
<text id="text" value="text"/>
</array>
</component>
?
Dmitry
I see zero advantages in such an arrangement compared to the current one. Note that the .form file format was designed in the year 2004, wasn't changed since that time, and we have no plans in changing it in the future, so I don't see much point in this discussion at all.
Thanks for the answer.
Thanks for the answer!