Sets the editor widget for this entry system.
        
        :param      editor | <QWidget> || None
323689
def setEditor(self, editor):
        
        widget = self.uiEditorAREA.takeWidget()
        if widget:
            widget.close()
        
        if editor is not None:
            editor.setMinimumHeight(28)
            self.uiEditorAREA.setWidget(editor)
1275640
def removeSubEditor(self, subEditor):
        
        if subEditor is self.focusProxy():
            self.setFocusProxy(None)

        subEditor.removeEventFilter(self)
        self._subEditors.remove(subEditor)
        self.hBoxLayout.removeWidget(subEditor)
757196
def setEditorData(self, editor, index):
        
        data = unwrapVariant(index.data())
        editor.setCurrentIndex(editor.findText(data))
1201734
def createEditor(self, parent, option, index):
        """"""
        model = index.model()
        value = model.get_value(index)
        if model._data.dtype.name == "bool":
            value = not value
            model.setData(index, to_qvariant(value))
            return
        elif value is not np.ma.masked:
            editor = QLineEdit(parent)
            editor.setFont(get_font(font_size_delta=DEFAULT_SMALL_DELTA))
            editor.setAlignment(Qt.AlignCenter)
            if is_number(self.dtype):
                validator = QDoubleValidator(editor)
                validator.setLocale(QLocale('C'))
                editor.setValidator(validator)
            editor.returnPressed.connect(self.commitAndCloseEditor)
            return editor
546499
def createEditor(self, parent, column, op, value):
        
        try:
            cls = self._operatorMap[nativestring(op)].cls
        except KeyError, AttributeError:
            return None
        
        # create the new editor
        if cls:
            widget = cls(parent)
            widget.setAttribute(Qt.WA_DeleteOnClose)
            projexui.setWidgetValue(widget, value)
            return widget
        
        return None
697585
def setSectionCount(self, count):
        
        # cap the sections at 10
        count = max(1, min(count, 10))
        
        # create additional editors
        while self.layout().count() < count:
            editor = XLineEdit(self)
            editor.setFont(self.font())
            editor.setReadOnly(self.isReadOnly())
            editor.setHint(self.hint())
            editor.setAlignment(QtCore.Qt.AlignCenter)
            editor.installEventFilter(self)
            editor.setSizePolicy(QtGui.QSizePolicy.Expanding,
                                 QtGui.QSizePolicy.Expanding)
            editor.setMaxLength(self.sectionLength())
            editor.returnPressed.connect(self.returnPressed)
            self.layout().addWidget(editor)
        
        # remove unnecessary editors
        while count < self.layout().count():
            widget = self.layout().itemAt(0).widget()
            widget.close()
            widget.setParent(None)
            widget.deleteLater()
416542
def set_managing_editor(self):
        """"""
        try:
            self.managing_editor = self.soup.find('managingeditor').string
        except AttributeError:
            self.managing_editor = None
849574
@Override
  @UiChild(limit = 1, tagname = "widget")
  public void setChildWidget(final TakesValue<T> pwidget) {
    widget = (Widget) pwidget;
    contents.add(widget);
    setEditor(new ExtendedValueBoxEditor<>(pwidget, this));
    if (pwidget instanceof HasFocusHandlers) {
      ((HasFocusHandlers) pwidget).addFocusHandler(pevent -> addStyleToLabel());
    }
    if (pwidget instanceof HasBlurHandlers) {
      ((HasBlurHandlers) pwidget).addBlurHandler(pevent -> {
        boolean hide = true;
        if (widget instanceof TakesValue<?>) {
          hide = StringUtils.isEmpty(Objects.toString(((TakesValue<?>) widget).getValue(), null));
        }
        if (hide) {
          removeStyleFromLabel();
        }
      });
    }
  }
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)
186530
public void setEditWidget(I_CmsEditWidget editWidget) {

        // the edit widget may be set only once
        assert m_editWidget == null;
        m_editWidget = editWidget;
        m_mainPanel.add(m_editWidget);
        m_editWidget.asWidget().addStyleName(I_CmsLayoutBundle.INSTANCE.form().widget());
    }
483299
def createEditor(self, delegate, parent, option):
        
        return FloatCtiEditor(self, delegate, parent=parent)
61287
def set_editor_doc(self, doc, force_refresh=False):
        
        if (self.locked and not force_refresh):
            return
        self.switch_to_editor_source()
        self._last_editor_doc = doc
        self.object_edit.setText(doc['obj_text'])

        if self.rich_help:
            self.render_sphinx_doc(doc)
        else:
            self.set_plain_text(doc, is_code=False)

        if self.dockwidget is not None:
            self.dockwidget.blockSignals(True)
        self.__eventually_raise_help(doc['docstring'], force=force_refresh)
        if self.dockwidget is not None:
            self.dockwidget.blockSignals(False)
1140564
def initialize_ui(self):
        

        LOGGER.debug("> Initializing '{0}' Component ui.".format(self.__class__.__name__))
        self.__model = ProjectsProxyModel(self)
        self.__model.setSourceModel(self.__script_editor.model)
        self.__delegate = RichText_QStyledItemDelegate(self, self.__style)

        self.Projects_Explorer_treeView.setParent(None)
        self.Projects_Explorer_treeView = Projects_QTreeView(self, self.__model)
        self.Projects_Explorer_treeView.setItemDelegate(self.__delegate)
        self.Projects_Explorer_treeView.setObjectName("Projects_Explorer_treeView")
        self.Projects_Explorer_treeView.setContextMenuPolicy(Qt.ActionsContextMenu)
        self.Projects_Explorer_dockWidgetContents_gridLayout.addWidget(self.Projects_Explorer_treeView, 0, 0)
        self.__view = self.Projects_Explorer_treeView
        self.__view_add_actions()

        self.__add_actions()

        # Signals / Slots.
        self.__view.expanded.connect(self.__view__expanded)
        self.__view.doubleClicked.connect(self.__view__doubleClicked)
        self.__view.selectionModel().selectionChanged.connect(self.__view_selectionModel__selectionChanged)
        self.__script_editor.Script_Editor_tabWidget.currentChanged.connect(
            self.__script_editor_Script_Editor_tabWidget__currentChanged)
        self.__script_editor.model.project_registered.connect(self.__script_editor_model__project_registered)

        self.initialized_ui = True
        return True
656488
def init_widget(self):
        
        super(UiKitEditText, self).init_widget()

        #: Init font properties etc...
        self.init_text()

        d = self.declaration
        if d.placeholder:
            self.set_placeholder(d.placeholder)
        if d.input_type != 'text':
            self.set_input_type(d.input_type)
        if d.style:
            self.set_style(d.style)

        #: A really ugly way to add the target
        #: would be nice if we could just pass the block pointer here :)
        self.get_app().bridge.addTarget(
            self.widget,
            forControlEvents=UITextField.UIControlEventEditingChanged,
            andCallback=self.widget.getId(),
            usingMethod="onValueChanged",
            withValues=["text"]#,"selected"]
        )

        self.widget.onValueChanged.connect(self.on_value_changed)
50334
def create_widget(self):
        
        d = self.declaration
        self.widget = EditText(self.get_context(), None,
                               d.style or "@attr/editTextStyle")
1045954
def editorValue(self, editor):
        
        value, success = projexui.widgetValue(editor)
        if not success:
            return None
        return value
823833
def setEditable( self, state ):
        
        self._editable = state
        
        if not state:
            self.setEditTriggers(QtGui.QTreeWidget.NoEditTriggers)
        else:
            triggers  = QtGui.QTreeWidget.DoubleClicked
            triggers |= QtGui.QTreeWidget.AnyKeyPressed
            triggers |= QtGui.QTreeWidget.EditKeyPressed
            triggers |= QtGui.QTreeWidget.SelectedClicked
            
            self.setEditTriggers(triggers)