Creates a TodoWidget instance for the given todo. Widgets are
        cached, the same object is returned for the same todo item.
773222
def create(p_class, p_todo, p_id_width=4):
        

        def parent_progress_may_have_changed(p_todo):
            """
            Returns True when a todo's progress should be updated because it is
            dependent on the parent's progress.
            """
            return p_todo.has_tag('p') and not p_todo.has_tag('due')

        source = p_todo.source()

        if source in p_class.cache:
            widget = p_class.cache[source]

            if p_todo is not widget.todo:
                # same source text but different todo instance (could happen
                # after an edit where a new Todo instance is created with the
                # same text as before)
                # simply fix the reference in the stored widget.
                widget.todo = p_todo

            if parent_progress_may_have_changed(p_todo):
                widget.update_progress()
        else:
            widget = p_class(p_todo, p_id_width)
            p_class.cache[source] = widget

        return widget
452798
def create_todolist(todo_list)
      post_params = {
        :body => todo_list.post_json,
        :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})
      }

      response = Logan::Client.post "/projects/#{@id}/todolists.json", post_params
      Logan::TodoList.new response.merge({ :project_id => @id })
    end
534972
def create_widget(self):
        
        d = self.declaration
        self.widget = DatePicker(self.get_context(), None,
                                 d.style or "@attr/datePickerStyle")
813045
def update(self):
        
        old_focus_position = self.todolist.focus
        id_length = max_id_length(self.view.todolist.count())

        del self.todolist[:]

        for group, todos in self.view.groups.items():
            if len(self.view.groups) > 1:
                grouplabel = ", ".join(group)
                self.todolist.append(urwid.Text(grouplabel))
                self.todolist.append(urwid.Divider('-'))

            for todo in todos:
                todowidget = TodoWidget.create(todo, id_length)
                todowidget.number = self.view.todolist.number(todo)
                self.todolist.append(todowidget)
                self.todolist.append(urwid.Divider('-'))

        if old_focus_position:
            try:
                self.todolist.set_focus(old_focus_position)
            except IndexError:
                # scroll to the bottom if the last item disappeared from column
                # -2 for the same reason as in self._scroll_to_bottom()
                self.todolist.set_focus(len(self.todolist) - 2)
1192420
def _handle_dot(self):
        
        self.printer = DotPrinter(self.todolist)

        try:
            arg = self.argument(1)
            todo = self.todolist.todo(arg)
            arg = self.argument(1)
            todos = set([self.todolist.todo(arg)])
            todos |= set(self.todolist.children(todo))
            todos |= set(self.todolist.parents(todo))
            todos = sorted(todos, key=lambda t: t.text())

            self.out(self.printer.print_list(todos))
        except InvalidTodoException:
            self.error("Invalid todo number given.")
        except InvalidCommandArgument:
            self.error(self.usage())
726349
function() {

			this.$("#todo-list").html('');

			switch(window.app.TodoFilter){
				case "active":
					_.each(window.app.Todos.remaining(), this.addOne);
					break;
				case "completed":
					_.each(window.app.Todos.completed(), this.addOne);
					break;
				default:
					window.app.Todos.each(this.addOne, this);
					break;
			}

		}
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);
        }

    }
598652
@Programmatic // for use by fixtures
    public SummernoteEditorToDoItem newToDo(
            final String description,
            final SummernoteEditorToDoItem.Category category,
            final SummernoteEditorToDoItem.Subcategory subcategory,
            final String userName,
            final LocalDate dueBy,
            final BigDecimal cost,
            final BigDecimal previousCost) {
        final SummernoteEditorToDoItem toDoItem = container.newTransientInstance(SummernoteEditorToDoItem.class);
        toDoItem.setDescription(description);
        toDoItem.setCategory(category);
        toDoItem.setSubcategory(subcategory);
        toDoItem.setOwnedBy(userName);
        toDoItem.setDueBy(dueBy);
        toDoItem.setCost(cost);
        toDoItem.setPreviousCost(previousCost);

        container.persist(toDoItem);
        container.flush();

        return toDoItem;
    }
11847
def create_widget(self):
        
        d = self.declaration
        self.widget = WebView(self.get_context(), None, d.style)
695341
@Override
	public Widget createDetailWidget() {
		return new AbstractWidget() {

			@Override
			public void onAboutToShow() {
				DefaultDataEditorWidget.this.onAboutToShow();
			}

			@Override
			public void onAboutToHide() {
				DefaultDataEditorWidget.this.onAboutToHide();
			}

			public JComponent getComponent() {
				return getDetailForm().getControl();
			}

			@Override
			public List<? extends AbstractCommand> getCommands() {
				return Arrays.asList(getDetailForm().getCommitCommand());
			}

			@Override
			public String getId() {
				return DefaultDataEditorWidget.this.getId() + "."
						+ getDetailForm().getId();
			}
		};
	}
1021537
def createWidgetItem(self, item_type, elem, getter, *getter_args):
        

        item = self.factory.createQObject(item_type, "item", (), False)
        props = self.wprops

        # Note that not all types of widget items support the full set of
        # properties.

        text = props.getProperty(elem, 'text')
        status_tip = props.getProperty(elem, 'statusTip')
        tool_tip = props.getProperty(elem, 'toolTip')
        whats_this = props.getProperty(elem, 'whatsThis')

        if self.any_i18n(text, status_tip, tool_tip, whats_this):
            self.factory.invoke("item", getter, getter_args)

        if text:
            item.setText(text)

        if status_tip:
            item.setStatusTip(status_tip)

        if tool_tip:
            item.setToolTip(tool_tip)

        if whats_this:
            item.setWhatsThis(whats_this)

        text_alignment = props.getProperty(elem, 'textAlignment')
        if text_alignment:
            item.setTextAlignment(text_alignment)

        font = props.getProperty(elem, 'font')
        if font:
            item.setFont(font)

        icon = props.getProperty(elem, 'icon')
        if icon:
            item.setIcon(icon)

        background = props.getProperty(elem, 'background')
        if background:
            item.setBackground(background)

        foreground = props.getProperty(elem, 'foreground')
        if foreground:
            item.setForeground(foreground)

        flags = props.getProperty(elem, 'flags')
        if flags:
            item.setFlags(flags)

        check_state = props.getProperty(elem, 'checkState')
        if check_state:
            item.setCheckState(check_state)

        return item
962484
def execute_specific(self, p_todo):
        
        self._handle_recurrence(p_todo)
        self.execute_specific_core(p_todo)

        printer = PrettyPrinter()
        self.out(self.prefix() + printer.print_todo(p_todo))
970684
function createTodoElement(item) {
        var template = $('#todo-item-template').html();
        var element = $(template);
        element.find(':checkbox')[0].checked = item.done;
        element.find('span').text(item.name);
        return element;
    }
958580
function(todoEl) {
			var todoId = getClosestTodoId(todoEl),
				editInputEl = todoEl.querySelector('.edit'),
				title = todosDB.get(todoId).title; // Grab current label

			// Set the edit input value to current label
			editInputEl.value = title;

			todoEl.classList.add('editing');

			// Place user cursor in the input
			editInputEl.focus();
		}
126824
function() {
            this.options.route = 'todo';
            this.options.collection = new TodoList(todos.remaining());
            this.options.toggleItem = _.bind(this.toggleItem, this);
            this.options.addItem = _.bind(this.addItem, this);
            this.options.refreshModel = _.bind(this.refreshModel, this);
        }
333002
def create_widget(self):
        
        widget = QDoubleSpinBox(self.parent_widget())
        widget.setKeyboardTracking(False)
        self.widget = widget
726423
def create_widget(self):
        
        d = self.declaration
        self.widget = ToggleButton(self.get_context(), None,
                                   d.style or "@attr/buttonStyleToggle")