##// END OF EJS Templates
s/default_view_name/view_name
Jonathan Frederic -
Show More
@@ -36,7 +36,7 b' class Widget(LoggingConfigurable):'
36 36 # Shared declarations (Class level)
37 37 widget_construction_callback = None
38 38
39 keys = ['default_view_name']
39 keys = ['view_name']
40 40
41 41 def on_widget_constructed(callback):
42 42 """Class method, registers a callback to be called when a widget is
@@ -54,7 +54,7 b' class Widget(LoggingConfigurable):'
54 54 # Public declarations (Instance level)
55 55 target_name = Unicode('widget', help="""Name of the backbone model
56 56 registered in the frontend to create and sync this widget with.""")
57 default_view_name = Unicode(help="""Default view registered in the frontend
57 view_name = Unicode(help="""Default view registered in the frontend
58 58 to use to represent the widget.""")
59 59
60 60 # Private/protected declarations
@@ -276,8 +276,8 b' class Widget(LoggingConfigurable):'
276 276 Parameters
277 277 ----------
278 278 view_name: unicode (optional)
279 View to display in the frontend. Overrides default_view_name."""
280 view_name = kwargs.get('view_name', self.default_view_name)
279 View to display in the frontend. Overrides view_name."""
280 view_name = kwargs.get('view_name', self.view_name)
281 281
282 282 # Create a communication.
283 283 self._open_communication()
@@ -21,7 +21,7 b' from IPython.utils.traitlets import Unicode, Bool, List'
21 21 #-----------------------------------------------------------------------------
22 22 class BoolWidget(DOMWidget):
23 23 target_name = Unicode('BoolWidgetModel')
24 default_view_name = Unicode('CheckboxView')
24 view_name = Unicode('CheckboxView')
25 25
26 26 # Model Keys
27 27 keys = ['value', 'description', 'disabled'] + DOMWidget.keys
@@ -25,7 +25,7 b' from IPython.utils.traitlets import Unicode, Bool, Int'
25 25 #-----------------------------------------------------------------------------
26 26 class ButtonWidget(DOMWidget):
27 27 target_name = Unicode('ButtonWidgetModel')
28 default_view_name = Unicode('ButtonView')
28 view_name = Unicode('ButtonView')
29 29
30 30 # Keys
31 31 keys = ['description', 'disabled'] + DOMWidget.keys
@@ -21,7 +21,7 b' from IPython.utils.traitlets import Unicode, Bool, List, Instance'
21 21 #-----------------------------------------------------------------------------
22 22 class ContainerWidget(DOMWidget):
23 23 target_name = Unicode('ContainerWidgetModel')
24 default_view_name = Unicode('ContainerView')
24 view_name = Unicode('ContainerView')
25 25
26 26 # Keys, all private and managed by helper methods. Flexible box model
27 27 # classes...
@@ -21,7 +21,7 b' from IPython.utils.traitlets import Unicode, Float, Bool, List'
21 21 #-----------------------------------------------------------------------------
22 22 class FloatWidget(DOMWidget):
23 23 target_name = Unicode('FloatWidgetModel')
24 default_view_name = Unicode('FloatTextView')
24 view_name = Unicode('FloatTextView')
25 25
26 26 # Keys
27 27 keys = ['value', 'disabled', 'description'] + DOMWidget.keys
@@ -21,7 +21,7 b' from IPython.utils.traitlets import Unicode, Float, Bool, List'
21 21 #-----------------------------------------------------------------------------
22 22 class FloatRangeWidget(DOMWidget):
23 23 target_name = Unicode('FloatRangeWidgetModel')
24 default_view_name = Unicode('FloatSliderView')
24 view_name = Unicode('FloatSliderView')
25 25
26 26 # Keys
27 27 keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation', 'description'] + DOMWidget.keys
@@ -24,7 +24,7 b' from IPython.utils.traitlets import Unicode, Bytes'
24 24 #-----------------------------------------------------------------------------
25 25 class ImageWidget(DOMWidget):
26 26 target_name = Unicode('ImageWidgetModel')
27 default_view_name = Unicode('ImageView')
27 view_name = Unicode('ImageView')
28 28
29 29 # Define the custom state properties to sync with the front-end
30 30 keys = ['image_format', 'width', 'height', '_b64value'] + DOMWidget.keys
@@ -21,7 +21,7 b' from IPython.utils.traitlets import Unicode, Int, Bool, List'
21 21 #-----------------------------------------------------------------------------
22 22 class IntWidget(DOMWidget):
23 23 target_name = Unicode('IntWidgetModel')
24 default_view_name = Unicode('IntTextView')
24 view_name = Unicode('IntTextView')
25 25
26 26 # Keys
27 27 keys = ['value', 'disabled', 'description'] + DOMWidget.keys
@@ -21,7 +21,7 b' from IPython.utils.traitlets import Unicode, Int, Bool, List'
21 21 #-----------------------------------------------------------------------------
22 22 class IntRangeWidget(DOMWidget):
23 23 target_name = Unicode('IntRangeWidgetModel')
24 default_view_name = Unicode('IntSliderView')
24 view_name = Unicode('IntSliderView')
25 25
26 26 # Keys
27 27 keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation', 'description'] + DOMWidget.keys
@@ -22,7 +22,7 b' from IPython.utils.traitlets import Unicode, Dict, Int, List, Instance'
22 22 #-----------------------------------------------------------------------------
23 23 class MulticontainerWidget(DOMWidget):
24 24 target_name = Unicode('MulticontainerWidgetModel')
25 default_view_name = Unicode('TabView')
25 view_name = Unicode('TabView')
26 26
27 27 # Keys
28 28 keys = ['_titles', 'selected_index', 'children'] + DOMWidget.keys
@@ -21,7 +21,7 b' from IPython.utils.traitlets import Unicode, List, Bool'
21 21 #-----------------------------------------------------------------------------
22 22 class SelectionWidget(DOMWidget):
23 23 target_name = Unicode('SelectionWidgetModel')
24 default_view_name = Unicode('DropdownView')
24 view_name = Unicode('DropdownView')
25 25
26 26 # Keys
27 27 keys = ['value', 'values', 'disabled', 'description'] + DOMWidget.keys
@@ -24,7 +24,7 b' from IPython.utils.traitlets import Unicode, Bool, List, Int'
24 24 #-----------------------------------------------------------------------------
25 25 class StringWidget(DOMWidget):
26 26 target_name = Unicode('StringWidgetModel')
27 default_view_name = Unicode('TextBoxView')
27 view_name = Unicode('TextBoxView')
28 28
29 29 # Keys
30 30 keys = ['value', 'disabled', 'description'] + DOMWidget.keys
General Comments 0
You need to be logged in to leave comments. Login now