Called by the GMS when a VIEW is received.
@param view The view to be installed
@param digest   If view is a MergeView, the digest contains the seqnos of all members and has to be set by GMS
486874
public void handleViewChange(View view, Digest digest) {
        if(gms.isLeaving() && !view.containsMember(gms.local_addr))
            return;
        View prev_view=gms.view();
        gms.installView(view, digest);
        Address prev_coord=prev_view != null? prev_view.getCoord() : null, curr_coord=view.getCoord();
        if(!Objects.equals(curr_coord, prev_coord))
            coordChanged(prev_coord, curr_coord);
    }
265426
public void onResume(Object view) {
        getPresenter();
        if (presenter != null && !presenterHasView) {
            //noinspection unchecked
            presenter.takeView(view);
            presenterHasView = true;
        }
    }
653045
private static void enableView(final View view, final boolean enable) {
    view.setEnabled(enable);
    view.setAlpha(enable ? 1f : 0.1f);
  }
1013510
public static function setView($view)
    {
        if (count(self::$execContexts)) {
            self::$execContexts[count(self::$execContexts) - 1]['view'] = $view;
        }
    }
1094712
@Override
    protected void initViews(List<View> views) throws IOException {
        BranchListView v = new BranchListView("All", this);
        v.setIncludeRegex(".*");
        views.add(v);
        v.save();
    }
874603
@SuppressWarnings("WeakerAccess")
	public void detachView(View view) {
		if (mViewState != null) {
			mViewState.detachView(view);
		} else {
			mViews.remove(view);
		}
	}
1169485
protected void sendMergeView(Collection<Address> coords, MergeData combined_merge_data, MergeId merge_id) {
        if(coords == null || coords.isEmpty() || combined_merge_data == null)
            return;

        View view=combined_merge_data.view;
        Digest digest=combined_merge_data.digest;
        if(view == null || digest == null) {
            log.error(Util.getMessage("ViewOrDigestIsNullCannotSendConsolidatedMergeView/Digest"));
            return;
        }

        int size=0;
        if(gms.flushProtocolInStack) {
            gms.merge_ack_collector.reset(coords);
            size=gms.merge_ack_collector.size();
        }

        Event install_merge_view_evt=new Event(Event.INSTALL_MERGE_VIEW, view);
        gms.getUpProtocol().up(install_merge_view_evt);
        gms.getDownProtocol().down(install_merge_view_evt);

        long start=System.currentTimeMillis();
        for(Address coord: coords) {
            Message msg=new Message(coord).setBuffer(GMS.marshal(view, digest))
              .putHeader(gms.getId(),new GMS.GmsHeader(GMS.GmsHeader.INSTALL_MERGE_VIEW).mergeId(merge_id));
            gms.getDownProtocol().down(msg);
        }

        //[JGRP-700] - FLUSH: flushing should span merge; if flush is in stack, wait for acks from subview coordinators
        if(gms.flushProtocolInStack) {
            try {
                gms.merge_ack_collector.waitForAllAcks(gms.view_ack_collection_timeout);
                log.trace("%s: received all ACKs (%d) for merge view %s in %d ms",
                          gms.local_addr, size, view, (System.currentTimeMillis() - start));
            }
            catch(TimeoutException e) {
                log.warn("%s: failed to collect all ACKs (%d) for merge view %s after %d ms, missing ACKs from %s",
                         gms.local_addr, size, view, gms.view_ack_collection_timeout, gms.merge_ack_collector.printMissing());
            }
        }
    }
162732
private function view(View $view): void
    {
        $this->group($view->getName(), false);
        $this->presentationModel($view->getPresentationModel(), 'presentationModel');
        $this->groupEnd();
    }
583425
public void addHeaderView(View view) {
        mHeaderViewList.add(view);
        if (mAdapterWrapper != null) {
            mAdapterWrapper.addHeaderViewAndNotify(view);
        }
    }
766411
@SuppressWarnings({"unchecked", "unused"})
	public void setViewState(MvpViewState<View> viewState) {
		mViewStateAsView = (View) viewState;
		mViewState = (MvpViewState) viewState;
	}
653597
public FormValidation doViewExistsCheck(@QueryParameter String value) {
        checkPermission(View.CREATE);

        String view = Util.fixEmpty(value);
        if(view==null) return FormValidation.ok();

        if(Jenkins.getInstance().getView(view)!=null)
            return FormValidation.ok();
        else
            return FormValidation.error(Messages.ProxyView_NoSuchViewExists(value));
    }
117910
private void createView(Map<String, MapReduce> views, String columnName)
    {
        MapReduce mapr = new MapReduce();
        mapr.setMap("function(doc){if(doc." + columnName + "){emit(doc." + columnName + ", doc);}}");
        views.put(columnName, mapr);
    }
658179
def group_view(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('group:view', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
    })
102903
public void viewChange(View view) {
        if(view == null)
            return;

        // SiteAddresses are not checked as they might be in a different cluster
        if(!(target instanceof SiteAddress) && !view.containsMember(target) && !isDone()) {
            completeExceptionally(new SuspectedException(target));
            corrDone();
        }
    }
35056
public void setEmptyView(View emptyView) {
        mEmptyView = emptyView;

        final ListAdapter adapter = getAdapter();
        final boolean empty = ((adapter == null) || adapter.isEmpty());
        updateEmptyStatus(empty);
    }
786795
public void setDigestOn(boolean digestOn) {
        addField(SubscribeOptionFields.deliver, FormField.Type.bool);
        setAnswer(SubscribeOptionFields.deliver.getFieldName(), digestOn);
    }
783939
private void createViewForSum(Map<String, MapReduce> views)
    {
        if (views.get(CouchDBConstants.SUM) == null)
        {
            MapReduce mapr = new MapReduce();
            mapr.setMap("function(doc){for(field in doc){var o = doc[field];if(typeof(o)==\"number\")emit(field+\"_\"+doc."
                    + CouchDBConstants.ENTITYNAME + ", o);}}");
            mapr.setReduce("function(keys, values){return sum(values);}");
            views.put(CouchDBConstants.SUM, mapr);
        }
    }