Get the default widget or the widget defined in settings
327997
def get_default_widget():
    
    default_widget = forms.Textarea
    if hasattr(settings, 'BLEACH_DEFAULT_WIDGET'):
        default_widget = load_widget(settings.BLEACH_DEFAULT_WIDGET)
    return default_widget
226772
function(widget_title) {

		if (Lava.schema.DEBUG && !(widget_title in this.widgets)) Lava.t("Widget config not found: " + widget_title);

		var config = this.widgets[widget_title];

		if (!config.is_extended) {

			Lava.extenders[config.extender_type](config);

		}

		return config;

	}
475274
def get_widget_css_class(self, attrs):
        """"""
        size_class = 'size-{0}'.format(self.num_inputs)

        if 'class' in attrs:
            attrs['class'] += ' {0}'.format(size_class)
        else:
            attrs['class'] = size_class
146248
def widgets(self):
        """"""
        w = []
        for i in range(self.count()):
            w.append(self.widget(i))
        return w
320674
@Override
    protected void defineWidgets() {

        // initialize the object to use for the dialog
        initLoginMessageObject();

        setKeyPrefix(KEY_PREFIX);

        // required to read the default values for the optional context parameters for the widgets
        CmsLoginMessage def = new CmsLoginMessage();

        addWidget(new CmsWidgetDialogParameter(m_loginMessage, "enabled", PAGES[0], new CmsCheckboxWidget()));
        addWidget(new CmsWidgetDialogParameter(m_loginMessage, "message", PAGES[0], new CmsTextareaWidget()));
        addWidget(new CmsWidgetDialogParameter(m_loginMessage, "loginForbidden", PAGES[0], new CmsCheckboxWidget()));
        addWidget(
            new CmsWidgetDialogParameter(
                m_loginMessage,
                "timeStart",
                String.valueOf(def.getTimeStart()),
                PAGES[0],
                new CmsCalendarWidget(),
                0,
                1));
        addWidget(
            new CmsWidgetDialogParameter(
                m_loginMessage,
                "timeEnd",
                String.valueOf(def.getTimeEnd()),
                PAGES[0],
                new CmsCalendarWidget(),
                0,
                1));
    }
92310
function(options) {
		PropertyWidget.apply(this, arguments);
		SettingsTextfield.apply(this, arguments);
		if (this.node && options.indent) {
			var spans = this.node.getElementsByTagName('span');
			if (spans) {
				var span = spans[0];
				var existingClassName = span.className;
				if (existingClassName) {
					span.className += " setting-indent";
				} else {
					span.className = "setting-indent";
				}
			}
		}
	}
347011
def _settings_str(self):
        """"""
        settings = "Automatically save changes: {}, " \
            "Show tray icon: {}, " \
            "Allow keyboard navigation: {}, " \
            "Sort by usage count: {}, " \
            "Enable undo using backspace: {}, " \
            "Tray icon theme: {}".format(
               self.autosave_checkbox.isChecked(),
               self.show_tray_checkbox.isChecked(),
               self.allow_kb_nav_checkbox.isChecked(),
               self.sort_by_usage_checkbox.isChecked(),
               self.enable_undo_checkbox.isChecked(),
               self.system_tray_icon_theme_combobox.currentData(Qt.UserRole)
            )
        return settings
485769
def get_view(self):
        
        d = self.declaration
        if d.cached and self.widget:
            return self.widget
        if d.defer_loading:
             self.widget = FrameLayout(self.get_context())
             app = self.get_context()
             app.deferred_call(
                 lambda: self.widget.addView(self.load_view(), 0))
        else:
            self.widget = self.load_view()
        return self.widget
1067813
def get_widget(name):
    
    for widget in registry:
        if widget.__name__ == name:
            return widget
    raise WidgetNotFound(
        _('The widget %s has not been registered.') % name)
1203098
function shouldShowWidget(settings = {}) {
  const nowDate = new Date();
  // Show widget if flag does not exist (old widgets)
  if (!settings.hasOwnProperty('published')) {
    return true;
  }

  if (settings.published === false) {
    return false;
  }

  // Defensive here since this data comes from the pipeline, it might be invalid for some reasons.
  if (settings.hasOwnProperty('plan') && settings.plan) {
    let startDate = null;
    let endDate = null;
    let notStartedYet = false;
    let finishedAlready = false;

    if (settings.planDate.valid_from) {
      startDate = new Date(settings.planDate.valid_from);
      notStartedYet = nowDate <= startDate;
    }

    if (settings.planDate.valid_to) {
      endDate = new Date(settings.planDate.valid_to);
      finishedAlready = nowDate >= endDate;
    }
    // Don't hide if no dates found
    if (!startDate && !endDate) {
      return true;
    }

    // Hide if some wrong dates are passed
    if (startDate && endDate && (startDate >= endDate)) {
      return false;
    }

    // Hide if start date is set but it is not there yet
    // Hide if end date is reached
    if ((startDate && notStartedYet) || (endDate && finishedAlready)) {
      return false;
    }
  }

  return true;
}
313142
def get_context(self, name, value, attrs):
        """"""
        context = super().get_context(
            name, value, attrs)
        context['widget']['attrs']['dp_config'] = json_dumps(self.config)
        return context
1137116
def create_widget(self):
        
        d = self.declaration
        self.widget = TimePicker(self.get_context(), None,
                                 d.style or '@attr/timePickerStyle')
1243357
def get_widget(title):
    """"""
    tform = idaapi.find_tform(title)
    if not tform:
        raise exceptions.FormNotFound("No form titled {!r} found.".format(title))

    return form_to_widget(tform)
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
4437
def get_setting(key, *default):
    """"""
    if default:
        return get_settings().get(key, default[0])
    else:
        return get_settings()[key]
717828
def get_widget(self, page, language, fallback=Textarea):
        """"""
        if isinstance(self.widget, str):
            widget = get_widget(self.widget)
        else:
            widget = self.widget
        try:
            return widget(page=page, language=language)
        except:
            pass
        return widget()
726423
def create_widget(self):
        
        d = self.declaration
        self.widget = ToggleButton(self.get_context(), None,
                                   d.style or "@attr/buttonStyleToggle")