Hello,
thanks for answering.
The solution you propose will not be a suitable one. I chose a bad example as well. A table solution cannot work for the following example.
Please take a look at the UI at hand:
https://pasteboard.co/HZAfMcW.png
One consecutive UI dialog displaying close/open the following happens:
https://pasteboard.co/HZAgj7j.png
https://pasteboard.co/HZAgtIj.png
So, why is this happening randomly? As from the code posted, I simply nest horizontal and vertical boxes.
Example:
# special collection mapping annotations
special_collection_mappings_bx = Box(True)
special_collection_mappings_ck.set_text('Detect special collection mapping annotations (@OrderColumn, @MapKey etc.) in foreign key comments')
special_collection_mappings_ck.set_tooltip("Most annotations only apply to reverse (bidirectional) @OneToMany(mappedBy = ...)\nrelationships and forward @ManyToMany + @JoinTable relationships. For the respective annotations\nto be exported for @OneToMany relationships the 'bidirectional relationships' option must be set.")
if 'doSpecialCollectionMappings' in options:
special_collection_mappings_ck.set_active(options['doSpecialCollectionMappings'])
else:
special_collection_mappings_ck.set_active(True)
special_collection_mappings_bx.add(special_collection_mappings_ck, False, True)
# join tables
pure_join_tables_bx = Box(True)
pure_join_tables_as_many_to_many_ck.set_text('Map pure join tables as @ManyToMany + @JoinTable')
pure_join_tables_as_many_to_many_ck.set_tooltip("Pure join tables are join tables whose columns are all PK and FK at the same time, aren't\nreferenced by other tables, and they have exactly two (outgoing) many cardinality FKs\nneither being inheritance relationships nor self references. Use of @OrderColumn above\ncan make a join table @JoinTable-mappable, even though it has an extra (non-PK) column.")
if 'doPureJoinTablesAsManyToMany' in options:
pure_join_tables_as_many_to_many_ck.set_active(options['doPureJoinTablesAsManyToMany'])
else:
pure_join_tables_as_many_to_many_ck.set_active(True)
pure_join_tables_bx.add(pure_join_tables_as_many_to_many_ck, False, True)
# join table order columns
join_table_special_collection_mappings_bx = Box(True)
join_table_special_collection_mappings_ck.set_text('Consider special collection mapping annotations for pure join table detection')
join_table_special_collection_mappings_ck.set_tooltip("Join tables can use integer, string or even date fields/columns to sort lists or access\nmap instances by that column. If such an annotation is found on a foreign key of the\njoin table, the table will be mappable as @ManyToMany + @JoinTable.")
if 'doJoinTableSpecialCollectionMappings' in options:
join_table_special_collection_mappings_ck.set_active(options['doJoinTableSpecialCollectionMappings'])
else:
join_table_special_collection_mappings_ck.set_active(True)
# add dummy indentation
self.add_indentation_to(join_table_special_collection_mappings_bx) # dummy indentation label
join_table_special_collection_mappings_bx.add(join_table_special_collection_mappings_ck, False, True)
# callbacks
Callbacks.sync_join_table_special_collection_mapping_options(special_collection_mappings_ck, pure_join_tables_as_many_to_many_ck, join_table_special_collection_mappings_ck)
special_collection_mappings_ck.add_clicked_callback(lambda: Callbacks.sync_join_table_special_collection_mapping_options(special_collection_mappings_ck, pure_join_tables_as_many_to_many_ck, join_table_special_collection_mappings_ck))
pure_join_tables_as_many_to_many_ck.add_clicked_callback(lambda: Callbacks.sync_join_table_special_collection_mapping_options(special_collection_mappings_ck, pure_join_tables_as_many_to_many_ck, join_table_special_collection_mappings_ck))
collection_mapping_bx = Box(False)
collection_mapping_bx.set_spacing(2)
collection_mapping_bx.set_padding(3)
collection_mapping_bx.set_homogeneous(True)
collection_mapping_bx.add(collection_full_class_name_bx, False, True)
collection_mapping_bx.add(special_collection_mappings_bx, False, True)
collection_mapping_bx.add(pure_join_tables_bx, False, True)
collection_mapping_bx.add(join_table_special_collection_mappings_bx, False, True)
collection_mapping_pn = Panel(TitledGroupPanel)
collection_mapping_pn.set_title('Collection Mapping')
collection_mapping_pn.add(collection_mapping_bx)
tab_bx = Box(False)
tab_bx.set_spacing(3)
tab_bx.set_padding(3)
tab_bx.add(relationships_pn, False, True)
tab_bx.add(bidirectional_relationships_pn, False, True)
tab_bx.add(collection_mapping_pn, False, True)
The above is the code to create the third panel of the tab.
So, again, why is this happening? To me this look like undesired behavior.
Can the team please look into this?
Thanks
Karsten