Register view.

@param type the type
@param view the view
167271
public void registerView(final String type, final Pair<View, View> view) {
        registeredViews.put(type, view);
    }
104447
def register_view(self, view):
        """"""
        super(ScopedVariableListController, self).register_view(view)

        view['name_col'].add_attribute(view['name_text'], 'text', self.NAME_STORAGE_ID)
        if not isinstance(self.model.state, LibraryState) and self.model.state.get_next_upper_library_root_state() is None:
            view['name_text'].set_property("editable", True)
        view['data_type_col'].add_attribute(view['data_type_text'], 'text', self.DATA_TYPE_NAME_STORAGE_ID)
        if not isinstance(self.model.state, LibraryState) and self.model.state.get_next_upper_library_root_state() is None:
            view['data_type_text'].set_property("editable", True)
        if isinstance(view, ScopedVariablesListView):
            view['default_value_col'].add_attribute(view['default_value_text'], 'text', self.DEFAULT_VALUE_STORAGE_ID)
            if not isinstance(self.model.state, LibraryState) and self.model.state.get_next_upper_library_root_state() is None:
                view['default_value_text'].set_property("editable", True)
            self._apply_value_on_edited_and_focus_out(view['default_value_text'],
                                                      self.apply_new_scoped_variable_default_value)

        self._apply_value_on_edited_and_focus_out(view['name_text'], self.apply_new_scoped_variable_name)
        self._apply_value_on_edited_and_focus_out(view['data_type_text'], self.apply_new_scoped_variable_type)

        if isinstance(self.model, ContainerStateModel):
            self.reload_scoped_variables_list_store()
1318277
def register_view(self, view):
        """"""
        super(DataPortListController, self).register_view(view)

        view['name_col'].add_attribute(view['name_text'], 'text', self.NAME_STORAGE_ID)
        view['data_type_col'].add_attribute(view['data_type_text'], 'text', self.DATA_TYPE_NAME_STORAGE_ID)
        if not isinstance(self.model.state, LibraryState) and self.model.state.get_next_upper_library_root_state() is None:
            view['name_text'].set_property("editable", True)
            view['data_type_text'].set_property("editable", True)

        # in the linkage overview the the default value is not shown
        if isinstance(view, InputPortsListView) or isinstance(view, OutputPortsListView):
            view['default_value_col'].add_attribute(view['default_value_text'], 'text', self.DEFAULT_VALUE_STORAGE_ID)
            self._apply_value_on_edited_and_focus_out(view['default_value_text'], self._apply_new_data_port_default_value)
            view['default_value_col'].set_cell_data_func(view['default_value_text'],
                                                         self._default_value_cell_data_func)
            if isinstance(self.model.state, LibraryState):
                view['default_value_col'].set_title("Used value")
            if self.model.state.get_next_upper_library_root_state() is None:  # never enabled means it is disabled
                view['default_value_text'].set_property("editable", True)

        self._apply_value_on_edited_and_focus_out(view['name_text'], self._apply_new_data_port_name)
        self._apply_value_on_edited_and_focus_out(view['data_type_text'], self._apply_new_data_port_type)

        if isinstance(self.model.state, LibraryState):
            view['use_runtime_value_toggle'] = Gtk.CellRendererToggle()
            view['use_runtime_value_col'] = Gtk.TreeViewColumn("Use Runtime Value")
            view['use_runtime_value_col'].set_property("sizing", Gtk.TreeViewColumnSizing.AUTOSIZE)
            view.get_top_widget().append_column(view['use_runtime_value_col'])
            view['use_runtime_value_col'].pack_start(view['use_runtime_value_toggle'], True)
            view['use_runtime_value_col'].add_attribute(view['use_runtime_value_toggle'], 'active',
                                                        self.USE_RUNTIME_VALUE_STORAGE_ID)
            if self.model.state.get_next_upper_library_root_state() is None:
                view['use_runtime_value_toggle'].set_property("activatable", True)
                view['use_runtime_value_toggle'].connect("toggled", self.on_use_runtime_value_toggled)

        self._reload_data_port_list_store()
1020666
def register_view(self, view):
        """"""
        super(ListViewController, self).register_view(view)
        self.tree_view.connect('button_press_event', self.mouse_click)
1118345
def register_view(self, view):
        
        super(StateDataFlowsListController, self).register_view(view)

        def cell_text(column, cell_renderer, model, iter, container_model):
            df_id = model.get_value(iter, self.ID_STORAGE_ID)
            in_external = 'external' if model.get_value(iter, self.IS_EXTERNAL_STORAGE_ID) else 'internal'

            if column.get_title() == 'Source State':
                cell_renderer.set_property("model", self.tree_dict_combos[in_external][df_id]['from_state'])
                cell_renderer.set_property("text-column", 0)
                cell_renderer.set_property("has-entry", False)
            elif column.get_title() == 'Source Port':
                cell_renderer.set_property("model", self.tree_dict_combos[in_external][df_id]['from_key'])
                cell_renderer.set_property("text-column", 0)
                cell_renderer.set_property("has-entry", False)
            elif column.get_title() == 'Target State':
                cell_renderer.set_property("model", self.tree_dict_combos[in_external][df_id]['to_state'])
                cell_renderer.set_property("text-column", 0)
                cell_renderer.set_property("has-entry", False)
            elif column.get_title() == 'Target Port':
                cell_renderer.set_property("model", self.tree_dict_combos[in_external][df_id]['to_key'])
                cell_renderer.set_property("text-column", 0)
                cell_renderer.set_property("has-entry", False)
            else:
                logger.warning("Column has no cell_data_func %s %s" % (column.get_name(), column.get_title()))

        view['from_state_col'].set_cell_data_func(view['from_state_combo'], cell_text, self.model)
        view['to_state_col'].set_cell_data_func(view['to_state_combo'], cell_text, self.model)
        view['from_key_col'].set_cell_data_func(view['from_key_combo'], cell_text, self.model)
        view['to_key_col'].set_cell_data_func(view['to_key_combo'], cell_text, self.model)

        if self.model.state.get_next_upper_library_root_state():
            view['from_state_combo'].set_property("editable", False)
            view['from_key_combo'].set_property("editable", False)
            view['to_state_combo'].set_property("editable", False)
            view['to_key_combo'].set_property("editable", False)
        else:
            self.connect_signal(view['from_state_combo'], "edited", self.on_combo_changed_from_state)
            self.connect_signal(view['from_key_combo'], "edited", self.on_combo_changed_from_key)
            self.connect_signal(view['to_state_combo'], "edited", self.on_combo_changed_to_state)
            self.connect_signal(view['to_key_combo'], "edited", self.on_combo_changed_to_key)

        self.tree_view.connect("grab-focus", self.on_focus)
        self.update(initiator='"register view"')
569381
public <V extends View> void registerCell(String type, @NonNull Class<V> viewClz) {
        BaseCellBinderResolver baseCellBinderResolver = getService(BaseCellBinderResolver.class);
        MVHelper mMVHelper = getService(MVHelper.class);
        if (baseCellBinderResolver != null && mMVHelper != null && mMVHelper.resolver() != null) {
            baseCellBinderResolver.register(type, new BaseCellBinder<>(viewClz, mMVHelper));
            mMVHelper.resolver().register(type, viewClz);
        }

    }
328216
private void registerMethod(Class<?> type, Method method) {
    Class<?> returnType = method.getReturnType();
    if (returnType == void.class || returnType == Void.class) {
      registerVoidMethod(type, method);
    } else {
      registerValueMethod(type, method);
    }
  }
1286679
void register(String type, BiConsumer<ProtocolRequest, ServerConnection> handler) {
    handlers.put(type, handler);
  }
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)
679079
public <V extends View> void registerCell(String type,
        @NonNull Class<? extends BaseCell> cellClz, @NonNull Class<V> viewClz) {
        registerCell(type, viewClz);
        MVHelper mMVHelper = getService(MVHelper.class);
        if (mMVHelper != null && mMVHelper.resolver() != null) {
            mMVHelper.resolver().registerCompatible(type, cellClz);
        }
    }
595428
def register_view(self, view):
        """"""
        cb = self.view['cb_currency']
        cb.set_model(self.model.currencies)
        cell = gtk.CellRendererText()
        cb.pack_start(cell, True)
        
        def on_cell_data(cb, cell, mod, it):
            if mod[it][0]: cell.set_property('text', mod[it][0].name)
            return

        cb.set_cell_data_func(cell, on_cell_data)
        return
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)
1297264
public static void register(String type, String local, String alias) {
        instance.get(type).register(local, alias);
    }
1149490
public void setEmptyView(View emptyView){
        if(this.emptyView != null){
            unregisterAdapterDataObserver(mEmptyObserver);
        }
        this.emptyView = emptyView;
        registerAdapterDataObserver(mEmptyObserver);
    }
1320560
public static void typeface(View view, TypefaceCollection typefaceCollection) {

		if (view instanceof ViewGroup) {
			applyTypeface((ViewGroup) view, typefaceCollection);
		} else {
			applyForView(view, typefaceCollection);
		}
	}
150668
protected static <T> T checkType(String view, String attribute, Object value, Class<T> type) {
    checkNotNull(value);
    if (type.isInstance(value)) {
      return type.cast(value);
    }

    throw invalidType(view, attribute, value, type);
  }
893095
synchronized void registerView(View view, Clock clock) {
    exportedViews = null;
    View existing = registeredViews.get(view.getName());
    if (existing != null) {
      if (existing.equals(view)) {
        // Ignore views that are already registered.
        return;
      } else {
        throw new IllegalArgumentException(
            "A different view with the same name is already registered: " + existing);
      }
    }
    Measure measure = view.getMeasure();
    Measure registeredMeasure = registeredMeasures.get(measure.getName());
    if (registeredMeasure != null && !registeredMeasure.equals(measure)) {
      throw new IllegalArgumentException(
          "A different measure with the same name is already registered: " + registeredMeasure);
    }
    registeredViews.put(view.getName(), view);
    if (registeredMeasure == null) {
      registeredMeasures.put(measure.getName(), measure);
    }
    Timestamp now = clock.now();
    mutableMap.put(view.getMeasure().getName(), MutableViewData.create(view, now));
  }