@Override
    protected Control createDialogArea(Composite parent)
    {
        getShell().setText(title);

        Composite group = (Composite) super.createDialogArea(parent);
        GridData gd = new GridData(GridData.FILL_BOTH);
        group.setLayoutData(gd);

        DatabaseNavigatorTreeFilter navigatorFilter = createNavigatorFilter();
        navigatorTree = new DatabaseNavigatorTree(group, rootNode, (singleSelection ? SWT.SINGLE : SWT.MULTI) | SWT.BORDER, false, navigatorFilter);
        gd = new GridData(GridData.FILL_BOTH);
        gd.widthHint = 500;
        gd.heightHint = 500;
        navigatorTree.setLayoutData(gd);

        navigatorTree.setFilterObjectType(DatabaseNavigatorTreeFilterObjectType.connection);

        final TreeViewer treeViewer = navigatorTree.getViewer();
        ViewerFilter viewerFilter = createViewerFilter();
        if (viewerFilter != null) {
            treeViewer.addFilter(viewerFilter);
        }
        if (selectedNodes.length > 0) {
            treeViewer.setSelection(new StructuredSelection(selectedNodes));
            Collections.addAll(selectedObjects, selectedNodes);

            for (DBNNode node : selectedNodes) {
                if (!(node instanceof DBNDataSource dataSource) || dataSource.getDataSourceContainer().isConnected()) {
                    treeViewer.expandToLevel(selectedNodes, 1);
                }
            }
        }
        treeViewer.addSelectionChangedListener(event -> {
            selectedObjects.clear();
            specialNode = null;
            IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
            for (Object node : selection) {
                if (node instanceof DBNNode) {
                    if (matchesResultNode((DBNNode)node)) {
                        selectedObjects.add((DBNNode) node);
                    } else {
                        selectedObjects.clear();
                    }
                } else if (node instanceof TreeNodeSpecial) {
                    specialNode = (TreeNodeSpecial) node;
                }
            }
            getButton(IDialogConstants.OK_ID).setEnabled(!selectedObjects.isEmpty());
        });
        treeViewer.addDoubleClickListener(event -> {
            if (!selectedObjects.isEmpty()) {
                okPressed();
            } else if (specialNode != null) {
                specialNode.handleDefaultAction(navigatorTree);
            }
        });
        treeViewer.getTree().setFocus();

        if (rootNode instanceof DBNContainer && ((DBNContainer) rootNode).getChildrenClass() == DBPDataSourceContainer.class) {
            final Button showConnectedCheck = new Button(group, SWT.CHECK);
            showConnectedCheck.setText(UINavigatorMessages.label_show_connected);
            showConnectedCheck.setSelection(showConnected);
            showConnectedCheck.addSelectionListener(new SelectionAdapter() {
                @Override
                public void widgetSelected(SelectionEvent e) {
                    showConnected = showConnectedCheck.getSelection();
                    treeViewer.getControl().setRedraw(false);
                    try {
                        treeViewer.refresh();
                        if (showConnected) {
                            treeViewer.expandToLevel(TREE_EXPANSION_DEPTH, false);
                        }
                    } finally {
                        treeViewer.getControl().setRedraw(true);
                    }
                }
            });
        }

        return group;
    }
Expands first level of each node
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/dialogs/ObjectBrowserDialogBase.java