Enterprise Architect scripting with java - add CustomProperty

孤人 提交于 2019-12-05 20:41:48

You can try to add the custom property using code, but I'm pretty sure you'll have to resort to an SQL hack to be able to fill in all the required details. If you check the database you'll find that a all the custom properties of your legend are stored in a single row in the table t_xref. The column Client contains the t_object.ea_guid and the description column contains all the details of your custom properties. I did a small test and this is what was stored in the description (I added newlines for the readability)

@PROP=@NAME=Wit@ENDNAME;@TYPE=LEGEND_OBJECTSTYLE@ENDTYPE;@VALU=#Back_Ground_Color#=16777215;#Pen_Color#=16777215;#Pen_Size#=1;#Legend_Type#=LEGEND_OBJECTSTYLE;@ENDVALU;@PRMT=0@ENDPRMT;@ENDPROP;
@PROP=@NAME=rood@ENDNAME;@TYPE=LEGEND_OBJECTSTYLE@ENDTYPE;@VALU=#Back_Ground_Color#=255;#Pen_Color#=255;#Pen_Size#=1;#Legend_Type#=LEGEND_OBJECTSTYLE;@ENDVALU;@PRMT=1@ENDPRMT;@ENDPROP;
@PROP=@NAME=blauw@ENDNAME;@TYPE=LEGEND_OBJECTSTYLE@ENDTYPE;@VALU=#Back_Ground_Color#=16711680;#Pen_Color#=16711680;#Pen_Size#=1;#Legend_Type#=LEGEND_OBJECTSTYLE;@ENDVALU;@PRMT=2@ENDPRMT;@ENDPROP;
@PROP=@NAME=Legend@ENDNAME;@TYPE=LEGEND_STYLE_SETTINGS@ENDTYPE;@VALU=@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP;

If I where you I would use Repository.Execute() with a dirty SQL insert statement to get the job done.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!