Introduce Tokens and Argeo Studio styling
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / script / cms.js
index 1aacd2c4a91deb564aa67d4813c98a6f7c080a10..2ffcf9e751b6a374bfaeae44b623d3a5fe50d4c0 100644 (file)
@@ -22,6 +22,13 @@ function loadNode(node) {
        return fromJson
 }
 
+function newArea(parent, style, layout) {
+       var control = new Composite(parent, SWT.NONE)
+       control.setLayout(layout)
+       CmsUtils.style(control, style)
+       return control
+}
+
 function newLabel(parent, style, text) {
        var control = new Label(parent, SWT.NONE)
        control.setText(text)
@@ -30,6 +37,14 @@ function newLabel(parent, style, text) {
        return control
 }
 
+function newButton(parent, style, text) {
+       var control = new Button(parent, SWT.FLAT)
+       control.setText(text)
+       CmsUtils.style(control, style)
+       CmsUtils.markup(control)
+       return control
+}
+
 function newFormLabel(parent, style, text) {
        return newLabel(parent, style, '<b>' + text + '</b>')
 }