public void openFile(File file) {
        isOpeningFile = true;
        if (file != null) {
            view.middleTabPane.viewPane.getChildren().clear();
            selectionManager.clearSelection();
            historyManager.clearHistory();

            try {
                Parent parent = FXMLLoader.load(file.toURI().toURL());

                GUIHelper.setBounds(view.middleTabPane.viewPane, view.middleTabPane.viewPaneDecorator, parent.prefWidth(0), parent.prefHeight(0));
                String className = parent.getId();
                if (className != null && !className.isEmpty()) {
                    view.middleTabPane.viewPane.setClassName(className);
                }

                for (Node node : parent.getChildrenUnmodifiable()) {

                    for (ComponentMenuItem componentMenuItem : view.leftPanel.leftList.getItems()) {
                        ComponentSettings componentSettings = componentMenuItem.getComponentSettings();
                        try {
                            if (componentSettings.getType().equals(node.getClass().getSimpleName())) {
                                historyManager.pause();
                                Class componentClass = Class.forName("bdl.build." + componentSettings.getPackageName() + ".G" + componentSettings.getType());
                                Constructor constructor = componentClass.getConstructor();
                                GObject newThing = (GObject) constructor.newInstance();
                                newThing.setFieldName(node.getId());

                                addGObject(newThing, componentSettings, view, viewListeners, node, -1, -1, view.middleTabPane.viewPane);
                                historyManager.unpause();
                                break;
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        isOpeningFile = false;
    }