##// END OF EJS Templates
Make widget keys have more explicit inheritance
Jason Grout -
Show More
@@ -24,7 +24,7 b' class BoolWidget(Widget):'
24 default_view_name = Unicode('CheckboxView')
24 default_view_name = Unicode('CheckboxView')
25
25
26 # Model Keys
26 # Model Keys
27 _keys = ['value', 'description', 'disabled']
27 keys = ['value', 'description', 'disabled'] + Widget.keys
28 value = Bool(False, help="Bool value")
28 value = Bool(False, help="Bool value")
29 description = Unicode('', help="Description of the boolean (label).")
29 description = Unicode('', help="Description of the boolean (label).")
30 disabled = Bool(False, help="Enable or disable user changes.")
30 disabled = Bool(False, help="Enable or disable user changes.")
@@ -28,7 +28,7 b' class ButtonWidget(Widget):'
28 default_view_name = Unicode('ButtonView')
28 default_view_name = Unicode('ButtonView')
29
29
30 # Keys
30 # Keys
31 _keys = ['description', 'disabled']
31 keys = ['description', 'disabled'] + Widget.keys
32 description = Unicode('', help="Description of the button (label).")
32 description = Unicode('', help="Description of the button (label).")
33 disabled = Bool(False, help="Enable or disable user changes.")
33 disabled = Bool(False, help="Enable or disable user changes.")
34
34
@@ -25,10 +25,10 b' class ContainerWidget(Widget):'
25
25
26 # Keys, all private and managed by helper methods. Flexible box model
26 # Keys, all private and managed by helper methods. Flexible box model
27 # classes...
27 # classes...
28 _keys = ['_vbox', '_hbox', '_align_start', '_align_end', '_align_center',
28 keys = ['_vbox', '_hbox', '_align_start', '_align_end', '_align_center',
29 '_pack_start', '_pack_end', '_pack_center', '_flex0', '_flex1',
29 '_pack_start', '_pack_end', '_pack_center', '_flex0', '_flex1',
30 '_flex2', 'description', 'button_text',
30 '_flex2', 'description', 'button_text',
31 'children']
31 'children'] + Widget.keys
32 children = List(Instance(Widget))
32 children = List(Instance(Widget))
33
33
34 description = Unicode()
34 description = Unicode()
@@ -24,7 +24,7 b' class FloatWidget(Widget):'
24 default_view_name = Unicode('FloatTextView')
24 default_view_name = Unicode('FloatTextView')
25
25
26 # Keys
26 # Keys
27 _keys = ['value', 'disabled', 'description']
27 keys = ['value', 'disabled', 'description'] + Widget.keys
28 value = Float(0.0, help="Float value")
28 value = Float(0.0, help="Float value")
29 disabled = Bool(False, help="Enable or disable user changes")
29 disabled = Bool(False, help="Enable or disable user changes")
30 description = Unicode(help="Description of the value this widget represents")
30 description = Unicode(help="Description of the value this widget represents")
@@ -24,7 +24,7 b' class FloatRangeWidget(Widget):'
24 default_view_name = Unicode('FloatSliderView')
24 default_view_name = Unicode('FloatSliderView')
25
25
26 # Keys
26 # Keys
27 _keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation', 'description']
27 keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation', 'description'] + Widget.keys
28 value = Float(0.0, help="Flaot value")
28 value = Float(0.0, help="Flaot value")
29 max = Float(100.0, help="Max value")
29 max = Float(100.0, help="Max value")
30 min = Float(0.0, help="Min value")
30 min = Float(0.0, help="Min value")
@@ -27,7 +27,7 b' class ImageWidget(Widget):'
27 default_view_name = Unicode('ImageView')
27 default_view_name = Unicode('ImageView')
28
28
29 # Define the custom state properties to sync with the front-end
29 # Define the custom state properties to sync with the front-end
30 _keys = ['image_format', 'width', 'height', '_b64value']
30 keys = ['image_format', 'width', 'height', '_b64value'] + Widget.keys
31 image_format = Unicode('png')
31 image_format = Unicode('png')
32 width = Unicode()
32 width = Unicode()
33 height = Unicode()
33 height = Unicode()
@@ -24,7 +24,7 b' class IntWidget(Widget):'
24 default_view_name = Unicode('IntTextView')
24 default_view_name = Unicode('IntTextView')
25
25
26 # Keys
26 # Keys
27 _keys = ['value', 'disabled', 'description']
27 keys = ['value', 'disabled', 'description'] + Widget.keys
28 value = Int(0, help="Int value")
28 value = Int(0, help="Int value")
29 disabled = Bool(False, help="Enable or disable user changes")
29 disabled = Bool(False, help="Enable or disable user changes")
30 description = Unicode(help="Description of the value this widget represents")
30 description = Unicode(help="Description of the value this widget represents")
@@ -24,7 +24,7 b' class IntRangeWidget(Widget):'
24 default_view_name = Unicode('IntSliderView')
24 default_view_name = Unicode('IntSliderView')
25
25
26 # Keys
26 # Keys
27 _keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation', 'description']
27 keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation', 'description'] + Widget.keys
28 value = Int(0, help="Int value")
28 value = Int(0, help="Int value")
29 max = Int(100, help="Max value")
29 max = Int(100, help="Max value")
30 min = Int(0, help="Min value")
30 min = Int(0, help="Min value")
@@ -25,7 +25,7 b' class MulticontainerWidget(Widget):'
25 default_view_name = Unicode('TabView')
25 default_view_name = Unicode('TabView')
26
26
27 # Keys
27 # Keys
28 _keys = ['_titles', 'selected_index', 'children']
28 keys = ['_titles', 'selected_index', 'children'] + Widget.keys
29 _titles = Dict(help="Titles of the pages")
29 _titles = Dict(help="Titles of the pages")
30 selected_index = Int(0)
30 selected_index = Int(0)
31
31
@@ -24,7 +24,7 b' class SelectionWidget(Widget):'
24 default_view_name = Unicode('DropdownView')
24 default_view_name = Unicode('DropdownView')
25
25
26 # Keys
26 # Keys
27 _keys = ['value', 'values', 'disabled', 'description']
27 keys = ['value', 'values', 'disabled', 'description'] + Widget.keys
28 value = Unicode(help="Selected value")
28 value = Unicode(help="Selected value")
29 values = List(help="List of values the user can select")
29 values = List(help="List of values the user can select")
30 disabled = Bool(False, help="Enable or disable user changes")
30 disabled = Bool(False, help="Enable or disable user changes")
@@ -27,7 +27,7 b' class StringWidget(Widget):'
27 default_view_name = Unicode('TextBoxView')
27 default_view_name = Unicode('TextBoxView')
28
28
29 # Keys
29 # Keys
30 _keys = ['value', 'disabled', 'description']
30 keys = ['value', 'disabled', 'description'] + Widget.keys
31 value = Unicode(help="String value")
31 value = Unicode(help="String value")
32 disabled = Bool(False, help="Enable or disable user changes")
32 disabled = Bool(False, help="Enable or disable user changes")
33 description = Unicode(help="Description of the value this widget represents")
33 description = Unicode(help="Description of the value this widget represents")
General Comments 0
You need to be logged in to leave comments. Login now