Register a classview and viewhandler for a given app and action
505849
def register_view_for(cls, app, action, classview, attr):
        
        if 'view_for_endpoints' not in cls.__dict__:
            cls.view_for_endpoints = {}
        cls.view_for_endpoints.setdefault(app, {})[action] = (classview, attr)
189185
protected void registerPreviewHandler() {

        if (m_previewHandlerRegistration == null) {
            NativePreviewHandler eventPreviewHandler = new NativePreviewHandler() {

                public void onPreviewNativeEvent(NativePreviewEvent event) {

                    Event nativeEvent = Event.as(event.getNativeEvent());
                    if (DOM.eventGetType(nativeEvent) == Event.ONKEYDOWN) {
                        int keyCode = nativeEvent.getKeyCode();
                        if (keyCode == KeyCodes.KEY_ESCAPE) {
                            onClickCancel();
                        } else if (keyCode == KeyCodes.KEY_ENTER) {
                            Element element = CmsDomUtil.getActiveElement();
                            boolean isTextarea = (element != null) && element.getTagName().equalsIgnoreCase("textarea");
                            if (!isTextarea) {
                                onClickOk();
                            }
                        }
                    }
                }
            };
            m_previewHandlerRegistration = Event.addNativePreviewHandler(eventPreviewHandler);
        }
    }
35567
protected function registerViews()
    {
        $path      = $this->getBasePath() . '/' . $this->convention->viewsFolder();
        $namespace = $this->config('views.namespace', $this->shortName());

        if (is_dir($path)) {
            $this->loadViewsFrom($path, $namespace);
        }
    }
945255
def init_app(cls, app, callback=None):
        
        processed = set()
        cls.__views__ = set()
        cls.is_always_available = False
        for base in cls.__mro__:
            for name, attr in base.__dict__.items():
                if name in processed:
                    continue
                processed.add(name)
                if isinstance(attr, ViewHandler):
                    if base != cls:  # Copy ViewHandler instances into subclasses
                        # TODO: Don't do this during init_app. Use a metaclass
                        # and do this when the class is defined.
                        attr = attr.copy_for_subclass()
                        setattr(cls, name, attr)
                    attr.__set_name__(cls, name)  # Required for Python < 3.6
                    cls.__views__.add(name)
                    attr.init_app(app, cls, callback=callback)
                    if not hasattr(attr.wrapped_func, 'is_available'):
                        cls.is_always_available = True
518275
def _init_app(self, app):
        
        for resource, urls, kwargs in self.resources:
            self._register_view(app, resource, *urls, **kwargs)
888253
public final void registerView(final View view) {
        mActivity.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if (null != mRenderableViewGroup && view.getParent() != mRenderableViewGroup) {
                    /* The full screen should be updated otherwise just the children's bounds may be refreshed. */
                    mRenderableViewGroup.setClipChildren(false);
                    mRenderableViewGroup.addView(view);
                }
            }
        });
    }
511672
def register_view(self, view):
        """"""
        ExtendedController.register_view(self, view)  # no super to avoid sm based selection initialization
        view['name_text'].set_property('editable', True)
        view['value_text'].set_property('editable', True)
        view['type_text'].set_property('editable', True)

        self.tree_view.connect('key-press-event', self.tree_view_keypress_callback)
        self._apply_value_on_edited_and_focus_out(view['name_text'], self.apply_new_global_variable_name)
        self._apply_value_on_edited_and_focus_out(view['value_text'], self.apply_new_global_variable_value)
        self._apply_value_on_edited_and_focus_out(view['type_text'], self.apply_new_global_variable_type)
        view['new_global_variable_button'].connect('clicked', self.on_add)
        view['delete_global_variable_button'].connect('clicked', self.on_remove)
        view['lock_global_variable_button'].connect('clicked', self.on_lock)
        view['unlock_global_variable_button'].connect('clicked', self.on_unlock)
        self._tree_selection.set_mode(Gtk.SelectionMode.MULTIPLE)
623808
def action(cls, view):
        """"""
        name = "%s:%s" % (cls.name, view.__name__)
        path = "%s/%s" % (cls.url, view.__name__)
        cls.actions.append((view.__doc__, path))
        return cls.register(path, name=name)(view)
1133648
protected function registerHandler()
	{
		$this->app['exception'] = $this->app->share(function($app)
		{
			return new Handler($app, $app['exception.plain'], $app['exception.debug']);
		});
	}
419356
def add_view(self, view_name, handler):
        
        # 如果不是BaseHandler的子类则不加入
        if is_subclass(handler, BaseHandler):
            self.views.append((view_name, handler))
480929
def register_view(self, view):
        """"""
        super(TopToolBarUndockedWindowController, self).register_view(view)
        view['redock_button'].connect('clicked', self.on_redock_button_clicked)
967420
def register_view(self, view):
        """"""
        super(TopToolBarController, self).register_view(view)
        view['maximize_button'].connect('clicked', self.on_maximize_button_clicked)
        self.update_maximize_button()
31221
function() {
    this._super();

    // Register the view for event handling. This hash is used by
    // Ember.EventDispatcher to dispatch incoming events.
    if (!this.isVirtual) Ember.View.views[get(this, 'elementId')] = this;

    // setup child views. be sure to clone the child views array first
    this._childViews = this._childViews.slice();

    Ember.assert("Only arrays are allowed for 'classNameBindings'", Ember.typeOf(this.classNameBindings) === 'array');
    this.classNameBindings = Ember.A(this.classNameBindings.slice());

    Ember.assert("Only arrays are allowed for 'classNames'", Ember.typeOf(this.classNames) === 'array');
    this.classNames = Ember.A(this.classNames.slice());

    var viewController = get(this, 'viewController');
    if (viewController) {
      viewController = get(viewController);
      if (viewController) {
        set(viewController, 'view', this);
      }
    }
  }
847461
def _init_app(self, app):
        
        app.handle_exception = partial(self.error_router, app.handle_exception)
        app.handle_user_exception = partial(self.error_router, app.handle_user_exception)

        if len(self.resources) > 0:
            for resource, urls, kwargs in self.resources:
                self._register_view(app, resource, *urls, **kwargs)
379048
public void register(ModelViewConverter<? extends ModelView> c) {
        java2json.put(c.getSupportedView(), c);
        json2java.put(c.getJSONId(), c);

    }
1005717
def register_actionhandler(self, action_handler: type) -> None:
        
        for k in action_handler.__dict__:
            if k.startswith('_'):
                continue
            app = action_handler_adapter(action_handler, k)
            self.register_app(k, app)
126639
public void registerView(final Class ownerClass, final Pair<View, View> view) {
        registerView(ownerClass.getSimpleName(), view);
    }