Order the root file items of the outline explorer as in the tabbar
        of the current EditorStack.
19017
def _sync_outlineexplorer_file_order(self):
        
        if self.outlineexplorer is not None:
            self.outlineexplorer.treewidget.set_editor_ids_order(
                [finfo.editor.get_document_id() for finfo in self.data])
110165
def setup_editorstack(self, parent, layout):
        """"""
        layout.setSpacing(1)

        self.fname_label = QLabel()
        self.fname_label.setStyleSheet(
            "QLabel {margin: 0px; padding: 3px;}")
        layout.addWidget(self.fname_label)

        menu_btn = create_toolbutton(self, icon=ima.icon('tooloptions'),
                                     tip=_('Options'))
        # Don't show menu arrow and remove padding
        if is_dark_interface():
            menu_btn.setStyleSheet(
                ("QToolButton::menu-indicator{image: none;}\n"
                 "QToolButton{margin: 1px; padding: 3px;}"))
        else:
            menu_btn.setStyleSheet(
                "QToolButton::menu-indicator{image: none;}")
        self.menu = QMenu(self)
        menu_btn.setMenu(self.menu)
        menu_btn.setPopupMode(menu_btn.InstantPopup)
        self.menu.aboutToShow.connect(self.__setup_menu)

        corner_widgets = {Qt.TopRightCorner: [menu_btn]}
        self.tabs = BaseTabs(self, menu=self.menu, menu_use_tooltips=True,
                             corner_widgets=corner_widgets)
        self.tabs.tabBar().setObjectName('plugin-tab')
        self.tabs.set_close_function(self.close_file)
        self.tabs.tabBar().tabMoved.connect(self.move_editorstack_data)
        self.tabs.setMovable(True)

        self.stack_history.refresh()

        if hasattr(self.tabs, 'setDocumentMode') \
           and not sys.platform == 'darwin':
            # Don't set document mode to true on OSX because it generates
            # a crash when the editor is detached from the main window
            # Fixes Issue 561
            self.tabs.setDocumentMode(True)
        self.tabs.currentChanged.connect(self.current_changed)

        if sys.platform == 'darwin':
            tab_container = QWidget()
            tab_container.setObjectName('tab-container')
            tab_layout = QHBoxLayout(tab_container)
            tab_layout.setContentsMargins(0, 0, 0, 0)
            tab_layout.addWidget(self.tabs)
            layout.addWidget(tab_container)
        else:
            layout.addWidget(self.tabs)
564130
protected void cleanUpMenuTree(WebMenuItem root, String menuName){
		List<WebMenuItem> subMenu = root.getSubMenu();
		List<WebMenuItem> rootBreadcrumbs = root.getBreadcrumbs();
		if (subMenu != null && subMenu.size() > 0){
			Collections.sort(subMenu);
			for (int i = 0; i < subMenu.size(); i++){
				WebMenuItem item = subMenu.get(i);
				if (item instanceof MenuItemExt){
					MenuItemExt itemExt = (MenuItemExt)item;
					item = itemExt.toWebMenuItem();
					subMenu.set(i, item);
					menuItemPaths.get(menuName).put(itemExt.path, item);
				}
				item.breadcrumbs = new ArrayList<WebMenuItem>();
				if (rootBreadcrumbs != null){
					item.breadcrumbs.addAll(rootBreadcrumbs);
				}
				item.breadcrumbs.add(item);
				cleanUpMenuTree(item, menuName);
			}
		}
	}
133611
def edit_tab(self, index):
        """"""

        # Sets focus, shows cursor
        self.setFocus(True)

        # Updates tab index
        self.tab_index = index

        # Gets tab size and shrinks to avoid overlapping tab borders
        rect = self.main.tabRect(index)
        rect.adjust(1, 1, -2, -1)

        # Sets size
        self.setFixedSize(rect.size())

        # Places on top of the tab
        self.move(self.main.mapToGlobal(rect.topLeft()))

        # Copies tab name and selects all
        text = self.main.tabText(index)
        text = text.replace(u'&', u'')
        if self.split_char:
            text = text.split(self.split_char)[self.split_index]

        self.setText(text)
        self.selectAll()

        if not self.isVisible():
            # Makes editor visible
            self.show()
131233
private void addOuToTree(CmsOrganizationalUnit ou, CmsOrganizationalUnit parent_ou) {

        Item containerItem;
        containerItem = m_treeContainer.addItem(ou);
        if (containerItem == null) {
            containerItem = getItem(ou);
        }
        containerItem.getItemProperty(PROP_NAME).setValue(getIconCaptionHTML(ou, CmsOuTreeType.OU));
        containerItem.getItemProperty(PROP_TYPE).setValue(CmsOuTreeType.OU);
        m_treeContainer.setParent(ou, parent_ou);
    }
544858
def go_to_line(self, line=None):
        """"""
        editorstack = self.get_current_editorstack()
        if editorstack is not None:
            editorstack.go_to_line(line)
482764
function (order) {
			var items = {}, rootEl = this.el;

			this.toArray().forEach(function (id, i) {
				var el = rootEl.children[i];

				if (_closest(el, this.options.draggable, rootEl)) {
					items[id] = el;
				}
			}, this);

			order.forEach(function (id) {
				if (items[id]) {
					rootEl.removeChild(items[id]);
					rootEl.appendChild(items[id]);
				}
			});
		}
1051133
function () {
        var self = this;

        self.items().each(function (ctrl) {
          ctrl.classes.add('toolbar-item');
        });

        return self._super();
      }
264554
def move_up(self):
        """"""
        if self.current_item.parent is not None:
            self.current_item = self.current_item.parent

        for f in self._hooks["up"]:
            f(self)
        if self.current_item is self.root:
            for f in self._hooks["top"]:
                f(self)
        return self
1167905
public Object depthFirst(NodeVisitor nodeVisitor, Collection<? extends Node> roots) {
        TraverserVisitor<Node> nodeTraverserVisitor = new TraverserVisitor<Node>() {

            @Override
            public TraversalControl enter(TraverserContext<Node> context) {
                context.setVar(LeaveOrEnter.class, LeaveOrEnter.ENTER);
                return context.thisNode().accept(context, nodeVisitor);
            }

            @Override
            public TraversalControl leave(TraverserContext<Node> context) {
                context.setVar(LeaveOrEnter.class, LeaveOrEnter.LEAVE);
                return context.thisNode().accept(context, nodeVisitor);
            }
        };
        return doTraverse(roots, nodeTraverserVisitor);
    }
515272
void expandCurrentFolder() {

        if (m_currentFolder != null) {
            m_treeContainer.setChildrenAllowed(m_currentFolder, true);
            m_fileTree.expandItem(m_currentFolder);
        }
    }
1181698
public void setCurrentTab(int position) {
        if(mSelectedPosition != position){
            View v = mLayoutManager.findViewByPosition(mSelectedPosition);
            if(v != null)
                ((Checkable)v).setChecked(false);
        }

        mSelectedPosition = position;
        View v = mLayoutManager.findViewByPosition(mSelectedPosition);
        if(v != null)
            ((Checkable)v).setChecked(true);

        animateToTab(position);
    }
1280594
def tab_under_menu(self):
        
        if self._menu_pos:
            return self.tabBar().tabAt(self._menu_pos)
        else:
            return self.currentIndex()
997522
def edit_tree_item(self):
        

        def open_path_dialog_folder(path):
            """
            opens a file dialog to get the path to a file and
            """
            dialog = QtWidgets.QFileDialog()
            dialog.setFileMode(QtWidgets.QFileDialog.Directory)
            dialog.setOption(QtWidgets.QFileDialog.ShowDirsOnly, True)
            path = dialog.getExistingDirectory(self, 'Select a folder:', path)

            return path

        tree = self.sender()

        if tree == self.tree_gui_settings:

            index = tree.selectedIndexes()[0]
            model = index.model()

            if index.column() == 1:
                path = model.itemFromIndex(index).text()
                key = str(model.itemFromIndex(model.index(index.row(), 0)).text())
                if(key == 'gui_settings'):
                    path, _ = QtWidgets.QFileDialog.getSaveFileName(self, caption = 'Select a file:', directory = path, filter = '*.b26')
                    if path:
                        name, extension = os.path.splitext(path)
                        if extension != '.b26':
                            path = name + ".b26"
                else:
                    path = str(open_path_dialog_folder(path))

                if path != "":
                    self.gui_settings.update({key : str(os.path.normpath(path))})
                    self.fill_treeview(tree, self.gui_settings)
741724
def sort_loading_order(step_files):
    
    tools = []
    workflows = []
    workflows_with_subworkflows = []

    for f in step_files:
        # assume that urls are tools
        if f.startswith('http://') or f.startswith('https://'):
            tools.append(f)
        else:
            obj = load_yaml(f)
            if obj.get('class', '') == 'Workflow':
                if 'requirements' in obj.keys():
                    subw = {'class': 'SubworkflowFeatureRequirement'}
                    if subw in obj['requirements']:
                        workflows_with_subworkflows.append(f)
                    else:
                        workflows.append(f)
                else:
                    workflows.append(f)
            else:
                tools.append(f)
    return tools + workflows + workflows_with_subworkflows
1052947
def sorted(self):
        """"""
        for i in range(0, self.tabs.tabBar().count() - 1):
            if (self.tabs.tabBar().tabText(i) >
                    self.tabs.tabBar().tabText(i + 1)):
                return False
        return True
1097295
def set_current_editor(self, editor, update):
        """"""
        editor_id = editor.get_id()
        if editor_id in list(self.editor_ids.values()):
            item = self.editor_items[editor_id]
            if not self.freeze:
                self.scrollToItem(item)
                self.root_item_selected(item)
                self.__hide_or_show_root_items(item)
            if update:
                self.save_expanded_state()
                tree_cache = self.editor_tree_cache[editor_id]
                self.populate_branch(editor, item, tree_cache)
                self.restore_expanded_state()
        else:
            root_item = FileRootItem(editor.fname, self, editor.is_python())
            root_item.set_text(fullpath=self.show_fullpath)
            tree_cache = self.populate_branch(editor, root_item)
            self.__hide_or_show_root_items(root_item)
            self.root_item_selected(root_item)
            self.editor_items[editor_id] = root_item
            self.editor_tree_cache[editor_id] = tree_cache
            self.resizeColumnToContents(0)
        if editor not in self.editor_ids:
            self.editor_ids[editor] = editor_id
            self.ordered_editor_ids.append(editor_id)
            self.__sort_toplevel_items()
        self.current_editor = editor