view_class : View Class used to render content popup dialog
        view_class must be subclass of django.views.generic.View
182465
def validate_arguments(self, view_class, kwargs):
        

        # Check view_class inherit from django View
        if not issubclass(view_class, View):
            raise PopupViewIsNotSubclassView()

        self.view_class_name = view_class.__name__
        self.popup_dialog_title = kwargs.pop("popup_dialog_title", _("Popup Dialog: Select value"))

        self.callback_data = kwargs.pop("callback_data", {})
        if not isinstance(self.callback_data, dict):
            raise AttributeError("callback_data argument must be a dictionary")
        try:
            self.callback_data = urllib.urlencode(self.callback_data)
        except AttributeError:
            self.callback_data = urllib.parse.urlencode(self.callback_data)
1026650
private void initOverviewPopup() {

        m_updateExceptionsButton = new CmsPushButton();
        m_updateExceptionsButton.setText(Messages.get().key(Messages.GUI_LOCALE_DIALOG_OK_0));
        m_updateExceptionsButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                if (handleChange()) {
                    m_controller.updateExceptions(m_overviewList.getUncheckedDates());
                    m_overviewPopup.hide();
                }

            }
        });
        m_overviewPopup = new CmsPopup(Messages.get().key(Messages.GUI_SERIALDATE_OVERVIEW_POPUP_TITLE_0), 800);
        m_overviewPopup.center();
        m_overviewPopup.setAutoHideEnabled(true);
        m_overviewPopup.addDialogClose(null);
        m_overviewPopup.addButton(m_updateExceptionsButton);
        CmsScrollPanel panel = new CmsScrollPanel();
        m_overviewList = new CmsCheckableDatePanel(m_dateFormat, CmsCheckableDatePanel.Style.TWO_COLUMNS);
        m_overviewList.addDate(new Date());
        panel.getElement().getStyle().setPaddingLeft(10, Unit.PX);
        panel.getElement().getStyle().setProperty("maxHeight", m_overviewPopup.getAvailableHeight(0), Unit.PX);
        panel.add(m_overviewList);
        m_overviewPopup.add(panel);
        m_overviewPopup.hide();

    }
943373
def maintenance_view(template=None):
    
    if not template:
        template = "Pylot/Maintenance/index.html"

    class Maintenance(Pylot):
        @classmethod
        def register(cls, app, **kwargs):
            super(cls, cls).register(app, **kwargs)

            if cls.config_("MAINTENANCE_ON"):
                @app.before_request
                def on_maintenance():
                    return cls.render(layout=template), 503
    return Maintenance
151162
def _select_list_view(self, model, **kwargs):
        
        from uliweb import request

        # add download fields process
        fields = kwargs.pop('fields', None)
        meta = kwargs.pop('meta', 'Table')
        if 'download' in request.GET:
            if 'download_fields' in kwargs:
                fields = kwargs.pop('download_fields', fields)
            if 'download_meta' in kwargs:
                meta = kwargs.pop('download_meta')
            else:
                if hasattr(model, 'Download'):
                    meta = 'Download'
                else:
                    meta = meta

        view = functions.SelectListView(model, fields=fields, meta=meta, **kwargs)
        return view
98510
public <T extends View> boolean waitForView(final Class<T> viewClass){
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "waitForView("+viewClass+")");
		}
		
		return waiter.waitForView(viewClass, 0, Timeout.getLargeTimeout(), true);
	}
970767
def get_fk_popup_field(cls, *args, **kwargs):
        
        kwargs['popup_name'] = cls.get_class_verbose_name()
        kwargs['permissions_required'] = cls.permissions_required
        if cls.template_name_fk is not None:
            kwargs['template_name'] = cls.template_name_fk
        return ForeignKeyWidget('{}_popup_create'.format(cls.get_class_name()), *args, **kwargs)
848661
def register_view(self, view):
        
        # prepare State Type Change ComboBox
        super(StateOverviewController, self).register_view(view)
        self.allowed_state_classes = self.get_allowed_state_classes(self.model.state)

        view['entry_name'].connect('focus-out-event', self.on_focus_out)
        view['entry_name'].connect('key-press-event', self.check_for_enter)
        if self.model.state.name:
            view['entry_name'].set_text(self.model.state.name)
        view['label_id_value'].set_text(self.model.state.state_id)

        l_store = Gtk.ListStore(GObject.TYPE_STRING)
        combo = Gtk.ComboBoxText()
        combo.set_name("state_type_combo")
        combo.set_focus_on_click(False)
        combo.set_model(l_store)
        combo.show_all()
        view['type_viewport'].add(combo)
        view['type_viewport'].show()

        # Prepare label for state_name -> Library states cannot be changed
        if isinstance(self.model, LibraryStateModel):
            l_store.prepend(['LIBRARY'])
            combo.set_sensitive(False)

            self.view['library_path'].set_text(self.model.state.library_path + "/" + self.model.state.library_name)
            self.view['library_path'].set_sensitive(True)
            self.view['library_path'].set_editable(False)
            view['show_content_checkbutton'].set_active(self.model.meta['gui']['show_content'] is True)
            view['show_content_checkbutton'].connect('toggled', self.on_toggle_show_content)
            # self.view['properties_widget'].remove(self.view['show_content_checkbutton'])
        else:
            self.view['properties_widget'].remove(self.view['label_library_path'])
            self.view['properties_widget'].remove(self.view['library_path'])
            self.view['properties_widget'].remove(self.view['label_show_content'])
            self.view['properties_widget'].remove(self.view['show_content_checkbutton'])
            self.view['properties_widget'].resize(2, 5)

            for state_class in self.allowed_state_classes:
                if isinstance(self.model.state, state_class):
                    l_store.prepend([state_class.__name__])
                else:
                    l_store.append([state_class.__name__])

        combo.set_active(0)
        view['type_combobox'] = combo
        view['type_combobox'].connect('changed', self.change_type)

        # Prepare "is start state check button"
        has_no_start_state_state_types = [BarrierConcurrencyState, PreemptiveConcurrencyState]
        if not self.with_is_start_state_check_box or isinstance(self.model.state, DeciderState) or \
                self.model.state.is_root_state or type(self.model.parent.state) in has_no_start_state_state_types:
            view['is_start_state_checkbutton'].destroy()
        else:
            view['is_start_state_checkbutton'].set_active(bool(self.model.is_start))
            view['is_start_state_checkbutton'].connect('toggled', self.on_toggle_is_start_state)

        if isinstance(self.model.state, DeciderState):
            combo.set_sensitive(False)

        # in case the state is inside of a library
        if self.model.state.get_next_upper_library_root_state():
            view['entry_name'].set_editable(False)
            combo.set_sensitive(False)
            view['is_start_state_checkbutton'].set_sensitive(False)
            if isinstance(self.model, LibraryStateModel):
                self.view['show_content_checkbutton'].set_sensitive(False)
193337
def get_view(self, request, view_class, opts=None):
        
        kwargs = {}
        if opts:
            if not isinstance(opts, dict):
                opts = opts.__dict__
        else:
            opts = {}

        if not view_class in VALID_MIXIN_OPTIONS:
            valid_options = view_class.__dict__.keys()
            for cls in view_class.__bases__:
                if cls != object:
                    valid_options += cls.__dict__.keys()
            VALID_MIXIN_OPTIONS[view_class] = valid_options

        for key in VALID_MIXIN_OPTIONS[view_class]:
            if key in opts:
                kwargs[key] = opts[key]
            elif hasattr(self, key):
                kwargs[key] = getattr(self, key)

        view = view_class(**kwargs)
        view.request = request
        view.kwargs = {}
        return view
901713
def delete(cls):
        

        class PopupDeleteViewView(PopupDeleteView, cls.parent_class):
            model = cls.model
            form_class = cls.form_class
            permission_required = cls.get_permission_required('delete')

        return PopupDeleteViewView
106005
def register_view(self, view_class, *args, **kwargs):
        
        protected_view_class = self.view_class_factory(view_class)
        if 'endpoint' not in kwargs:
            kwargs['endpoint'] = view_class(*args, **kwargs).endpoint
        self.admin.add_view(protected_view_class(*args, **kwargs))
1047758
def register(self, backbone_view_class):
        
        if backbone_view_class not in self._registry:
            self._registry.append(backbone_view_class)
509742
def chosen_view_factory(chooser_cls):
    
    class ChosenView(chooser_cls):
        #noinspection PyUnusedLocal
        def get(self, request, *args, **kwargs):
            """
            Returns GET response.

            :param request: the request instance.
            :rtype: django.http.HttpResponse.
            """
            #noinspection PyAttributeOutsideInit
            self.object = self.get_object()

            return render_modal_workflow(
                self.request,
                None,
                '{0}/chosen.js'.format(self.template_dir),
                {'obj': self.get_json(self.object)}
            )

        def get_object(self, queryset=None):
            """
            Returns chosen object instance.

            :param queryset: the queryset instance.
            :rtype: django.db.models.Model.
            """
            if queryset is None:
                queryset = self.get_queryset()

            pk = self.kwargs.get('pk', None)

            try:
                return queryset.get(pk=pk)
            except self.models.DoesNotExist:
                raise Http404()

        def post(self, request, *args, **kwargs):
            """
            Returns POST response.

            :param request: the request instance.
            :rtype: django.http.HttpResponse.
            """
            return self.get(request, *args, **kwargs)

    return ChosenView
1200749
def generate_create_view(self):
        """"""

        name = model_class_form(self.model + 'CreateView')
        create_args = dict(
            form_class=self.get_actual_form('create'),
            model=self.get_model_class,
            template_name=self.get_template('create'),
            permissions=self.view_permission('create'),
            permission_required=self.check_permission_required,
            login_required=self.check_login_required,
            inlineformset=self.inlineformset,
            success_url=reverse_lazy('{}-{}-list'.format(self.app, self.custom_postfix_url)),
            custom_form=self.createupdate_forms or self.custom_modelform,
            custom_postfix_url=self.custom_postfix_url
        )

        parent_classes = [self.get_createupdate_mixin(), CreateView]
        if self.custom_create_view_mixin:
            parent_classes.insert(0, self.custom_create_view_mixin)

        create_class = type(
            name,
            tuple(parent_classes),
            create_args
        )

        self.classes[name] = create_class
        return create_class
936954
static Class<?> findViewClass(Context context, String name)
            throws ClassNotFoundException {
        if (name.indexOf('.') >= 0) {
            return loadViewClass(context, name);
        }

        for (String prefix : VIEW_CLASS_PREFIX_LIST) {
            try {
                return loadViewClass(context, prefix + name);
            } catch (ClassNotFoundException e) {
                continue;
            }
        }

        throw new ClassNotFoundException("Couldn't load View class for " + name);
    }
1210622
def as_view(cls, endpoint, protocol, *init_args, **init_kwargs):
        '''
        
        '''
        def _wrapper(request, *args, **kwargs):
            ''' Make a new instance of the resource class and returns a coroutine for execution'''
            instance = cls(*init_args, endpoint=endpoint, request=request, **init_kwargs)
            if protocol == Resource.Protocol.http:
                return instance._wrap_http(cls.dispatch, endpoint=endpoint, *args, **kwargs)
            elif protocol == Resource.Protocol.websocket:
                return instance._wrap_ws(cls.dispatch, endpoint=endpoint, *args, **kwargs)
            elif protocol == Resource.Protocol.amqp:
                return instance._wrap_amqp(endpoint, *args, **kwargs)
            else:
                raise Exception('Communication protocol not specified')

        return _wrapper
1283570
def get_view_model(cls):
    
    msg = 'When using get_queryset you must set a auto_filters_model field in the viewset'
    if cls.queryset is not None:
        return cls.queryset.model
    else:
        assert hasattr(cls, 'auto_filters_model'), msg
        return cls.auto_filters_model
567972
public void setViewClass(final Class<? extends ThymeleafReactiveView> viewClass) {
        if (viewClass == null || !ThymeleafReactiveView.class.isAssignableFrom(viewClass)) {
            throw new IllegalArgumentException(
                    "Given view class [" + (viewClass != null ? viewClass.getName() : null) +
                    "] is not of type [" + ThymeleafReactiveView.class.getName() + "]");
        }
        this.viewClass = viewClass;
    }