Displays a list of items of the given type.
550273
public function actionIndex()
    {
        $dataProvider = new AuthItemDataProvider();
        $dataProvider->type = $this->type;

        $this->render(
            'index',
            array(
                'dataProvider' => $dataProvider,
            )
        );
    }
218044
def _showItemContextMenu(self, item, point, col):
        """"""
        menu = getattr(item, '_menu', None)
        if menu:
            settitle = getattr(item, '_set_menu_title', None)
            if settitle:
                settitle()
            # self._current_item tells callbacks what item the menu was referring to
            point = self.etw.mapToGlobal(point)
            self._current_item = item
            self.etw.clearSelection()
            self.etw.setItemSelected(item, True)
            menu.exec_(point)
        else:
            self._current_item = None
752124
def show_type(cls, result):
        
        if result.ok:
            return ' :: '.join([result.expr, result.type])
        return result.value
403474
@Override
    public String display(Type type, Object value, Map parameters)
    {
        return display(type, value, parameters, "view");
    }
91142
public static function listy($items, $attribs = array(), $type = 'ul')
    {
        if (!Arr::iterable($items)) {
            return '';
        }
        
        $htmls = array();
        $htmls[] = '<' . $type . self::attribs($attribs) . '>';
        foreach ($items as $item) {
            $htmls[] = '<li>' . $item . '</li>';
        }
        $htmls[] = '</' . $type . '>';
        return join("\n", $htmls);
    }
470047
public function ListingItems()
    {
        // need to get the items being listed
        $source = $this->getListingSource();

        $listType = $this->ListType ? $this->ListType : 'Page';

        $filter = array();

        $objFields = $this->getSelectableFields($listType);

        if ($source) {
            $ids = $this->getIdsFrom($source, 1);
            $ids[] = $source->ID;

            if (isset($objFields['ParentID']) && count($ids)) {
                $filter['ParentID'] = $ids;
            }
        }

        if ($this->StrictType) {
            $filter['ClassName'] = $listType;
        }

        $sortDir = $this->SortDir == 'Ascending' ? 'ASC' : 'DESC';
        $sort = $this->SortBy && isset($objFields[$this->SortBy]) ? $this->SortBy : 'Title';
        $req = Controller::has_curr() ? Controller::curr()->getRequest() : null;

        if (strlen($this->CustomSort) && $req) {
            $sortField = $req->getVar($this->CustomSort);
            if ($sortField) {
                $sort = isset($objFields[$sortField]) ? $sortField : $sort;
                $sortDir = $req->getVar($this->CustomSort . '_dir');
                $sortDir = $sortDir === 'asc' ? 'ASC' : 'DESC';
            }
        }

        // Bind these variables into the current page object because the
        // template may want to read them out after.
        //
        // - nyeholt 2017-12-19
        $this->CurrentSort = $sort;
        $this->CurrentDir = $sortDir;
        $this->CurrentSource = $source;
        $this->CurrentLink = $req ? $req->getURL() : $this->Link();

        // $sort = $this->CustomSort ? $this->CustomSort : $sort;
        $sort .= ' ' . $sortDir;

        $limit = '';

        $pageUrlVar = 'page' . $this->ID;

        $items = DataList::create($listType)->filter($filter)->sort($sort);

        if ($this->PerPage) {
            $page = isset($_REQUEST[$pageUrlVar]) ? (int) $_REQUEST[$pageUrlVar] : 0;
            $items  = $items->limit($this->PerPage, $page);
        }
        if ($this->ComponentFilterName) {
            $controller = (Controller::has_curr()) ? Controller::curr() : null;
            $tags = array();
            if ($controller && $controller instanceof ListingPageController) {
                $tagName = $controller->getRequest()->latestParam('Action');
                if ($tagName) {
                    $tags = $this->ComponentListingItems();
                    $tags = $tags->filter(array($this->ComponentFilterColumn => $tagName));
                    $tags = $tags->toArray();
                    if (!$tags) {
                        // Workaround cms/#1045
                        // - Stop infinite redirect
                        // @see: https://github.com/silverstripe/silverstripe-cms/issues/1045
                        unset($controller->extension_instances['OldPageRedirector']);

                        return $controller->httpError(404);
                    }
                }
            }

            if ($tags) {
                if (count($tags) > 1) {
                    return $controller->httpError(500, 'ComponentFilterColumn provided is not unique. ' . count($tags) . ' matches found in query.');
                }
                $tag = reset($tags);
                $tagComponent = DataObject::getSchema()->manyManyComponent($this->ListType, $this->ComponentFilterName);
                $parentClass = ClassInfo::shortName($tagComponent['parentClass']);
                $items = $items->innerJoin(
                    $tagComponent['join'],
                    "\"{$tagComponent['parentField']}\" = \"$parentClass\".\"ID\" AND \"{$tagComponent['childField']}\" = " . (int)$tag->ID
                );
            } else {
                $tags = new ArrayList();
            }
        }

        $this->extend('updateListingItems', $items);

        $newList = ArrayList::create();
        if ($items) {
            $newList = PaginatedList::create($items);
            // ensure the 0 limit is applied if configured as such
            $newList->setPageLength($this->PerPage);
            $newList->setPaginationGetVar($pageUrlVar);
            if ($items instanceof DataList) {
                $newList->setPaginationFromQuery($items->dataQuery()->query());
            }
        }

        return $newList;
    }
612616
private static void addTypeToList(Type type, List<Type> typeList) {
        if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;
            addTypeToList(parameterizedType.getRawType(), typeList);
            for (Type actualTypeArgument : parameterizedType.getActualTypeArguments()) {
                addTypeToList(actualTypeArgument, typeList);
            }
        } else {
            typeList.add(type);
        }
    }
427407
def show_some(items:Collection, n_max:int=5, sep:str=','):
    ""
    if items is None or len(items) == 0: return ''
    res = sep.join([f'{o}' for o in items[:n_max]])
    if len(items) > n_max: res += '...'
    return res
298239
def ListOf(cls, **kwargs):
    """"""

    def _list_load(value):
        return [cls.load(d) for d in value]

    return Property(types=list, load=_list_load, default=list, **kwargs)
1004634
def display_set(self, typ, data, columns):
        
        self.display_section("%s (%d)" % (self._get_name(typ), len(data)))
        headers = tuple(map(self._get_name, columns))
        fmt = self.mk_set_headers(data, columns)
        self.display_headers(fmt, headers)

        for each in data:
            row = tuple(self._get_val(each, k) for k, v in each.items())
            self._print(fmt % row)

        self._print("\n")
494409
function(list, cb) {
                // Normal arrays don't get live updated
                if (can.isArray(list)) {
                    this.list(list, cb);
                } else {
                    can.view.lists(list, cb);
                }
            }
273682
def show_item_dict(self, item):
        """"""
        d = {}
        for col in self.show_columns:
            v = getattr(item, col)
            if not isinstance(v, (int, float, string_types)):
                v = str(v)
            d[col] = v
        return d
298845
def items(self):
        """"""
        if self.scraper.current_item is not self:
            self._move_here()

        if self._items is None:
            self._items = ItemList()
            self._items.scraper = self.scraper
            self._items.collection = self
            for i in self.scraper._fetch_itemslist(self):
                i.parent = self
                if i.type == TYPE_DATASET and i.dialect is None:
                    i.dialect = self.scraper.dialect
                self._items.append(i)
        return self._items
1001573
public void displayInfo (String bundle, String message, String localtype)
    {
        displaySystem(bundle, message, SystemMessage.INFO, localtype);
    }
1016908
def display(self):
        """"""
        #Finding the maximum length for each column
        sym_name = "Symbol name"
        sym_len = max(max(len(i.name) for i in self.table),len(sym_name))
        kind_name = "Kind"
        kind_len = max(max(len(SharedData.KINDS[i.kind]) for i in self.table),len(kind_name))
        type_name = "Type"
        type_len = max(max(len(SharedData.TYPES[i.type]) for i in self.table),len(type_name))
        attr_name = "Attribute"
        attr_len = max(max(len(i.attribute_str()) for i in self.table),len(attr_name))
        #print table header
        print("{0:3s} | {1:^{2}s} | {3:^{4}s} | {5:^{6}s} | {7:^{8}} | {9:s}".format(" No", sym_name, sym_len, kind_name, kind_len, type_name, type_len, attr_name, attr_len, "Parameters"))
        print("-----------------------------" + "-" * (sym_len + kind_len + type_len + attr_len))
        #print symbol table
        for i,sym in enumerate(self.table):
            parameters = ""
            for p in sym.param_types:
                if parameters == "":
                    parameters = "{0}".format(SharedData.TYPES[p])
                else:
                    parameters += ", {0}".format(SharedData.TYPES[p])
            print("{0:3d} | {1:^{2}s} | {3:^{4}s} | {5:^{6}s} | {7:^{8}} | ({9})".format(i, sym.name, sym_len, SharedData.KINDS[sym.kind], kind_len, SharedData.TYPES[sym.type], type_len, sym.attribute_str(), attr_len, parameters))
485005
def show_item(h):
    
    if isinstance(h, rf.Rar3Info):
        show_item_v3(h)
    elif isinstance(h, rf.Rar5Info):
        show_item_v5(h)
    else:
        xprint('Unknown info record')
322602
def data_items(self) -> typing.List[DataItem]:
        
        return [DataItem(data_item) for data_item in self.__document_model.data_items]