Next: , Previous: Visiting tags, Up: The Methods window

6.6.2 Explicit and automatic expanding of the ECB-methods-buffer Explicit expanding all nodes to a certain expansion level

With the command ecb-expand-methods-nodes (bound to C-c . x) you can get a fast overlook of the contents of the source-buffer, because this command allows precisely expanding all tags with a certain indentation-level. So you can either expand no tags (or with other words collapse all tags) or expand all tags so see the contents of a buffer at one glance. Or you can expand exactly that tags of a certain indentation level.

Which node-types are expanded (rsp. collapsed) by this command depends for semantic-sources on the options ecb-methods-nodes-expand-spec and ecb-methods-nodes-collapse-spec! For non-semantic-sources always all node-types are expanded/collapsed, i.e. the two options above takes no effect for these files. Explicit expanding of the current node to a certain level

With the popup-menu of the methods-buffer an even more precise expansion is possible because it allows not only expanding all tags (see above) but offers in addition expanding only the current-node (for which the menu was activated) to an exact level of expansion:

All menu-entries are label with an expansion-“level” whereas level specifies precisely which level of nodes should be expanded. level means the indentation-level of the NODE itself and its (recursive) subnodes relative to the NODE itself.

So a level value X means that all (sub)nodes with an indentation-level <= X relative to NODE are expanded and all other are collapsed.


Expanding the current node with the popup-menu ignores the settings in the options ecb-methods-nodes-expand-spec and ecb-methods-nodes-collapse-spec! Automatic expansion ot tags after buffer-parsing

With the option ecb-show-tags you tell ECB how to display tags of a certain tag-class (see Customizing the display). Among other things you can tell ECB that a certain tag-class should be combined under an expanded or collapsed bucket-node. But such a setting defines the expansion-state of such a bucket-node only direct afterwards the buffer has been (re)parsed, which can occur after opening a file, after autom. reparsing the buffer via semantic or after manually rebuilding the methods-buffer of ECB.

The tag-class type (classes, interfaces, enumerations etc.) is divided into several subtypes by semantic. The subtypes are strings which names exactly if the tag with tag-class type is a class, an interface, an enumeration, a typedef etc. With the option ecb-type-tag-expansion you can tell ECB if these type-tags should be autom. expanded after (reparsing) a buffer (see above) or if they should be displayed collapsed - so all its members (methods, variables etc.) are hidden. Automatic expanding the ECB-methods-buffer for current tag

If the option ecb-highlight-tag-with-point is switched on, then always that node in the method-buffer is highlighted which belongs to the current semantic-tag under point in the current active edit-window. But if this node is invisible (probably because its parent node is collapsed) then no node is highlighted if the auto. expanding feature is switched off.

You can either switch on this feature with the option ecb-auto-expand-tag-tree or even easier with the command ecb-toggle-auto-expand-tag-tree.

There is another option ecb-expand-methods-switch-off-auto-expand which makes both explicit and auto. expanding best working together. See the documentation of this option to get the details.

The autom. expanding feature is only available for semantic-sources!

Previous versions of ECB have always fully expanded the whole tree in the Methods-buffer if the current tag in the source-buffer was not visible in the current tree - e.g. because the variables-bucket was collapsed or the containing type of a tag (e.g. the class of a method) was collapsed. So in most cases much more was expanded as needed to make the current tag visible.

The mechanism of ECB 2.22 and higher only expands the needed parts of the tree-buffer to make the related node visible: First we try to highlight the current tag with current expansion-state of the Methods-buffer. If the node is not visible so the tag can not be highlighted then we go upstairs the ladder of type-tags the current tag belongs to (e.g. we expand successive the nodes of the whole class-hierachy of the current method-tag until the related node becomes visible). If there is no containing type for the current tag then the node of the tag is probably contained in a toplevel-bucket which is currently collapsed; in this case we expand only this bucket-node and try highlighting again. Only if this has still no success then we expand the full tree-buffer and try to highlight the current tag.

There is another option ecb-auto-expand-tag-tree-collapse-other: If this option is set then auto. expanding the tag-tree collapses all not related nodes. This means that all nodes which have no relevance for the currently highlighted node will be collapsed, because they are not necessary to make the highlighted node visible. This feature is switched off by default because if always collapses the complete Methods-tree before the following highlighting of the node for the current tag expands the needed parts of the tree-buffer.