Set view state to presenter

@param viewState that implements type, setted as View generic param
766411
@SuppressWarnings({"unchecked", "unused"})
	public void setViewState(MvpViewState<View> viewState) {
		mViewStateAsView = (View) viewState;
		mViewState = (MvpViewState) viewState;
	}
265426
public void onResume(Object view) {
        getPresenter();
        if (presenter != null && !presenterHasView) {
            //noinspection unchecked
            presenter.takeView(view);
            presenterHasView = true;
        }
    }
899714
private void pushState(final S state) {
        this.state = state;

        header.setHTML(TEMPLATE.header(currentStep().getTitle()));
        clearError();
        body.showWidget(state); // will call onShow(C) for the current step
        footer.back.setEnabled(state != initialState());
        footer.next
                .setHTML(
                        lastStates().contains(state) ? CONSTANTS.common_label_finish() : CONSTANTS.common_label_next());
    }
373390
@Override public final void onBindViewHolder(VH holder, int position) {
    if (isHeaderPosition(position)) {
      onBindHeaderViewHolder(holder, position);
    } else if (isFooterPosition(position)) {
      onBindFooterViewHolder(holder, position);
    } else {
      onBindItemViewHolder(holder, position);
    }
  }
1317801
private synchronized void setState(int state) {
        mState = state;

        // Give the new state to the Handler so the UI Activity can update
        mHandler.obtainMessage(ISOBlueDemo.MESSAGE_STATE_CHANGE, state, -1)
                .sendToTarget();
    }
1089819
function mainViewStateSet(mode, recursive) {
    mainView.state.mode = mode;
    mainView.state.recursive = recursive;
  }
487969
@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		
		super.onViewCreated(view, savedInstanceState);
		InjectionUtils.inject(INJECTOR_CONFIGURATION);
	}
1098416
def setShowOptionsButton(self, state):
        
        self._showOptionsButton = state
        self._optionsButton.setVisible(state)
165219
public BinderConfiguration getViewStateBinderConfiguration(final ViewState state) {
        val field = ReflectionUtils.findField(state.getViewFactory().getClass(), "binderConfiguration");
        ReflectionUtils.makeAccessible(field);
        return (BinderConfiguration) ReflectionUtils.getField(field, state.getViewFactory());
    }
1347246
public void setAdapter(SlideShowAdapter adapter) {
        if (this.adapter != null) {
            this.adapter.unregisterDataSetObserver(adapterObserver);
        }
        this.adapter = adapter;
        this.adapter.registerDataSetObserver(adapterObserver);

        if (adapter != null) {
            PlayList pl = getPlaylist();
            pl.onSlideCountChanged(adapter.getCount());
            pl.rewind();

            prepareSlide(pl.getFirstSlide());
        }
    }
847892
@Deprecated
	public void setViewStates(@NonNull final SparseArray<ViewState> states) {
		mViewStates.clear();
		for (int i = 0; i < states.size(); i++) {
			final int key = states.keyAt(i);
			final ViewState value = states.get(key);
			mViewStates.put(key, value);
		}
	}
1126401
protected void createGenericLoginSuccessEndState(final Flow flow) {
        val state = createEndState(flow, CasWebflowConstants.STATE_ID_VIEW_GENERIC_LOGIN_SUCCESS, CasWebflowConstants.VIEW_ID_GENERIC_SUCCESS);
        state.getEntryActionList().add(createEvaluateAction("genericSuccessViewAction"));
    }
947410
public void setViewEnabled(boolean enable) {
        if (enable && mView == null) {
            mView = makeView();
        }
        if (mView != null) {
            mView.setViewEnabled(enable);
        }
    }
1215840
public static void setRenderer(int type) {
		switch (type) {
			case IMMEDIATE_RENDERER:
				setRenderer(new ImmediateModeOGLRenderer());
				return;
			case VERTEX_ARRAY_RENDERER:
				setRenderer(new VAOGLRenderer());
				return;
		}
		
		throw new RuntimeException("Unknown renderer type: "+type);
	}
5221
@Nullable public <P> P getPresenter(@NonNull String viewId) {
    PresenterHolder holder = presenterMap.get(viewId);
    return holder == null ? null : (P) holder.presenter;
  }
1064617
void setState(TouchState newState) {
        if (MonocleSettings.settings.traceEvents) {
            MonocleTrace.traceEvent("Set %s", newState);
        }
        newState.sortPointsByID();
        newState.assignPrimaryID();
        // Get the cached window for the old state and compute the window for
        // the new state
        MonocleWindow oldWindow = state.getWindow(false, null);
        boolean recalculateWindow = state.getPointCount() == 0;
        MonocleWindow window = newState.getWindow(recalculateWindow, oldWindow);
        View oldView = oldWindow == null ? null : oldWindow.getView();
        View view = window == null ? null : window.getView();
        if (!newState.equalsSorted(state)) {
            // Post touch events
            if (view != oldView) {
                postTouchEvent(state, TouchEvent.TOUCH_RELEASED);
                postTouchEvent(newState,
                               TouchEvent.TOUCH_PRESSED);
            } else if (view != null) {
                postTouchEvent(window, view, newState);
            }
            // Post mouse events
            MouseInputSynthesizer.getInstance().setState(newState);
        }
        newState.copyTo(state);
        newState.clearWindow();
    }
1098002
def register_view(self, view):
        
        super(StateEditorController, self).register_view(view)
        view.prepare_the_labels()  # the preparation of the labels is done here to take into account plugin hook changes
        view['add_input_port_button'].connect('clicked', self.inputs_ctrl.on_add)
        view['add_output_port_button'].connect('clicked', self.outputs_ctrl.on_add)
        if isinstance(self.model, ContainerStateModel):
            view['add_scoped_variable_button'].connect('clicked', self.scopes_ctrl.on_add)

        view['remove_input_port_button'].connect('clicked', self.inputs_ctrl.on_remove)
        view['remove_output_port_button'].connect('clicked', self.outputs_ctrl.on_remove)
        if isinstance(self.model, ContainerStateModel):
            view['remove_scoped_variable_button'].connect('clicked', self.scopes_ctrl.on_remove)

        if isinstance(self.model, LibraryStateModel) or self.model.state.get_next_upper_library_root_state():
            view['add_input_port_button'].set_sensitive(False)
            view['remove_input_port_button'].set_sensitive(False)
            view['add_output_port_button'].set_sensitive(False)
            view['remove_output_port_button'].set_sensitive(False)
            view['add_scoped_variable_button'].set_sensitive(False)
            view['remove_scoped_variable_button'].set_sensitive(False)

        view.inputs_view.show()
        view.outputs_view.show()
        view.scopes_view.show()
        view.outcomes_view.show()
        view.transitions_view.show()
        view.data_flows_view.show()

        # show scoped variables if show content is enabled -> if disabled the tab stays and indicates a container state
        if isinstance(self.model, LibraryStateModel) and not self.model.show_content():
            view.scopes_view.hide()
            view.linkage_overview.scope_view.hide()

        # Container states do not have a source editor and library states does not show there source code
        # Thus, for those states we do not have to add the source controller and can hide the source code tab
        # logger.info("init state: {0}".format(model))
        lib_with_and_ES_as_root = isinstance(self.model, LibraryStateModel) and \
                                  not isinstance(self.model.state_copy, ContainerStateModel)
        if not isinstance(self.model, ContainerStateModel) and not isinstance(self.model, LibraryStateModel) or \
                lib_with_and_ES_as_root:
            view.source_view.show()
            if isinstance(self.model, LibraryStateModel) and not self.model.show_content():
                view.remove_source_tab()
            view.remove_scoped_variables_tab()
        else:
            view.scopes_view.show()
            if isinstance(self.model, LibraryStateModel) and \
                    (not self.model.show_content() or not isinstance(self.model.state_copy, ContainerStateModel)):
                view.remove_scoped_variables_tab()
            view.remove_source_tab()

        if global_gui_config.get_config_value("SEMANTIC_DATA_MODE", False):
            view.bring_tab_to_the_top('Semantic Data')
        else:
            if isinstance(self.model.state, LibraryState):
                view.bring_tab_to_the_top('Description')
            else:
                view.bring_tab_to_the_top('Linkage Overview')

        if isinstance(self.model, ContainerStateModel):
            self.scopes_ctrl.reload_scoped_variables_list_store()

        plugins.run_hook("post_state_editor_register_view", self)