private void commonNewDocumentHandling(String fileDescription) {
        // setup custom search utility tool
        if (searchPanel != null)
            searchPanel.setDocument(document);

        if (thumbnailsPanel != null) {
            thumbnailsPanel.setDocument(document);
        }

        // utility pane visibility
        boolean showUtilityPane = false;

        // get data on how the view should look from the document dictionary
        // if no data, use settings from last viewed document, fit and view type
        Catalog catalog = document.getCatalog();

        // Page layout, the default value is singlePage, but we currently
        // remember the users last view mode via the properties manager.  Possible
        // values are SinglePage, OnceColumn, TwoColumnLeft, TwoColumRight,
        // TwoPageLeft, TwoPageRight.
        Object tmp = catalog.getObject("PageLayout");
        if (tmp != null && tmp instanceof Name) {
            String pageLayout = ((Name) tmp).getName();
            int viewType = DocumentViewControllerImpl.ONE_PAGE_VIEW;
            if (pageLayout.equalsIgnoreCase("OneColumn")) {
                viewType = DocumentViewControllerImpl.ONE_COLUMN_VIEW;
            } else if (pageLayout.equalsIgnoreCase("TwoColumnLeft")) {
                viewType = DocumentViewControllerImpl.TWO_COLUMN_LEFT_VIEW;
            } else if (pageLayout.equalsIgnoreCase("TwoColumnRight")) {
                viewType = DocumentViewControllerImpl.TWO_COLUMN_RIGHT_VIEW;
            } else if (pageLayout.equalsIgnoreCase("TwoPageLeft")) {
                viewType = DocumentViewControllerImpl.TWO_PAGE_LEFT_VIEW;
            } else if (pageLayout.equalsIgnoreCase("TwoPageRight")) {
                viewType = DocumentViewControllerImpl.TWO_PAGE_RIGHT_VIEW;
            }
            documentViewController.setViewType(viewType);
        }

        if (utilityTabbedPane != null) {
            // Page mode by default is UseNone, where other options are, UseOutlines,
            // UseThumbs, FullScreen (ignore), UseOC(ignore), Use Attachements(ignore);
            tmp = catalog.getObject("PageMode");
            if (tmp != null && tmp instanceof Name) {
                String pageMode = ((Name) tmp).getName();
                showUtilityPane = pageMode.equalsIgnoreCase("UseOutlines");
            }
        }

        // initiates the view layout model, page coordinates and preferred size
        documentViewController.setDocument(document);

        // Refresh the properties manager object if we don't already have one
        // This would be not null if the UI was constructed manually
        if ((propertiesManager == null) && (windowManagementCallback != null)) {
            propertiesManager = windowManagementCallback.getProperties();
        }

        // Set the default zoom level from the properties file
        float defaultZoom = (float) PropertiesManager.checkAndStoreDoubleProperty(
                propertiesManager,
                PropertiesManager.PROPERTY_DEFAULT_ZOOM_LEVEL);
        documentViewController.setZoom(defaultZoom);

        // Set the default page fit mode
        setPageFitMode(PropertiesManager.checkAndStoreIntegerProperty(
                propertiesManager,
                PropertiesManager.PROPERTY_DEFAULT_PAGEFIT,
                org.icepdf.core.views.DocumentViewController.PAGE_FIT_NONE), false);

        // Apply any ViewerPreferences from the doc
        applyViewerPreferences(catalog, propertiesManager);

        // Only show utility panel if there is an outline
        OutlineItem item = null;
        Outlines outlines = document.getCatalog().getOutlines();
        if (outlines != null && outlinesTree != null)
            item = outlines.getRootOutlineItem();
        if (item != null) {
            outlinesTree.setModel(new DefaultTreeModel(new OutlineItemTreeNode(item)));
            outlinesTree.setRootVisible(!item.isEmpty());
            outlinesTree.setShowsRootHandles(true);
            if (utilityTabbedPane != null && outlinesScrollPane != null) {
                if (utilityTabbedPane.indexOfComponent(outlinesScrollPane) > -1) {
                    utilityTabbedPane.setEnabledAt(
                            utilityTabbedPane.indexOfComponent(outlinesScrollPane),
                            true);
                    utilityTabbedPane.setSelectedComponent(outlinesScrollPane);
                }
            }
        } else {
            if (utilityTabbedPane != null && outlinesScrollPane != null) {
                if (utilityTabbedPane.indexOfComponent(outlinesScrollPane) > -1) {
                    utilityTabbedPane.setEnabledAt(
                            utilityTabbedPane.indexOfComponent(outlinesScrollPane),
                            false);
                }
            }

            // Try to select the search panel
            if (!safelySelectUtilityPanel(searchPanel)) {
                // If that fails, try to select the annotationPanel
                safelySelectUtilityPanel(annotationPanel);
            }
        }
        setUtilityPaneVisible(showUtilityPane);

        // add to the main pdfContentPanel the document peer
        if (viewer != null) {
            Object[] messageArguments = new Object[]{fileDescription};
            MessageFormat formatter = new MessageFormat(
                    messageBundle.getString("viewer.window.title.open.default"));
            viewer.setTitle(formatter.format(messageArguments));

        }

        // disable the annotation properties panel by default
        if (annotationPanel != null) {
            annotationPanel.setEnabled(false);
        }

        // set the go to page combo box in the mainToolbar
        reflectStateInComponents();
        updateDocumentView();
    }