{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f1 = new EasyForm(\"Legend name\")\n", "f1" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f2 = new EasyForm(\"form2\")\n", "f2.addTextField(\"field name2\")\n", "f2" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f2['field name2']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f2['field name2'] = '2text from code2'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f2b = new EasyForm(\"form2\")\n", "f2b.addTextField(\"field name2\", 10)\n", "f2b" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f3 = new EasyForm(\"form3\")\n", "f3.addTextArea(\"field name3\")\n", "f3" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f3['field name3']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f3['field name3'] = '3text from code3'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f3b = new EasyForm(\"form3\")\n", "f3b.addTextArea(\"field name3\", 20, 5)\n", "f3b" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f3c = new EasyForm(\"form3\")\n", "f3c.addTextArea(\"field name3\", '3c initial value 3c')\n", "f3c" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f4 = new EasyForm(\"form4\")\n", "f4.addCheckBox(\"field name4\")\n", "f4" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f4['field name4']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f4['field name4'] = 'false'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f4b = new EasyForm(\"form4\")\n", "f4b.addCheckBox(\"field name4\", Boolean.TRUE)\n", "f4b" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f5 = new EasyForm(\"form5\")\n", "f5.addComboBox(\"field name5\", [\"onef5\", \"twof5\", \"threef5\"])\n", "f5" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f5['field name5']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f5['field name5'] = 'threef5'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f6 = new EasyForm(\"form6\")\n", "f6.addList(\"field name6\", [\"onef6\", \"twof6\", \"threef6\"])\n", "f6" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f6['field name6']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f6['field name6'] = ['onef6']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f6b = new EasyForm(\"form6b\")\n", "f6b.addList(\"field name6\", [\"onef6b\", \"twof6b\", \"threef6b\"], Boolean.FALSE)\n", "f6b" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f6b['field name6']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f6c = new EasyForm(\"form6c\")\n", "f6c.addList(\"field name6c\", [\"onef6c\", \"twof6c\", \"threef6c\", \"threef6c\"], 2)\n", "f6c" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f7 = new EasyForm(\"form7\")\n", "f7.addCheckBoxes(\"field name7\", [\"onef7\", \"twof7\", \"threef7\", \"fourf7\"])\n", "f7" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f7['field name7']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f7['field name7']= ['onef7']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f7b = new EasyForm(\"form7b\")\n", "f7b.addCheckBoxes(\"field name7\", [\"onef7b\", \"twof7b\", \"threef7b\"], EasyForm.HORIZONTAL)\n", "f7b" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f8 = new EasyForm(\"form8\")\n", "f8.addRadioButtons(\"field name8\", [\"onef8\", \"twof8\", \"threef8\"])\n", "f8" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f8['field name8']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f8['field name8'] = 'threef8'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f8b = new EasyForm(\"form8\")\n", "f8b.addRadioButtons(\"field name8\", [\"onef8b\", \"twof8b\", \"threef8b\"], EasyForm.HORIZONTAL)\n", "f8b" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f9 = new EasyForm(\"form9\")\n", "f9.addDatePicker(\"field name9\")\n", "f9" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f9['field name9']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f9['field name9'] = '20170527'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f10 = new EasyForm(\"form10\")\n", "f10.addButton(\"run tag\", \"tag1\")\n", "button11 = f10.addButton(\"actionPerformed\")\n", "button11.actionPerformed = { f11[\"field4\"] = \"from actionPerformed\"}\n", "f10" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f11['field2'] = \"test text\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "tag1" ] }, "outputs": [], "source": [ "f11 = new EasyForm(\"form11\")\n", "f11.addTextField(\"field1\").onInit({f11['field1'] = \"from onInit\"})\n", "f11.addTextField(\"field2\").onChange({text -> f11['field3'] = text + \" from onChange\"})\n", "f11.addTextField(\"field3\")\n", "f11.addTextField(\"field4\")\n", "f11" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import com.twosigma.beakerx.widget.IntSlider\n", "w = new IntSlider()\n", "w.value = 50\n", "\n", "f12 = new EasyForm('form12')\n", "f12.addWidget('slider12', w)\n", "f12" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "f12['slider12']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Tags", "kernelspec": { "display_name": "Groovy", "language": "groovy", "name": "groovy" }, "language_info": { "codemirror_mode": "groovy", "file_extension": ".groovy", "mimetype": "", "name": "Groovy", "nbconverter_exporter": "", "version": "2.4.3" } }, "nbformat": 4, "nbformat_minor": 1 }