Instantiate a HiGlass display with the given views
185459
def display(views, location_sync=[], zoom_sync=[], host='localhost', server_port=None):
    '''
    
    '''
    from .server import Server
    from .client import ViewConf
    tilesets = []

    for view in views:
        for track in view.tracks:
            if track.tracks:
                for track1 in track.tracks:
                    if track1.tileset:
                        tilesets += [track1.tileset]

            if track.tileset:
                tilesets += [track.tileset]
    print("tilesets:", tilesets)

    server = Server(tilesets, host=host, port=server_port)
    server.start()

    for view in views:
        for track in view.tracks:
            if track.tracks:
                for track1 in track.tracks:
                    if ('server' not in track1.viewconf or 
                            track1.viewconf['server'] is None):
                        track1.viewconf['server'] = server.api_address
            else:
                if ('server' not in track.viewconf or 
                        track.viewconf['server'] is None):
                    track.viewconf['server'] = server.api_address


    conf = ViewConf(views, location_syncs=location_syncs,
        zoom_syncs=zoom_syncs)

    return (HiGlassDisplay(viewconf=conf.to_dict()), server, conf)
1369383
function getView(app, view) {
    if (typeof view !== 'string') {
      return view;
    }
    if (app.isCollection) {
      view = app.getView(view);

    } else if (app.isList) {
      view = app.getItem(view);

    } else {
      view = findView(app, view);
    }
    return view;
  }
286235
def register_view(self, view):
        """"""
        super(PreferencesWindowController, self).register_view(view)
        self.view['add_library_button'].connect('clicked', self._on_add_library)
        self.view["remove_library_button"].connect('clicked', self._on_remove_library)

        self.view['config_tree_view'].connect("button_press_event", self._on_row_clicked_trigger_toggle_of_boolean,
                                              self.core_config_model, self.core_list_store)
        self.view['gui_tree_view'].connect("button_press_event", self._on_row_clicked_trigger_toggle_of_boolean,
                                           self.gui_config_model, self.gui_list_store)

        self.view['core_config_value_renderer'].set_property('editable', True)
        self.view['core_config_value_renderer'].connect('edited', self._on_config_value_changed, self.core_config_model,
                                                        self.core_list_store)

        self.view['gui_config_value_renderer'].set_property('editable', True)
        self.view['gui_config_value_renderer'].connect('edited', self._on_config_value_changed, self.gui_config_model,
                                                       self.gui_list_store)

        self.view['shortcut_config_value_renderer'].set_property('editable', True)
        self.view['shortcut_config_value_renderer'].connect('edited', self._on_shortcut_changed)

        self.view['library_config_key_renderer'].set_property('editable', True)
        self.view['library_config_key_renderer'].connect('edited', self._on_library_name_changed)

        self.view['library_config_value_renderer'].set_property('editable', True)
        self.view['library_config_value_renderer'].connect('edited', self._on_library_path_changed)

        self.view['config_tree_view'].set_model(self.core_list_store)
        self.view['library_tree_view'].set_model(self.library_list_store)
        self.view['gui_tree_view'].set_model(self.gui_list_store)
        self.view['shortcut_tree_view'].set_model(self.shortcut_list_store)

        self.view['apply_button'].connect("clicked", self._on_apply_button_clicked)
        self.view['ok_button'].connect('clicked', self._on_ok_button_clicked)
        self.view['cancel_button'].connect('clicked', self._on_cancel_button_clicked)

        self.view['import_button'].connect("clicked", self._on_import_config)
        self.view['export_button'].connect('clicked', self._on_export_config)

        self.view['preferences_window'].connect('delete_event', self._on_delete_event)

        self.update_all()
1344723
function createEmbeddedViewNode(tView, context, renderer, queries) {
    var _isParent = isParent;
    var _previousOrParentNode = previousOrParentNode;
    isParent = true;
    previousOrParentNode = null;
    var lView = createLViewData(renderer, tView, context, 2 /* CheckAlways */, getCurrentSanitizer());
    if (queries) {
        lView[QUERIES] = queries.createView();
    }
    var viewNode = createLNode(-1, 2 /* View */, null, null, null, lView);
    isParent = _isParent;
    previousOrParentNode = _previousOrParentNode;
    return viewNode;
}
828169
def create_view_from_dict(name, spec, template=None, cls=ActionsView):
    
    kwargs = dict(spec)
    if template is not None:
        kwargs.setdefault("template", template)
    actions = load_grouped_actions(kwargs, pop_keys=True)
    view = cls(name=name, **kwargs)
    if isinstance(view, ActionsView):
        view.actions.extend(actions)
    return view
1263149
public void activateView(){
		if(SwingUtilities.isEventDispatchThread()){
			ValkyrieRepository.getInstance().getApplicationConfig().windowManager().getActiveWindow().getPage().showView(getId());
		}
		else{
			SwingUtilities.invokeLater(new Runnable(){
				public void run() {
                    ValkyrieRepository.getInstance().getApplicationConfig().windowManager().getActiveWindow().getPage().showView(getId());
				}
				
			});
		}
	}
633328
function implicit_views(g, options) {
    var default_view = options.default_view || 'table';

    var leaves = g.get_leaves();
    var table;
    _.each(leaves, function(node) {
        if (!is_sink(node)) {
            table = g.add_node('View', default_view);
            g.add_edge(node, table);
        }
    });
}
1012634
static void createView(Map<String, MapReduce> views, String columnName, List<String> columns)
    {
        Iterator<String> iterator = columns.iterator();

        MapReduce mapr = new MapReduce();
        StringBuilder mapBuilder = new StringBuilder();
        StringBuilder ifBuilder = new StringBuilder("function(doc){if(");
        StringBuilder emitFunction = new StringBuilder("{emit(");
        if (columns != null && columns.size() > 1)
        {
            emitFunction.append("[");
        }
        while (iterator.hasNext())
        {
            String nextToken = iterator.next();
            ifBuilder.append("doc." + nextToken);
            ifBuilder.append(" && ");
            emitFunction.append("doc." + nextToken);
            emitFunction.append(",");
        }
        ifBuilder.delete(ifBuilder.toString().lastIndexOf(" && "), ifBuilder.toString().lastIndexOf(" && ") + 3);
        emitFunction.deleteCharAt(emitFunction.toString().lastIndexOf(","));

        ifBuilder.append(")");
        if (columns != null && columns.size() > 1)
        {
            emitFunction.append("]");
        }
        emitFunction.append(", doc)}}");

        mapBuilder.append(ifBuilder.toString()).append(emitFunction.toString());

        mapr.setMap(mapBuilder.toString());
        views.put(columnName, mapr);
    }
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()
189390
def access_view(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('access:view', **{
        'unicorn': ctx.repo.create_secure_service('unicorn'),
        'service': name,
    })
702585
def create_default_views(self, create_datastore_views=False):
        # type: (bool) -> None
        
        package = deepcopy(self.data)
        if self.resources:
            package['resources'] = self._convert_hdxobjects(self.resources)

        data = {'package': package, 'create_datastore_views': create_datastore_views}
        self._write_to_hdx('create_default_views', data, 'package')
217701
function(viewClass) {
      var t = this,
          newIdNum = 1,
          components = t.get('components'),
          classParts = viewClass.split('.'),
          appName = classParts[0],
          appView = classParts[1];

      // Instantiate and add the component
      var component = new Component({
        id: Monitor.generateUniqueCollectionId(components, 'c'),
        viewClass: viewClass,
        viewOptions: UI.app[appName][appView].prototype.defaultOptions,
        css: {
          '.nm-cv': 'top:10px;'
        }
      });
      components.add(component);
      return component;
    }
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)
174060
function View(attrs) {
  var view = this;
  if (typeof attrs !== 'undefined') {
    Object.keys(attrs).forEach(function (attr) {
      view[attr] = attrs[attr];
    });
  }
  if (typeof this.initialize === 'function')
    this.initialize();
}
663584
def process_views(self):
        """"""
        output = {}
        logger.debug("Processing %d view(s)...", len(self.views))
        for view_name, view in iteritems(self.views):
            try:
                output = deep_merge_dict(
                    output,
                    view.process(
                        self.db,
                        safe_mode=self.safe_mode,
                        extra_context=self.project_context
                    )
                )
            except StatikError as exc:
                # just re-raise it
                raise exc

            except Exception as exc:
                # for unhandled view-related exceptions, raise our own exception
                raise ViewError(
                    message="Failed to render view \"%s\"." % view_name,
                    orig_exc=exc
                )

        return output
628439
private void initView(){
        LinearLayout mProgressContainer = (LinearLayout) mLayout.findViewById(R.id.progress_container);

        int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, mLayout.getResources().getDisplayMetrics());
        mLayout.setPadding(padding, padding, padding, padding);

        // Based on configuration from Builder, construct the Layout
        switch (mProgressStyle){
            case HORIZONTAL:
                mProgress = new ProgressBar(mCtx, null, android.R.attr.progressBarStyleHorizontal);
                break;
            case SMALL:
                mIsIndeterminate = true;
                mProgressText.setVisibility(View.GONE);
                mProgressMax.setVisibility(View.GONE);
                mProgress = new ProgressBar(mCtx, null, android.R.attr.progressBarStyleSmall);
                break;
            case NORMAL:
                mIsIndeterminate = true;
                mProgressText.setVisibility(View.GONE);
                mProgressMax.setVisibility(View.GONE);
                mProgress = new ProgressBar(mCtx);
                break;
            case LARGE:
                mIsIndeterminate = true;
                mProgressText.setVisibility(View.GONE);
                mProgressMax.setVisibility(View.GONE);
                mProgress = new ProgressBar(mCtx, null, android.R.attr.progressBarStyleLarge);
                break;
        }

        // The ProgressBar parameters
        LinearLayout.LayoutParams progressParams;

        // Generate the message parameters
        int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, mCtx.getResources().getDisplayMetrics());
        LinearLayout.LayoutParams messageParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT);
        messageParams.weight = 1f;
        messageParams.gravity = Gravity.CENTER_VERTICAL;
        messageParams.setMargins(margin, 0, margin, 0);

        // Now based on the provided message content, change up hte LayoutParameters of the progresses
        if(mProgressStyle == HORIZONTAL){
            progressParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        }else{
            if(mMessage != null){
                progressParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            }else{
                progressParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            }
        }

        Log.d("ProgressStyle", "Setting ProgressBar LayoutParams(" + progressParams.width + "," + progressParams.height + ")");

        // Add the stylized progress bar to the layout
        mProgress.setLayoutParams(progressParams);
        mProgressContainer.addView(mProgress);

        // If the message isn't null, and it's not the progress style
        if(mMessage != null && mProgressStyle != HORIZONTAL){

            // Create and add the text view
            TextView message = new TextView(mCtx);
            message.setId(R.id.progress_mesage);
            FontLoader.applyTypeface(message, Types.ROBOTO_REGULAR);
            message.setText(mMessage);

            // Add this to the layout
            mProgressContainer.addView(message, messageParams);
        }

        // Now based on other attributes style the progressBar
        if(mProgressStyle == HORIZONTAL) {
            if (mIsIndeterminate) {
                Log.d(ProgressStyle.class.getName(), "Setting Indeterminate for Horizontal ProgressStyle");

                // Update the ProgressBar
                mProgress.setIndeterminate(true);

                // Hide the auxillary text
                mProgressText.setVisibility(View.GONE);
                mProgressMax.setVisibility(View.GONE);

            } else {
                Log.d(ProgressStyle.class.getName(), "Setting Progress for Horizontal ProgressStyle");

                // Only if the progress style is horizontal, should
                // we attempt to set the progress and max
                mProgress.setIndeterminate(false);
                setProgress(mInitProgress);
                setMax(mInitMax);

            }
        }
    }
814393
def register_view(self, view):
        """"""
        self.measure_to_view_map.register_view(view=view, timestamp=self.time)