A widget have to be added to the editor, it is configured here in order to be conformant 
            to the editor
761604
def configure_widget_for_editing(self, widget):
        
        
        if not 'editor_varname' in widget.attributes:
            return
        widget.onclick.do(self.on_widget_selection)
        
        #setup of the on_dropped function of the widget in order to manage the dragNdrop 
        widget.__class__.on_dropped = on_dropped

        #drag properties
        #widget.style['resize'] = 'both'
        widget.style['overflow'] = 'auto'
        widget.attributes['draggable'] = 'true'
                
        widget.attributes['tabindex']=str(self.tabindex)
        #if not 'position' in widget.style.keys():
        #    widget.style['position'] = 'absolute'
        #if not 'left' in widget.style.keys():
        #    widget.style['left'] = '1px'
        #if not 'top' in widget.style.keys():
        #    widget.style['top'] = '1px'
        self.tabindex += 1
1170091
function (cfg, context, lineNumber) {
        this.$BaseWidget.constructor.apply(this, arguments);

        /**
         * Whether the widget configuration is valid
         * @type Boolean
         * @protected
         */
        this._cfgOk = ariaCoreJsonValidator.validateCfg("aria.touch.widgets.SliderCfgBeans.DoubleSliderCfg", cfg);

        if (!this._cfgOk) {
            return;
        }

        /**
         * Computed width of the first thumb. The actual value is compute on initialization.
         * @type Number
         * @protected
         */
        this._firstWidth = 0;

        /**
         * Computed width of the second thumb. The actual value is compute on initialization. Being aligned differently
         * it should account for the borders.
         * @type Number
         * @protected
         */
        this._secondWidth = 0;

        /**
         * Width of the rail between the two thumbs.
         * @type Number
         * @protected
         */
        this._railWidth = 0;

        /**
         * Value of the widget (must be an array of values between 0 and 1)
         * @type Array
         * @protected
         */
        this.value = [0, 0];

        /**
         * Value before the start of a move, this is kept to raised the change event only if after a move the new value
         * changes
         * @type Array
         * @protected
         */
        this._oldValue = [0, 0];
        this._readValue();

        /**
         * Dom Reference for the first thumb of the slider
         * @type HTMLElement
         * @protected
         */
        this._firstSlider = null;

        /**
         * Dom Reference for the second thumb of the slider
         * @type HTMLElement
         * @protected
         */
        this._secondSlider = null;

        /**
         * Reference to the button DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._domElt = null;

        /**
         * Dom Reference for the region between the two thumbs
         * @type HTMLElement
         * @protected
         */
        this._highlight = null;

        /**
         * Initial position of the element being dragged
         * @type Number
         * @protected
         */
        this._initialDrag = 0;

        var binding = this._cfg.bind ? this._cfg.bind.value : null;
        /**
         * Description of the bind value
         * @type Object
         * @protected
         */
        this._binding = binding;
        if (binding) {
            /**
             * Callback for the data change
             * @protected
             * @type aria.core.CfgBeans:Callback
             */
            this._bindingCallback = {
                fn : this._notifyDataChange,
                scope : this
            };
            ariaUtilsJson.addListener(binding.inside, binding.to, this._bindingCallback, false);
        }

        /**
         * Value of the first thumb page/clientX property of the touch/mouse event when the user started moving the
         * slider. It is then updated so that it is always the position of the touch/mouse for which there is no change
         * of the position of the slider.
         * @type Number
         * @protected
         */
        this._savedX1 = 0;

        /**
         * Value of the second thumb page/clientX property of the touch/mouse event when the user started moving the
         * slider. It is then updated so that it is always the position of the touch/mouse for which there is no change
         * of the position of the slider.
         * @type Number
         * @protected
         */
        this._savedX2 = 0;

        /**
         * Id generated for the DOM element of the slider.
         * @type String
         * @protected
         */
        this._domId = cfg.id ? context.$getId(cfg.id) : this._createDynamicId();

        /**
         * Id generated for the first thumb DOM element of the slider.
         * @type String
         * @protected
         */
        this._firstDomId = this._domId + "_first";

        /**
         * Id generated for the second thumb DOM element of the slider.
         * @type String
         * @protected
         */
        this._secondDomId = this._domId + "_second";

        /**
         * List of Drag instances associated to the two thumbs
         * @type Array of aria.utils.dragdrop.Drag
         */
        this._draggable = [];

    }
1117142
def create_widget(self):
        
        d = self.declaration
        self.widget = CoordinatorLayout(self.get_context(), None, d.style)
1282579
def set_editor(self, editor):
        
        try:
            self._editor.cursorPositionChanged.disconnect(self.sync)
        except (AttributeError, TypeError, RuntimeError, ReferenceError):
            pass
        try:
            self._outline_mode.document_changed.disconnect(
                self._on_changed)
        except (AttributeError, TypeError, RuntimeError, ReferenceError):
            pass
        try:
            self._folding_panel.trigger_state_changed.disconnect(
                self._on_block_state_changed)
        except (AttributeError, TypeError, RuntimeError, ReferenceError):
            pass
        if editor:
            self._editor = weakref.proxy(editor)
        else:
            self._editor = None

        if editor is not None:
            editor.cursorPositionChanged.connect(self.sync)
            try:
                self._folding_panel = weakref.proxy(
                    editor.panels.get(FoldingPanel))
            except KeyError:
                pass
            else:
                self._folding_panel.trigger_state_changed.connect(
                    self._on_block_state_changed)
            try:
                analyser = editor.modes.get(OutlineMode)
            except KeyError:
                self._outline_mode = None
            else:
                self._outline_mode = weakref.proxy(analyser)
                analyser.document_changed.connect(self._on_changed)
        self._on_changed()
447158
def updateEditorGeometry(self, editor, option, index):
        
        cti = index.model().getItem(index)
        if cti.checkState is None:
            displayRect = option.rect
        else:
            checkBoxRect = widgetSubCheckBoxRect(editor, option)
            offset = checkBoxRect.x() + checkBoxRect.width()
            displayRect = option.rect
            displayRect.adjust(offset, 0, 0, 0)

        editor.setGeometry(displayRect)
428718
protected function ckEditor()
	{
		if (isset($this->htmlOptions['options'])) {
			$options = $this->htmlOptions['options'];
			unset($this->htmlOptions['options']);
		}

		echo $this->getLabel();
		echo '<div class="controls">';
		$this->widget(
			'booster.widgets.TbCKEditor',
			array(
				'model' => $this->model,
				'attribute' => $this->attribute,
				'editorOptions' => isset($options) ? $options : array(),
				'htmlOptions' => $this->htmlOptions
			)
		);
		echo $this->getError() . $this->getHint();
		echo '</div>';
	}
676733
def __initialize_ui(self):
        

        self.__margin_area_LinesNumbers_widget = LinesNumbers_QWidget(self)

        self.__set_extra_selections()

        self.__set_language_description()

        # Signals / Slots.
        self.blockCountChanged.connect(self.__margin_area_LinesNumbers_widget.set_editor_viewport_margins)
        self.updateRequest.connect(self.__margin_area_LinesNumbers_widget.update_rectangle)
        self.cursorPositionChanged.connect(self.__set_extra_selections)
54972
function(view, config, widget) {

		this._view = view;
		//this._config = config;
		this._widget = widget;

		if (('options' in config)) {

			if ('appender' in config.options) {
				if (Lava.schema.DEBUG && !this['_append' + config.options.appender]) Lava.t('[Emulated container] wrong appender: ' + config.options.appender);
				this.appendHTML = this['_append' + config.options.appender]
			}

			if ('prepender' in config.options) {
				if (Lava.schema.DEBUG && !this['_append' + config.options.prepender]) Lava.t('[Emulated container] wrong prepender: ' + config.options.prepender);
				this.prependHTML = this['_append' + config.options.prepender]
			}

		}

	}
1215101
@UiChild(limit = 1, tagname = "widget")
  public void setChildWidget(final TakesValue<T> pwidget) {
    widget = (Widget) pwidget;
    contents.add(widget);
    setEditor(new ExtendedValueBoxEditor<>(pwidget, this));
  }
423012
def create_ui(self):
        
        self.entry = gtk.Entry()
        self.widget.add(self.entry)
191685
def add(self, widget, condition=lambda: 42):
        

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

        return widget
1246631
def create_widget(self):
        
        d = self.declaration
        self.widget = GridLayout(self.get_context(), None, d.style)
141341
def add_widget_to_content(self, widget):
        """"""
        self.__section_content_column.add_spacing(4)
        self.__section_content_column.add(widget)
1365882
private NativeEditWidget createNativeWidget(String configuration) {

        I_CmsFormEditWidget widget = createFormWidget(configuration);
        return NativeEditWidget.wrapWidget(widget, true);
    }
1115714
function (cfg, context, lineNumber) {
        this.$BindableWidget.constructor.apply(this, arguments);

        this._cfgOk = ariaCoreJsonValidator.validateCfg(this.WIDGET_CFG, cfg);

        if (!this._cfgOk) {
            return;
        }

        this._registerBindings();

        /**
         * Id generated for the button DOM element of the slider.
         * @type String
         * @protected
         */
        this._domId = cfg.id ? context.$getId(cfg.id) : this._createDynamicId();

    }
376651
function(view, config, widget) {

		this._view = view;
		//this._config = config;
		this._widget = widget;

		this._start_script_id = 'c' + view.guid + 's';
		this._end_script_id = 'c' + view.guid + 'e';

	}
250618
def addWidget(self, widget):
        
        CheckParent(self)
        doc = self.parent
        if not doc.isPDF:
            raise ValueError("not a PDF")
        widget._validate()

    # Check if PDF already has our fonts.
    # If none insert all of them in a new object and store the xref.
    # Else only add any missing fonts.
    # To determine the situation, /DR object is checked.
        xref = 0
        ff = doc.FormFonts               # /DR object: existing fonts
        if not widget.text_font:         # ensure default
            widget.text_font = "Helv"
        if not widget.text_font in ff:   # if no existent font ...
            if not doc.isFormPDF or not ff:   # a fresh /AcroForm PDF!
                xref = doc._getNewXref()      # insert all our fonts
                doc._updateObject(xref, Widget_fontobjects)
            else:                        # add any missing fonts
                for k in Widget_fontdict.keys():
                    if not k in ff:      # add our font if missing
                        doc._addFormFont(k, Widget_fontdict[k])
            widget._adjust_font()        # ensure correct font spelling
        widget._dr_xref = xref           # non-zero causes /DR creation

    # now create the /DA string
        if   len(widget.text_color) == 3:
            fmt = "{:g} {:g} {:g} rg /{f:s} {s:g} Tf " + widget._text_da
        elif len(widget.text_color) == 1:
            fmt = "{:g} g /{f:s} {s:g} Tf " + widget._text_da
        elif len(widget.text_color) == 4:
            fmt = "{:g} {:g} {:g} {:g} k /{f:s} {s:g} Tf " + widget._text_da
        widget._text_da = fmt.format(*widget.text_color, f=widget.text_font,
                                     s=widget.text_fontsize)
    # create the widget at last
        annot = self._addWidget(widget)
        if annot:
            annot.thisown = True
            annot.parent = weakref.proxy(self) # owning page object
            self._annot_refs[id(annot)] = annot
        return annot