Adds a new view to the link.
973563
public function addView()
    {
        $view = View::create([
            'link_id'           => $this->id,
            'language'          => Identify::lang()->getLanguage(),
            'browser'           => Identify::browser()->getName(),
            'browser_version'   => Identify::browser()->getVersion(),
            'os'                => Identify::os()->getName(),
            'os_version'        => Identify::os()->getVersion(),
            'ip'                => $this->getIP(),
        ]);
    }
1142366
public void addFooterView(View view) {
        mFooterViewList.add(view);
        if (mAdapterWrapper != null) {
            mAdapterWrapper.addFooterViewAndNotify(view);
        }
    }
811631
public function Add() {
		if(!$this->_Permission())
			return;

      $this->Title(T('Add Role'));

      // Use the edit form with no roleid specified.
      $this->View = 'Edit';
      $this->Edit();
   }
419356
def add_view(self, view_name, handler):
        
        # 如果不是BaseHandler的子类则不加入
        if is_subclass(handler, BaseHandler):
            self.views.append((view_name, handler))
1313089
def link_add(self, rel, href, **atts):
        
        self.link_set(rel, href, allow_duplicates=True, **atts)
669988
def add_html_link(app, pagename, templatename, context, doctree):
    """"""
    base_url = app.config['html_theme_options'].get('base_url', '')
    if base_url:
        app.sitemap_links.append(base_url + pagename + ".html")
1299683
def view_or_add(self, slug):
        '''
        
        '''
        rec_page = MWiki.get_by_uid(slug)

        if rec_page:
            if rec_page.kind == self.kind:
                self.view(rec_page)
            else:
                return False
        else:
            self.to_add(slug)
953049
def add_view(self, request, form_url='', extra_context=None):
        """"""
        model = self.model
        opts = model._meta

        if not self.has_add_permission(request):
            raise PermissionDenied

        ModelForm = self.get_form(request)
        formsets = []

        if request.method == 'POST':
            form = ModelForm(request.POST, request.FILES)

            if form.is_valid():
                new_object = self.save_form(request, form, change=False)
                form_validated = True
            else:
                form_validated = False
                new_object = self.model()

            prefixes = {}

            for FormSet, inline in zip(self.get_formsets(request),
                                       self.get_inline_instances(request)):
                prefix = FormSet.get_default_prefix()
                prefixes[prefix] = prefixes.get(prefix, 0) + 1

                if prefixes[prefix] != 1:
                    prefix = "{0}-{1}".format(prefix, prefixes[prefix])

                formset = FormSet(data=request.POST, files=request.FILES,
                                  instance=new_object,
                                  save_as_new="_saveasnew" in request.POST,
                                  prefix=prefix, queryset=inline.queryset(request))

                formsets.append(formset)

                for inline in self.get_inline_instances(request):
                    # If this is the inline that matches this formset, and
                    # we have some nested inlines to deal with, then we need
                    # to get the relevant formset for each of the forms in
                    # the current formset.
                    if inline.inlines and inline.model == formset.model:
                        for nested in inline.inline_instances:
                            for the_form in formset.forms:
                                InlineFormSet = nested.get_formset(request, the_form.instance)
                                prefix = "{0}-{1}".format(the_form.prefix,
                                                          InlineFormSet.get_default_prefix())
                                formsets.append(InlineFormSet(request.POST, request.FILES,
                                                              instance=the_form.instance,
                                                              prefix=prefix))
            if all_valid(formsets) and form_validated:
                self.save_model(request, new_object, form, change=False)
                form.save_m2m()

                for formset in formsets:
                    self.save_formset(request, form, formset, change=False)

                self.log_addition(request, new_object)

                return self.response_add(request, new_object)
        else:
            # Prepare the dict of initial data from the request.
            # We have to special-case M2Ms as a list of comma-separated PKs.
            initial = dict(request.GET.items())

            for k in initial:
                try:
                    f = opts.get_field(k)
                except models.FieldDoesNotExist:
                    continue

                if isinstance(f, models.ManyToManyField):
                    initial[k] = initial[k].split(",")

            form = ModelForm(initial=initial)
            prefixes = {}

            for FormSet, inline in zip(self.get_formsets(request),
                                       self.get_inline_instances(request)):
                prefix = FormSet.get_default_prefix()
                prefixes[prefix] = prefixes.get(prefix, 0) + 1

                if prefixes[prefix] != 1:
                    prefix = "{0}-{1}".format(prefix, prefixes[prefix])

                formset = FormSet(instance=self.model(), prefix=prefix,
                                  queryset=inline.queryset(request))
                formsets.append(formset)

        adminForm = helpers.AdminForm(form, list(self.get_fieldsets(request)),
                                      self.prepopulated_fields, self.get_readonly_fields(request),
                                      model_admin=self)

        media = self.media + adminForm.media
        inline_admin_formsets = []

        for inline, formset in zip(self.get_inline_instances(request), formsets):
            fieldsets = list(inline.get_fieldsets(request))
            readonly = list(inline.get_readonly_fields(request))
            inline_admin_formset = helpers.InlineAdminFormSet(inline, formset,
                                                              fieldsets, readonly,
                                                              model_admin=self)
            if inline.inlines:
                for form in formset.forms:
                    if form.instance.pk:
                        instance = form.instance
                    else:
                        instance = None

                    form.inlines = inline.get_inlines(request, instance, prefix=form.prefix)

                inline_admin_formset.inlines = inline.get_inlines(request)

            inline_admin_formsets.append(inline_admin_formset)
            media = media + inline_admin_formset.media

        context = {
            'title': _('Add %s') % force_unicode(opts.verbose_name),
            'adminform': adminForm,
            'is_popup': "_popup" in request.REQUEST,
            'show_delete': False,
            'media': mark_safe(media),
            'inline_admin_formsets': inline_admin_formsets,
            'errors': helpers.AdminErrorList(form, formsets),
            'app_label': opts.app_label,
        }

        context.update(extra_context or {})

        return self.render_change_form(request, context, form_url=form_url, add=True)
1167188
def add_url(self, *args, **kwargs):
        
        if len(args) == 1 and not kwargs and isinstance(args[0], UrlEntry):
            self.urls.append(args[0])
        else:
            self.urls.append(UrlEntry(*args, **kwargs))
1230779
def add_view(self, path: str, handler: AbstractView,
                 **kwargs: Any) -> AbstractRoute:
        
        return self.add_route(hdrs.METH_ANY, path, handler, **kwargs)
124820
public function View ()
	{
		
		// If there is no view then use basic by default
		
		if (!$this->view)
		{
			$this->view		= new View\Basic;
		}
		
		// If there is no template then set default
		
		if (!$this->template)
		{
			$this->template	= $this->view->defaultTemplate ($this->module, $this->controller, $this->action);
		}

		// Assign controller reference

		$this->view->assign ('controller', $this);

		// Display view
		
		$this->view->display ($this->template);
		
	}
120540
public void add(Mtp2 link) {
        // add link at the first empty place
        for (int i = 0; i < links.length; i++) {
            if (links[i] == null) {
                links[i] = link;
                break;
            }
        }
        count++;
        remap();
    }
239275
def setWebView( self, webView ):
        
        if ( self._webView ):
            self._webView.removeAction(self._findAction)
        
        self._webView = webView
        if ( webView ):
            webView.addAction(self._findAction)
217252
def link_view(self, view):
        
        if view is self._linked_view:
            return
        if self._linked_view is not None:
            self._linked_view.scene.transform.changed.disconnect(
                self._view_changed)
        self._linked_view = view
        view.scene.transform.changed.connect(self._view_changed)
        self._view_changed()
171401
public void viewAccepted(View new_view) {
        List<Address> new_mbrs=new_view.getMembers();
        if(new_mbrs != null) {
            notifyViewChange(new_view);
            members.clear();
            members.addAll(new_mbrs);
        }
		//if size is bigger than one, there are more peers in the group
		//otherwise there is only one server.
        send_message=members.size() > 1;
    }
1137082
def add_view_info(self, view_info: ViewInfo):
        ''''''
        try:
            next(info for info in self._view_infos if info.view == view_info.view)
        except StopIteration:
            indent = len(self._view_infos) * '\t'
            self._view_infos.append(view_info)
            info = 'Line {0} in "{1}"'.format(view_info.line, view_info.view)
            self.add_info(indent + 'View info', info)
283978
public function add( $name = null ) {
		$name = $name ? $name : $this->getName();
		$path = __DIR__;
		$name = ucfirst( $name );
		include  "{$path}/Views/{$name}.php";
	}