Create the underlying widget.
11847
def create_widget(self):
        
        d = self.declaration
        self.widget = WebView(self.get_context(), None, d.style)
568202
def add_widget(self, widget):
        
        if self._buttons.get(widget):
            return
        btn = self.create_button(widget)
        cb = partial(self.focus_widget, w=widget)
        btn.clicked.connect(cb)
        self.layout().addWidget(btn)
        self._buttons[widget] = btn
613947
def createWidgets(self):
        #create the panels for the tabs
        PanelAssembly = wx.Panel(self.nb)
        boxAssembly = wx.BoxSizer(wx.VERTICAL)
        PanelAssembly.SetAutoLayout(True)
        PanelAssembly.SetSizer(boxAssembly)
        PanelAssembly.Layout()

        PanelEngine = wx.Panel(self.nb)
        boxEngine = wx.BoxSizer(wx.VERTICAL)
        PanelEngine.SetAutoLayout(True)
        PanelEngine.SetSizer(boxEngine)
        PanelEngine.Layout()

        PanelTakeoff = wx.Panel(self.nb)
        boxTakeoff = wx.BoxSizer(wx.VERTICAL)
        PanelTakeoff.SetAutoLayout(True)
        PanelTakeoff.SetSizer(boxTakeoff)
        PanelTakeoff.Layout()

        PanelCruise = wx.Panel(self.nb)
        boxCruise = wx.BoxSizer(wx.VERTICAL)
        PanelCruise.SetAutoLayout(True)
        PanelCruise.SetSizer(boxCruise)
        PanelCruise.Layout()

        PanelDrop = wx.Panel(self.nb)
        boxDrop = wx.BoxSizer(wx.VERTICAL)
        PanelDrop.SetAutoLayout(True)
        PanelDrop.SetSizer(boxDrop)
        PanelDrop.Layout()

        PanelLanding = wx.Panel(self.nb)
        boxLanding = wx.BoxSizer(wx.VERTICAL)
        PanelLanding.SetAutoLayout(True)
        PanelLanding.SetSizer(boxLanding)
        PanelLanding.Layout()

        PanelShutdown = wx.Panel(self.nb)
        boxShutdown = wx.BoxSizer(wx.VERTICAL)
        PanelShutdown.SetAutoLayout(True)
        PanelShutdown.SetSizer(boxShutdown)
        PanelShutdown.Layout()

        #add the data to the individual tabs

        ''''''
        for key in self.beforeAssemblyList:
            if self.beforeAssemblyList[key] == 0:
                disCheckBox = wx.CheckBox(PanelAssembly, wx.ID_ANY, key)
                disCheckBox.Enable(False)
                boxAssembly.Add(disCheckBox)
            if self.beforeAssemblyList[key] == 2:
                boxAssembly.Add(wx.CheckBox(PanelAssembly, wx.ID_ANY, key))

        self.AssemblyButton = wx.Button(PanelAssembly, wx.ID_ANY, "Close final hatches")
        boxAssembly.Add(self.AssemblyButton)

        '''before Engine Start checklist'''
        for key in self.beforeEngineList:
            if self.beforeEngineList[key] == 0:
                disCheckBox = wx.CheckBox(PanelEngine, wx.ID_ANY, key)
                disCheckBox.Enable(False)
                boxEngine.Add(disCheckBox)
            if self.beforeEngineList[key] == 2:
                boxEngine.Add(wx.CheckBox(PanelEngine, wx.ID_ANY, key))

        self.EngineButton = wx.Button(PanelEngine, wx.ID_ANY, "Ready for Engine start")
        boxEngine.Add(self.EngineButton)

        '''before takeoff checklist'''
        for key in self.beforeTakeoffList:
            if self.beforeTakeoffList[key] == 0:
                disCheckBox = wx.CheckBox(PanelTakeoff, wx.ID_ANY, key)
                disCheckBox.Enable(False)
                boxTakeoff.Add(disCheckBox)
            if self.beforeTakeoffList[key] == 2:
                boxTakeoff.Add(wx.CheckBox(PanelTakeoff, wx.ID_ANY, key))

        self.TakeoffButton = wx.Button(PanelTakeoff, wx.ID_ANY, "Ready for Takeoff")
        boxTakeoff.Add(self.TakeoffButton)

        '''before cruise/AUTO checklist'''
        for key in self.beforeCruiseList:
            if self.beforeCruiseList[key] == 0:
                disCheckBox = wx.CheckBox(PanelCruise, wx.ID_ANY, key)
                disCheckBox.Enable(False)
                boxCruise.Add(disCheckBox)
            if self.beforeCruiseList[key] == 2:
                boxCruise.Add(wx.CheckBox(PanelCruise, wx.ID_ANY, key))

        self.CruiseButton = wx.Button(PanelCruise, wx.ID_ANY, "Ready for Cruise/AUTO")
        boxCruise.Add(self.CruiseButton)

        '''before bottle drop checklist'''
        for key in self.bottleDropList:
            if self.bottleDropList[key] == 0:
                disCheckBox = wx.CheckBox(PanelDrop, wx.ID_ANY, key)
                disCheckBox.Enable(False)
                boxDrop.Add(disCheckBox)
            if self.bottleDropList[key] == 2:
                boxDrop.Add(wx.CheckBox(PanelDrop, wx.ID_ANY, key))

        self.DropButton = wx.Button(PanelDrop, wx.ID_ANY, "Ready for Bottle Drop")
        boxDrop.Add(self.DropButton)

        '''before landing checklist'''
        for key in self.beforeLandingList:
            if self.beforeLandingList[key] == 0:
                disCheckBox = wx.CheckBox(PanelLanding, wx.ID_ANY, key)
                disCheckBox.Enable(False)
                boxLanding.Add(disCheckBox)
            if self.beforeLandingList[key] == 2:
                boxLanding.Add(wx.CheckBox(PanelLanding, wx.ID_ANY, key))

        self.LandingButton = wx.Button(PanelLanding, wx.ID_ANY, "Ready for Landing")
        boxLanding.Add(self.LandingButton)

        '''before shutdown checklist'''
        for key in self.beforeShutdownList:
            if self.beforeShutdownList[key] == 0:
                disCheckBox = wx.CheckBox(PanelShutdown, wx.ID_ANY, key)
                disCheckBox.Enable(False)
                boxShutdown.Add(disCheckBox)
            if self.beforeShutdownList[key] == 2:
                boxShutdown.Add(wx.CheckBox(PanelShutdown, wx.ID_ANY, key))

        self.ShutdownButton = wx.Button(PanelShutdown, wx.ID_ANY, "Ready for Shutdown")
        boxShutdown.Add(self.ShutdownButton)

        #and add in the tabs
        self.nb.AddPage(PanelAssembly, "1. During Assembly")
        self.nb.AddPage(PanelEngine, "2. Before Engine Start")
        self.nb.AddPage(PanelTakeoff, "3. Before Takeoff")
        self.nb.AddPage(PanelCruise, "4. Before Cruise/AUTO")
        self.nb.AddPage(PanelDrop, "5. Before Bottle Drop")
        self.nb.AddPage(PanelLanding, "6. Before Landing")
        self.nb.AddPage(PanelShutdown, "7. Before Shutdown")
1024922
def add(self, widget, *args, **kwargs):
        
        ins_widget = widget(*args, **kwargs)
        self.__iadd__(ins_widget)
        return ins_widget
194927
def _call_widget_constructed(widget):
        """"""
        if Widget._widget_construction_callback is not None and callable(Widget._widget_construction_callback):
            Widget._widget_construction_callback(widget)
1168125
def create_widget(self):
        
        self.widget = ViewPager(self.get_context())
        self.adapter = BridgedFragmentStatePagerAdapter()
1228981
def init_widget(self):
        
        super(AndroidProgressBar, self).init_widget()
        d = self.declaration
        self.set_indeterminate(self.indeterminate)

        if not self.indeterminate:
            if d.max:
                self.set_max(d.max)
            if d.min:
                self.set_min(d.min)

            self.set_progress(d.progress)

            if d.secondary_progress:
                self.set_secondary_progress(d.secondary_progress)
340478
def build_gui(self, container):
        
        vbox = Widgets.VBox()
        vbox.set_border_width(0)

        w = Viewers.GingaViewerWidget(viewer=self)
        vbox.add_widget(w, stretch=1)

        # need to put this in an hbox with an expanding label or the
        # browser wants to resize the canvas, distorting it
        hbox = Widgets.HBox()
        hbox.add_widget(vbox, stretch=0)
        hbox.add_widget(Widgets.Label(''), stretch=1)

        container.set_widget(hbox)
296234
def _create_widget_content(sender, instance, created=False, **kwargs):
    
    if not issubclass(sender, WidgetContentModel):
        return

    # create a WidgetContent Entry
    if created:
        instance.create_widget_content_entry()
        return
1205907
def _add_widget(self, widget):
        
        widgets = self.widgets()
        widgets += [widget]
        self._save_customization(widgets)
1053611
def init_widget(self):
        
        # Create and init the client
        c = self.client = BridgedWebViewClient()
        c.setWebView(self.widget, c.getId())
        c.onLoadResource.connect(self.on_load_resource)
        c.onPageFinished.connect(self.on_page_finished)
        c.onPageStarted.connect(self.on_page_started)
        c.onReceivedError.connect(self.on_received_error)
        c.onScaleChanged.connect(self.on_scale_changed)
        c.onProgressChanged.connect(self.on_progress_changed)
        c.onReceivedTitle.connect(self.on_page_title_changed)

        super(AndroidWebView, self).init_widget()
333818
def create_widget(self):
        
        d = self.declaration
        self.widget = DrawerLayout(self.get_context(),  None, d.style)
754578
def init_widget(self):
        
        super(AndroidCompoundButton, self).init_widget()
        w = self.widget
        w.setOnCheckedChangeListener(w.getId())
        w.onCheckedChanged.connect(self.on_checked)
297872
def init_widget(self):
        
        super(AndroidSwipeRefreshLayout, self).init_widget()
        d = self.declaration
        w = self.widget
        if not d.enabled:
            self.set_enabled(d.enabled)
        if d.indicator_background_color:
            self.set_indicator_background_color(d.indicator_background_color)
        if d.indicator_color:
            self.set_indicator_color(d.indicator_color)
        if d.trigger_distance:
            self.set_trigger_distance(d.trigger_distance)
        w.onRefresh.connect(self.on_refresh)
        w.setOnRefreshListener(w.getId())
1048421
def create(self):
        """"""
        add_button = QPushButton('New')
        add_button.clicked.connect(self.new_group)
        color_button = QPushButton('Color')
        color_button.clicked.connect(self.color_group)
        del_button = QPushButton('Delete')
        del_button.clicked.connect(self.del_group)
        apply_button = QPushButton('Apply')
        apply_button.clicked.connect(self.apply)

        self.button_add = add_button
        self.button_color = color_button
        self.button_del = del_button
        self.button_apply = apply_button

        buttons = QGridLayout()
        buttons.addWidget(add_button, 0, 0)
        buttons.addWidget(color_button, 1, 0)
        buttons.addWidget(del_button, 0, 1)
        buttons.addWidget(apply_button, 1, 1)

        self.tabs = QTabWidget()

        layout = QVBoxLayout()
        layout.addLayout(buttons)
        layout.addWidget(self.tabs)

        self.setLayout(layout)

        self.setEnabled(False)
        self.button_color.setEnabled(False)
        self.button_del.setEnabled(False)
        self.button_apply.setEnabled(False)
191685
def add(self, widget, condition=lambda: 42):
        

        assert callable(condition)
        assert isinstance(widget, BaseWidget)
        self._widgets.append((widget, condition))

        return widget
50978
Widget createWidget() {

        if (isTrue(m_jsonConfig, CmsDataViewConstants.CONFIG_PREVIEW)) {
            return new CmsDataViewPreviewWidget(
                m_config,
                m_valueAccessor,
                new CmsDataViewPreviewWidget.ContentImageLoader());
        } else {
            I_ImageProvider provider = null;
            CmsDataViewValue val = m_valueAccessor.getValue();
            JSONValue iconVal = m_jsonConfig.get(CmsDataViewConstants.CONFIG_ICON);
            if ((iconVal != null) && (iconVal.isString() != null)) {
                provider = new CmsDataViewPreviewWidget.SimpleImageLoader(iconVal.isString().stringValue());
            }
            return new CmsDataViewPreviewWidget(m_config, m_valueAccessor, provider);
        }

    }