Opens the first level in the categories tree.<p>
5237
public void openFirstLevel() {

        if (!m_categories.isEmpty()) {
            for (int i = 0; i < m_scrollList.getWidgetCount(); i++) {
                CmsTreeItem item = (CmsTreeItem)m_scrollList.getItem(i);
                item.setOpen(true);
            }
        }
    }
326519
private void open() {
    // Load existing log segments from disk.
    for (Segment segment : loadSegments()) {
      segments.put(segment.descriptor().index(), segment);
    }

    // If a segment doesn't already exist, create an initial segment starting at index 1.
    if (!segments.isEmpty()) {
      currentSegment = segments.lastEntry().getValue();
    } else {
      SegmentDescriptor descriptor = SegmentDescriptor.builder()
        .withId(1)
        .withVersion(1)
        .withIndex(1)
        .withMaxSegmentSize(storage.maxSegmentSize())
        .withMaxEntries(storage.maxEntriesPerSegment())
        .build();

      descriptor.lock();

      currentSegment = createSegment(descriptor);
      currentSegment.descriptor().update(System.currentTimeMillis());
      currentSegment.descriptor().lock();

      segments.put(1L, currentSegment);
    }
  }
894758
public void updateContentList(List<CmsCategoryBean> categoriesBeans, List<String> selectedCategories) {

        clearList();
        if (m_categories == null) {
            m_categories = new HashMap<String, CmsCategoryBean>();
        }
        if ((categoriesBeans != null) && !categoriesBeans.isEmpty()) {
            for (CmsCategoryBean categoryBean : categoriesBeans) {
                m_categories.put(categoryBean.getPath(), categoryBean);
                // set the list item widget
                CmsDataValue dataValue = new CmsDataValue(
                    600,
                    3,
                    CmsCategoryBean.SMALL_ICON_CLASSES,
                    categoryBean.getTitle(),
                    CmsStringUtil.isNotEmptyOrWhitespaceOnly(categoryBean.getDescription())
                    ? categoryBean.getDescription()
                    : categoryBean.getPath());
                // the checkbox
                CmsCheckBox checkBox = new CmsCheckBox();
                if ((selectedCategories != null) && selectedCategories.contains(categoryBean.getPath())) {
                    checkBox.setChecked(true);
                }
                SelectionHandler selectionHandler = new SelectionHandler(categoryBean.getPath(), checkBox);
                checkBox.addClickHandler(selectionHandler);
                dataValue.addClickHandler(selectionHandler);
                dataValue.setUnselectable();
                // set the category list item and add to list
                CmsTreeItem listItem = new CmsTreeItem(false, checkBox, dataValue);
                listItem.setSmallView(true);
                listItem.setId(categoryBean.getPath());
                addWidgetToList(listItem);
            }
        } else {
            showIsEmptyLabel();
        }
    }
446447
private void openItemsOnPath(String path) {

        List<CmsSitemapTreeItem> itemsOnPath = getItemsOnPath(path);
        for (CmsSitemapTreeItem item : itemsOnPath) {
            item.setOpen(true);
        }
    }
431043
private void addFirstChildElements() {
		for (Node node : nodes) {
			Index index = helper.getIndexInParent(node, false);
			if (index.index == 0)
				result.add(node);
		}
	}
652521
private void openSubMenu() {

        if (isEnabled() && hasSubMenu() && !m_subMenu.isShowing()) {
            m_overlay.closeSubMenus();

            setFocus(false);
            addStyleName("v-context-menu-item-basic-open");
            m_subMenu.openNextTo(this);
        }
    }
694537
function _getOpenNodes(treeData, projectRootPath) {
        var openNodes = [];

        function addNodesAtDepth(treeData, parent, depth) {
            if (!treeData) {
                return;
            }

            treeData.forEach(function (value, key) {
                if (isFile(value)) {
                    return;
                }

                var directoryPath = parent + key + "/";

                if (value.get("open")) {
                    var nodeList = openNodes[depth];
                    if (!nodeList) {
                        nodeList = openNodes[depth] = [];
                    }
                    nodeList.push(directoryPath);
                    addNodesAtDepth(value.get("children"), directoryPath, depth + 1);
                }
            });
        }

        // start at the top of the tree and the first array element
        addNodesAtDepth(treeData, projectRootPath, 0);
        return openNodes;
    }
613784
protected void createDefaultLevels() {
        this.listLevels = new ArrayList();	// listlevels
        for(int i=0; i<=8; i++) {
            // create a list level
            RtfListLevel ll = new RtfListLevel(this.document);
            ll.setListType(RtfListLevel.LIST_TYPE_NUMBERED);
        	ll.setFirstIndent(0);
        	ll.setLeftIndent(0);
        	ll.setLevelTextNumber(i);
            ll.setTentative(true);
            ll.correctIndentation();
            this.listLevels.add(ll);
        }

    }
1196165
private static void displayCategories(List<CategoryNode> categories, String prefix) {
    for (CategoryNode category : categories) {
      System.out.printf("%s%s [%s]%n", prefix, category.name, category.id);
      displayCategories(category.children, String.format("%s%s > ", prefix, category.name));
    }
  }
832691
private void loadCategories(Connection conn) throws UnknownPoiCategoryException {
        // Maximum ID (for root node)
        int maxID = 0;

        // Maps categories to their parent IDs
        Map<PoiCategory, Integer> parentMap = new HashMap<>();

        PreparedStatement stmt = null;
        ResultSet rs = null;
        try {
            stmt = conn.prepareStatement(SELECT_STATEMENT);
            rs = stmt.executeQuery();
            while (rs.next()) {
                // Column values
                int categoryID = rs.getInt(1);
                String categoryTitle = rs.getString(2);
                int categoryParentID = rs.getInt(3);

                PoiCategory pc = new DoubleLinkedPoiCategory(categoryTitle, null, categoryID);
                this.categoryMap.put(categoryID, pc);

                // category --> parent ID
                parentMap.put(pc, categoryParentID);

                // check for root node
                if (categoryID > maxID) {
                    maxID = categoryID;
                }
            }
        } catch (SQLException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
        } finally {
            try {
                if (rs != null) {
                    rs.close();
                }
                if (stmt != null) {
                    stmt.close();
                }
            } catch (SQLException e) {
                LOGGER.log(Level.SEVERE, e.getMessage(), e);
            }
        }

        // Set root category and remove it from parents map
        this.rootCategory = getPoiCategoryByID(maxID);
        parentMap.remove(this.rootCategory);

        // Assign parent categories
        for (PoiCategory c : parentMap.keySet()) {
            c.setParent(getPoiCategoryByID(parentMap.get(c)));
        }
    }
1187794
public void initialize(CmsResourceCategoryInfo categoryInfo) {

        m_initializing = false;
        m_initialized = true;
        m_main.add(new CmsListItemWidget(categoryInfo.getResourceInfo()));
        m_categoryTree = new CmsCategoryTree(
            categoryInfo.getCurrentCategories(),
            300,
            false,
            categoryInfo.getCategoryTree(),
            m_collapsed);
        m_categoryTree.addValueChangeHandler(new ValueChangeHandler<List<String>>() {

            public void onValueChange(ValueChangeEvent<List<String>> event) {

                setChanged();
            }
        });
        m_main.add(m_categoryTree);
        m_categoryTree.truncate("CATEGORIES", WIDE_WIDTH - 20);
        LockIcon lock = categoryInfo.getResourceInfo().getLockIcon();
        if ((lock == null)
            || lock.equals(LockIcon.NONE)
            || lock.equals(LockIcon.OPEN)
            || lock.equals(LockIcon.SHARED_OPEN)) {
            m_saveButton.disable(Messages.get().key(Messages.GUI_NOTHING_CHANGED_0));
        } else {
            m_categoryTree.disable(Messages.get().key(Messages.GUI_RESOURCE_LOCKED_0));
            m_saveButton.disable(Messages.get().key(Messages.GUI_RESOURCE_LOCKED_0));
        }
        setWidth(WIDE_WIDTH);
        if (isShowing()) {
            center();
        }
    }
970244
public void openCategories(CmsResource resource) {

        getRpcProxy(I_CmsGwtDialogClientRpc.class).openCategoriesDialog(
            resource.getStructureId().toString(),
            OpenCms.getWorkplaceManager().isDisplayCategorySelectionCollapsed());
    }
949651
public void loadCategories(final boolean openLocalCategories, final CmsUUID openItemId) {

        CmsRpcAction<CmsSitemapCategoryData> action = new CmsRpcAction<CmsSitemapCategoryData>() {

            @Override
            public void execute() {

                start(200, false);
                getService().getCategoryData(getEntryPoint(), this);
            }

            @Override
            protected void onResponse(CmsSitemapCategoryData result) {

                stop(false);
                m_categoryData = result;
                CmsSitemapView.getInstance().displayCategoryData(result, openLocalCategories, openItemId);
            }
        };
        action.execute();
    }
976235
private void normalizeSelectedCategories() {

        Collection<String> normalizedCategories = new ArrayList<String>(m_selectedCategories.size());
        for (CmsTreeItem item : m_categories.values()) {
            if (item.getCheckBox().isChecked()) {
                normalizedCategories.add(item.getId());
            }
        }
        m_selectedCategories = normalizedCategories;

    }
31813
private void showIsEmptyLabel() {

        Label isEmptyLabel = new Label(Messages.get().key(Messages.GUI_TAB_CATEGORIES_IS_EMPTY_0));
        CmsTreeItem treeItem = new CmsTreeItem(false, isEmptyLabel);
        treeItem.setSmallView(true);
        m_scrollList.add(treeItem);
    }
1124742
private function startList()
    {
        $this->depth++;

        $values = $this->result->createElement('values');

        // set the key, if applicable
        if (null !== ($key = $this->key())) {
            $values->setAttribute('key', $key);
        }

        $this->current->appendChild($values);

        $this->references[] = $this->current;
        $this->current = $values;
    }
159466
void readTreeLevel(CmsUUID parentId, String openPathFragment) {

        CmsObject cms = A_CmsUI.getCmsObject();
        boolean openedFragment = false;
        try {
            CmsResource parent = cms.readResource(parentId, CmsResourceFilter.IGNORE_EXPIRATION);
            String folderPath = cms.getSitePath(parent);
            List<CmsResource> folderResources = cms.readResources(folderPath, FOLDERS, false);

            // sets the parent to leaf mode, in case no child folders are present
            m_treeContainer.setChildrenAllowed(parentId, !folderResources.isEmpty());

            for (CmsResource resource : folderResources) {
                addTreeItem(cms, resource, parentId, false, m_treeContainer);
                openedFragment = openedFragment || resource.getName().equals(openPathFragment);
            }
            if (!openedFragment && (openPathFragment != null)) {
                CmsResource resource = cms.readResource(
                    CmsStringUtil.joinPaths(folderPath, openPathFragment),
                    CmsResourceFilter.IGNORE_EXPIRATION);
                addTreeItem(cms, resource, parentId, true, m_treeContainer);
            }

            m_fileTree.markAsDirtyRecursive();
        } catch (CmsException e) {
            CmsErrorDialog.showErrorDialog(e);
            LOG.error(e.getLocalizedMessage(), e);
        }
    }