Last active
June 16, 2021 14:48
-
-
Save cdcharlebois/1cf7fb830df066c18efdc4bb1434bfea to your computer and use it in GitHub Desktop.
Add this to your `xml.json` snippets file to enable some handy snippets for Mendix widgets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////// | |
// PLUGGABLE WIDGET PROPS // | |
//////////////////////////// | |
"Pluggable Property Group": { | |
"prefix": "pprop-group", | |
"body": [ | |
"<propertyGroup caption=\"${1|General,Behavior,Data Source,Appearance|}\">", | |
"</propertyGroup>" | |
] | |
}, | |
"Pluggable Property String": { | |
"prefix": "pprop-string", | |
"body": [ | |
"<property key=\"${1:string}\" type=\"string\" required=\"${4|false,true|}\" multiline=\"${5|false,true|}\">", | |
" <caption>${2:String}</caption>", | |
" <description>${3}</description>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Boolean": { | |
"prefix": "pprop-boolean", | |
"body": [ | |
"<property key=\"${1:boolean}\" type=\"boolean\" defaultValue=\"${4|false,true|}\">", | |
" <caption>${2:Boolean}</caption>", | |
" <description>${3}</description>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Integer": { | |
"prefix": "pprop-int", | |
"body": [ | |
"<property key=\"${1:integer}\" type=\"integer\" defaultValue=\"1\" required=\"${4|false,true|}\">", | |
" <caption>${2:Number}</caption>", | |
" <description>${3}</description>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Enum": { | |
"prefix": "pprop-enum", | |
"body": [ | |
"<property key=\"${1:enumeration}\" type=\"enumeration\" defaultValue=\"${5}\" required=\"${6|false,true|}\">", | |
" <caption>${2:Enumeration}</caption>", | |
" <description>${3}</description>", | |
" <enumerationValues>", | |
" <enumerationValue key=\"${5:key}\">${4:Caption}</enumerationValue>", | |
" </enumerationValues>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Icon": { | |
"prefix": "pprop-icon", | |
"body": [ | |
"<property key=\"${1:icon}\" type=\"icon\" required=\"${4|false,true|}\">", | |
" <caption>${2:Icon}</caption>", | |
" <description>${3}</description>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Image": { | |
"prefix": "pprop-image", | |
"body": [ | |
"<property key=\"${1:image}\" type=\"image\" required=\"${4|false,true|}\">", | |
" <caption>${2:Image}</caption>", | |
" <description>${3}</description>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Content": { | |
"prefix": "pprop-content", | |
"body": [ | |
"<property key=\"${1:content}\" type=\"widgets\" required=\"${4|false,true|}\" dataSource=\"${5:datasource}\">", | |
" <caption>${2:Content}</caption>", | |
" <description>${3}</description>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Expression": { | |
"prefix": "pprop-expression", | |
"body": [ | |
"<property key=\"${1:expression}\" type=\"expression\" defaultValue=\"${5}\">", | |
" <caption>${2:Expression}</caption>", | |
" <description>${3: What does it mean?}</description>", | |
" <returnType type=\"${4|Boolean,DateTime,Decimal,Integer,String|}\" />", | |
"</property>" | |
] | |
}, | |
"Pluggable Property TextTemplate": { | |
"prefix": "pprop-text-template", | |
"body": [ | |
"<property key=\"${1:textTemplate}\" type=\"textTemplate\" required=\"${4|false,true|}\" multiline=\"${5|false,true|}\">", | |
" <caption>${2:Text Template}</caption>", | |
" <description>${3}</description>", | |
" <translations>", | |
" <translation lang=\"en_US\">${6:defaultValue}</translation>", | |
" </translations>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Action": { | |
"prefix": "pprop-action", | |
"body": [ | |
"<property key=\"${1:action}\" type=\"action\">", | |
" <caption>${2:Action}</caption>", | |
" <description>${3}</description>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Attribute": { | |
"prefix": "pprop-attr", | |
"body": [ | |
"<property key=\"${1:attribute}\" type=\"attribute\" required=\"${4|false,true|}\" onChange=\"${5:action}\">", | |
" <caption>${2:Attribute}</caption>", | |
" <description>${3}</description>", | |
" <attributeTypes>", | |
" <attributeType name=\"String\" />", | |
" <attributeType name=\"Binary\" />", | |
" <attributeType name=\"Boolean\" />", | |
" <attributeType name=\"DateTime\" />", | |
" <attributeType name=\"Decimal\" />", | |
" <attributeType name=\"Enum\" />", | |
" <attributeType name=\"HashString\" />", | |
" <attributeType name=\"Integer\" />", | |
" <attributeType name=\"Long\" />", | |
" <attributeType name=\"AutoNumber\" />", | |
" </attributeTypes>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Object": { | |
"prefix": "pprop-obj", | |
"body": [ | |
"<property key=\"${1:object}\" type=\"object\" isList=\"${4|true,false|}\" required=\"${5|false,true|}\">", | |
" <caption>${2:Object}</caption>", | |
" <description>${3}</description>", | |
" <properties>", | |
" $0", | |
" </properties>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property File": { | |
"prefix": "pprop-file", | |
"body": [ | |
"<property key=\"${1:file}\" type=\"file\" required=\"${4|false, true|}\">", | |
" <caption>${2:File}</caption>", | |
" <description>${3}</description>", | |
"</property>" | |
] | |
}, | |
"Pluggable Property Datasource": { | |
"prefix": "pprop-datasource", | |
"body": [ | |
"<property key=\"${1:datasource}\" type=\"datasource\" required=\"${4|true,false|}\" isList=\"true\">", | |
" <caption>${2:Data Source}</caption>", | |
" <description>${3}</description>", | |
"</property>" | |
] | |
}, | |
"System Property Label": { | |
"prefix": "sprop-label", | |
"body": "<systemProperty key=\"Label\"/>" | |
}, | |
"System Property Name": { | |
"prefix": "sprop-name", | |
"body": "<systemProperty key=\"Name\"/>" | |
}, | |
"System Property TabIndex": { | |
"prefix": "sprop-tab-index", | |
"body": "<systemProperty key=\"TabIndex\"/>" | |
}, | |
"System Property Visibility": { | |
"prefix": "sprop-visibility", | |
"body": "<systemProperty key=\"Visibility\"/>" | |
}, | |
"System Property Editability": { | |
"prefix": "sprop-editability", | |
"body": "<systemProperty key=\"Editability\"/>" | |
}, | |
////////////////////// | |
// OLD WIDGET PROPS // | |
////////////////////// | |
"Mendix Prop String": { | |
"prefix": "prop-string", | |
"body": [ | |
"<property key=\"${1:string}\" type=\"string\" required=\"${5|false,true|}\">", | |
" <caption>${2:String}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop String Translatable": { | |
"prefix": "prop-string-tx", | |
"body": [ | |
"<property key=\"${1:translatableMessage}\" type=\"translatableString\" required=\"${5|false,true|}\">", | |
" <caption>${2:Message}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
" <translations>", | |
" <translation lang=\"en_US\">Add your message here.</translation>", | |
" </translations>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop MF": { | |
"prefix": "prop-mf", | |
"body": [ | |
"<property key=\"${1:microflow}\" type=\"microflow\" required=\"${6|false,true|}\">", | |
" <caption>${2:Microflow}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
" <returnType type=\"${5|Void,Boolean,Integer,Float,DateTime,String,Object|}\" />", | |
"</property>" | |
] | |
}, | |
"Mendix Prop Object": { | |
"prefix": "prop-obj", | |
"body": [ | |
"<property key=\"${1:object}\" type=\"object\" isList=\"${5|true,false|}\" required=\"${6|false,true|}\">", | |
" <caption>${2:Object}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
" <properties>", | |
" $0", | |
" </properties>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop Enum": { | |
"prefix": "prop-enum", | |
"body": [ | |
"<property key=\"${1:enumeration}\" type=\"enumeration\" defaultValue=\"${6}\" required=\"${7|false,true|}\">", | |
" <caption>${2:Enumertion}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
" <enumerationValues>", | |
" <enumerationValue key=\"${6:key}\">${5:Caption}</enumerationValue>", | |
" </enumerationValues>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop Attribute": { | |
"prefix": "prop-attr", | |
"body": [ | |
"<property key=\"${1:attribute}\" type=\"attribute\" required=\"${5|false,true|}\">", | |
" <caption>${2:Attribute}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
" <attributeTypes>", | |
" <attributeType name=\"String\" />", | |
" <attributeType name=\"Binary\" />", | |
" <attributeType name=\"Boolean\" />", | |
" <attributeType name=\"DateTime\" />", | |
" <attributeType name=\"Decimal\" />", | |
" <attributeType name=\"Enum\" />", | |
" <attributeType name=\"HashString\" />", | |
" <attributeType name=\"Integer\" />", | |
" <attributeType name=\"Long\" />", | |
" </attributeTypes>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop Boolean": { | |
"prefix": "prop-boolean", | |
"body": [ | |
"<property key=\"${1:someBoolean}\" type=\"boolean\" defaultValue=\"${5|true,false|}\">", | |
" <caption>${2:Some Boolean}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop Integer": { | |
"prefix": "prop-int", | |
"body": [ | |
"<property key=\"${1:integer}\" type=\"integer\" defaultValue=\"1\" required=\"${5|false,true|}\">", | |
" <caption>${2:Number}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop Entity": { | |
"prefix": "prop-entity", | |
"body": [ | |
"<property key=\"${1:entity}\" type=\"entity\" isPath=\"${5|optional,yes,no|}\" allowNonPersistableEntities=\"${6|true,false|}\" pathType=\"${7|reference,referenceSet|}\" required=\"${8|false,true|}\">", | |
" <caption>${2:Entity}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop Entity-Constraint": { | |
"prefix": "prop-xpath", | |
"body": [ | |
"<property key=\"${1:xpath}\" type=\"entityConstraint\" entityProperty=\"${5:.}\" required=\"${6|false,true|}\">", | |
" <caption>${2:Xpath}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop Form": { | |
"prefix": "prop-form", | |
"body": [ | |
"<property key=\"${1:form}\" type=\"form\" required=\"${5|false,true|}\">", | |
" <caption>${2:Page}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop Image": { | |
"prefix": "prop-img", | |
"body": [ | |
"<property key=\"${1:image}\" type=\"image\" required=\"${5|false,true|}\">", | |
" <caption>${2:Image}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
"</property>" | |
] | |
}, | |
"Mendix Prop Nanoflow": { | |
"prefix": "prop-nano", | |
"body": [ | |
"<property key=\"${1:nanoflow}\" type=\"nanoflow\" required=\"false\" needsEntityContext=\"true\">", | |
" <caption>${2:Nanoflow}</caption>", | |
" <category>${3|General,Behavior,Data Source,Appearance|}</category>", | |
" <description>${4}</description>", | |
" <returnType type=\"${5|Void,Boolean,Integer,Float,DateTime,String,Object|}\" />", | |
"</property>", | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment