returns widget class by id

    example web-htmltextwidget-2-2
193141
def get_widget_class_from_id(id):
    

    res = id.split('-')
    try:
        model_cls = apps.get_model(res[1], res[2])
    except:
        model_cls = None
    return model_cls
426163
def get_widget_css_class(self, field_name, field):
        
        # If we render CheckboxInputs, Bootstrap requires a different
        # widget css class for checkboxes.
        if isinstance(field.widget, forms.CheckboxInput):
            return 'form-check-input'

        # Idem for fileinput.
        if isinstance(field.widget, forms.FileInput):
            return 'form-control-file'

        return super().get_widget_css_class(field_name, field)
1140660
@Override
	public String getText() throws WidgetException {
		try {
			WebElement webElement = findElement();
			highlight(HIGHLIGHT_MODES.GET);
			return webElement.getText();
		} catch (Exception e) {
			throw new WidgetException("Error while fetching text", locator, e);
		}
	}
458681
def get_input_widget(self, fieldname, arnum=0, **kw):
        

        # temporary AR Context
        context = self.get_ar()
        # request = self.request
        schema = context.Schema()

        # get original field in the schema from the base_fieldname
        base_fieldname = fieldname.split("-")[0]
        field = context.getField(base_fieldname)

        # fieldname with -<arnum> suffix
        new_fieldname = self.get_fieldname(field, arnum)
        new_field = field.copy(name=new_fieldname)

        # get the default value for this field
        fieldvalues = self.fieldvalues
        field_value = fieldvalues.get(new_fieldname)
        # request_value = request.form.get(new_fieldname)
        # value = request_value or field_value
        value = field_value

        def getAccessor(instance):
            def accessor(**kw):
                return value
            return accessor

        # inject the new context for the widget renderer
        # see: Products.Archetypes.Renderer.render
        kw["here"] = context
        kw["context"] = context
        kw["fieldName"] = new_fieldname

        # make the field available with this name
        # XXX: This is a hack to make the widget available in the template
        schema._fields[new_fieldname] = new_field
        new_field.getAccessor = getAccessor

        # set the default value
        form = dict()
        form[new_fieldname] = value
        self.request.form.update(form)
        logger.info("get_input_widget: fieldname={} arnum={} "
                    "-> new_fieldname={} value={}".format(
                        fieldname, arnum, new_fieldname, value))
        widget = context.widget(new_fieldname, **kw)
        return widget
342515
@Override
    public Widget getWidget(int index) {
        if (index == PAGE_LIMIT - 1) {
            if (offPageContainer.isEmpty()) {
                return offPageContainer.asWidget();
            }
            int deckIndex = offPageContainer.getSelectedDeck() == -1 ? 0 : offPageContainer.getSelectedDeck();
            return offPageContainer.getDeck(deckIndex);
        }
        return super.getWidget(index);
    }
979650
function(widget, name) {

		if (Lava.schema.DEBUG && !name) Lava.t();

		while (widget && widget.name != name) {

			widget = widget.getParentWidget();

		}

		return widget;

	}
1077572
function layoutWidgetAdapterFor( areaHelper, widget ) {
         return layoutLoader.load( widget.layout )
            .then( ({ className, html }) => {
               const adapter = createLayoutWidgetAdapter( areaHelper, className, {
                  area: widget.area,
                  id: widget.id,
                  path: widget.layout
               } );

               return {
                  id: widget.id,
                  adapter,
                  destroy: adapter.destroy,
                  templatePromise: Promise.resolve( html )
               };
            } );
      }
1277334
private String getWidgetName(String settingsWidget) {

        if (WIDGET_MAPPINGS.containsKey(settingsWidget)) {
            return WIDGET_MAPPINGS.get(settingsWidget).getName();
        } else {
            return CmsInputWidget.class.getName();
        }
    }
1273617
private function getModelFromWidget(Widget $widget)
    {
        if ($widget->dataContainer) {
            return $widget->dataContainer->getModel();
        }

        return $widget->getModel();
    }
715553
private Class<? extends WComponent> getRowRendererClass() {
		UIContext uic = UIContextHolder.getCurrent();

		if (table.getDataModel() instanceof TreeTableDataModel && uic instanceof SubUIContext) {
			int row = getRowIndex((SubUIContext) uic);
			TreeTableDataModel dataModel = (TreeTableDataModel) table.getDataModel();

			TableTreeNode node = dataModel.getNodeAtLine(row);
			return node.getRendererClass();
		}

		return null;
	}
1337839
def as_widget(self, widget=None, attrs=None, only_initial=False):
        
        attrs = attrs or {}
        attrs.update(self.form.get_widget_attrs(self))
        if hasattr(self.field, 'widget_css_classes'):
            css_classes = self.field.widget_css_classes
        else:
            css_classes = getattr(self.form, 'widget_css_classes', None)
        if css_classes:
            attrs.update({'class': css_classes})
        widget_classes = self.form.fields[self.name].widget.attrs.get('class', None)
        if widget_classes:
            if attrs.get('class', None):
                attrs['class'] += ' ' + widget_classes
            else:
                attrs.update({'class': widget_classes})
        return super(NgBoundField, self).as_widget(widget, attrs, only_initial)
655197
def _widget_from_p(self, pname, ptype):
        """"""

        widget_name = self.type2widget[ptype].__name__.lower()
        widget_name = "_".join([widget_name, pname])
        return getattr(self, widget_name)
604960
def widget_from_single_value(o):
        """"""
        if isinstance(o, string_types):
            return Text(value=unicode_type(o))
        elif isinstance(o, bool):
            return Checkbox(value=o)
        elif isinstance(o, Integral):
            min, max, value = _get_min_max_value(None, None, o)
            return IntSlider(value=o, min=min, max=max)
        elif isinstance(o, Real):
            min, max, value = _get_min_max_value(None, None, o)
            return FloatSlider(value=o, min=min, max=max)
        else:
            return None
425799
public static function get_widget_instance( $widget_id ) {
		global $wp_registered_widgets;

		if ( ! isset( $wp_registered_widgets[ $widget_id ] ) ) {
			return false;
		}

		$model = $wp_registered_widgets[ $widget_id ]['callback'][0];

		if ( ! is_a( $model, 'Lean\Widgets\Models\AbstractWidget' ) ) {
			return false;
		}

		$key = $wp_registered_widgets[ $widget_id ]['params'][0]['number'];

		$model->_set( $key );

		return $model;
	}
988514
public Content getAllClassesLinkScript(String id) {
        HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
        script.addAttr(HtmlAttr.TYPE, "text/javascript");
        String scriptCode = "<!--" + DocletConstants.NL +
                "  allClassesLink = document.getElementById(\"" + id + "\");" + DocletConstants.NL +
                "  if(window==top) {" + DocletConstants.NL +
                "    allClassesLink.style.display = \"block\";" + DocletConstants.NL +
                "  }" + DocletConstants.NL +
                "  else {" + DocletConstants.NL +
                "    allClassesLink.style.display = \"none\";" + DocletConstants.NL +
                "  }" + DocletConstants.NL +
                "  //-->" + DocletConstants.NL;
        Content scriptContent = new RawHtml(scriptCode);
        script.addContent(scriptContent);
        Content div = HtmlTree.DIV(script);
        return div;
    }
1053182
public function searchWidget()
    {
        $widget = $this->widgetFactory()->create(SearchWidget::class);
        $widget->setObjType($this->objType());

        $listIdent = $this->metadataListIdent();

        // Note that if the ident doesn't match a list,
        // it will return basicly every properties of the object
        $widget->setCollectionIdent($listIdent);

        return $widget;
    }
515615
function() {
                var me = this,
                    widgets = me._widgets = [];
    
                $.each( widgetClass, function( _, klass ) {
                    widgets.push( new klass( me ) );
                });
    
                return _init.apply( me, arguments );
            }