trait WidgetsUtils extends Serializable with WithHelpMethods
WidgetsUtils provides utilities for working with notebook widgets. You can create different types of widgets and get their bound value.
- Alphabetic
- By Inheritance
- WidgetsUtils
- WithHelpMethods
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def combobox(argName: String, defaultValue: String, choices: Seq[String], label: String = null): Unit
Creates a combobox input widget with a given name, default value and choices.
Creates a combobox input widget with a given name, default value and choices. Optionally, you can provide a label for the combobox widget that will be rendered in place of the name. If a widget with a given name already exists, its properties will be overwritten. The default value does not have to be one choices.
Example: dbutils.widgets.combobox("product", "Other", Seq("Camera", "GPS", "Smartphone"))
- argName
unique name identifying the widget
- defaultValue
value value which widget is populated by default
- choices
possible choices for the dropdown menu
- label
optional widget label
- abstract def dropdown(argName: String, defaultValue: String, choices: Seq[String], label: String = null): Unit
Creates a dropdown input widget a with given name, default value and choices.
Creates a dropdown input widget a with given name, default value and choices. Optionally, you can provide a label for the dropdown widget that will be rendered in place of the name. If a widget with a given name already exists, its properties will be overwritten. The default value must be one of choices.
Example: dbutils.widgets.dropdown("product", "Camera", Seq("Camera", "GPS", "Smartphone"))
- argName
unique name identifying the widget
- defaultValue
value value which widget is populated by default. Must be one of choices
- choices
possible choices for the dropdown menu
- label
optional widget label
- abstract def get(argName: String): String
Retrieves current value of an input widget.
Retrieves current value of an input widget. The widget is identified by its unique name. If a widget with given name does not exist an error is generated.
Example: dbutils.widgets.get("product")
- argName
unique name identifying the widget
- abstract def help(moduleOrMethod: String): Unit
- Definition Classes
- WithHelpMethods
- abstract def help(): Unit
- Definition Classes
- WithHelpMethods
- abstract def multiselect(argName: String, defaultValue: String, choices: Seq[String], label: String = null): Unit
Creates a multiselect input widget with a given name, default value and choices.
Creates a multiselect input widget with a given name, default value and choices. Optionally, you can provide a label for the dropdown widget that will be rendered in place of the name. If a widget with a given name already exists, its properties will be overwritten. The default value must be one of choices. When using dbutils.widgets.get() with a multiselect widget, you get a string of comma delimited items that are selected by user.
Example: dbutils.widgets.multiselect("product", "Camera", Seq("Camera", "GPS", "Smartphone"))
- argName
unique name identifying the widget
- defaultValue
value value which widget is populated by default. Must be one of choices
- choices
possible choices for the dropdown menu
- label
optional widget label
- abstract def remove(argName: String): Unit
Removes an input widget from the notebook.
Removes an input widget from the notebook. The widget is identified by its unique name.
Example: dbutils.widgets.remove("product")
- argName
unique name of the widget to be removed
- abstract def removeAll(): Unit
Removes all widgets in the notebook.
Removes all widgets in the notebook.
Example: dbutils.widgets.removeAll()
- abstract def text(argName: String, defaultValue: String, label: String = null): Unit
Creates a text input widget with a given name and default value.
Creates a text input widget with a given name and default value. Optionally, you can provide a label for the text widget that will be rendered in place of the name. If widget with a given name already exists, its properties will be overwritten.
Example: dbutils.widgets.text("product", "Camera", label = "Product Name")
- argName
unique name identifying the widget
- defaultValue
value with which widget is populated by default
- label
optional widget label
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def apply(): WidgetsUtils.this.type
- Definition Classes
- WithHelpMethods
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()