Search in sources :

Example 6 with DockTab

use of com.kyj.fx.voeditor.visual.component.dock.tab.DockTab in project Gargoyle by callakrsos.

the class SystemLayoutViewController method loadNewSystemTab.

/********************************
	 * 작성일 : 2016. 4. 26. 작성자 : KYJ
	 *
	 * 새로운 탭을 로드한다.
	 *
	 * @param tableName
	 * @param parent
	 ********************************/
public void loadNewSystemTab(String tableName, CloseableParent<?> parent) {
    Platform.runLater(() -> {
        try {
            Parent _parent = parent.getParent();
            if (beforeParentLoad != null && beforeParentLoad.filter(_parent)) {
                beforeParentLoad.beforeLoad(_parent);
                if (beforeParentLoad.isUnloadParent()) {
                    return;
                }
            }
            DockTab tab = new DockTab(tableName, _parent);
            // 툴팁 처리 (클래스위치)
            tab.setTooltip(new Tooltip(parent.getClass().getName()));
            addTabItem(tab);
            tabPanWorkspace.getSelectionModel().select(tab);
            tab.setOnCloseRequest(ev -> {
                try {
                    LOGGER.debug("closeable parent on close request , tabName : {} ", tableName);
                    parent.close();
                } catch (Exception e) {
                    LOGGER.error(ValueUtil.toString(e));
                }
            });
            // 리스너 호출.
            onParentloaded.forEach(v -> v.onLoad(parent.getParent()));
            // tab.getTabPane().getSelectionModel().select(tab);
            // _parent.getScene().getStylesheets().clear();
            List<Node> findAllByNodes = FxUtil.findAllByNodes(_parent, n -> n instanceof Button);
            findAllByNodes.forEach(btn -> {
                btn.getStyleClass().add("button-gargoyle");
            });
        } catch (Exception e1) {
            DialogUtil.showExceptionDailog(e1);
        }
    });
}
Also used : DockTab(com.kyj.fx.voeditor.visual.component.dock.tab.DockTab) Parent(javafx.scene.Parent) Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip) Node(javafx.scene.Node) IOException(java.io.IOException) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException)

Aggregations

DockTab (com.kyj.fx.voeditor.visual.component.dock.tab.DockTab)6 IOException (java.io.IOException)4 Tooltip (javafx.scene.control.Tooltip)4 GargoyleException (com.kyj.fx.voeditor.visual.exceptions.GargoyleException)3 DockTabPane (com.kyj.fx.voeditor.visual.component.dock.tab.DockTabPane)2 Parent (javafx.scene.Parent)2 Scene (javafx.scene.Scene)2 FileWrapper (com.kyj.fx.voeditor.visual.component.FileWrapper)1 ImageViewPane (com.kyj.fx.voeditor.visual.component.ImageViewPane)1 JavaProjectFileTreeItem (com.kyj.fx.voeditor.visual.component.JavaProjectFileTreeItem)1 JavaProjectMemberFileTreeItem (com.kyj.fx.voeditor.visual.component.JavaProjectMemberFileTreeItem)1 PDFImageBasePane (com.kyj.fx.voeditor.visual.component.PDFImageBasePane)1 ProjectFileTreeItemCreator (com.kyj.fx.voeditor.visual.component.ProjectFileTreeItemCreator)1 ResultDialog (com.kyj.fx.voeditor.visual.component.ResultDialog)1 JavaProcessMonitor (com.kyj.fx.voeditor.visual.component.bci.view.JavaProcessMonitor)1 CaptureScreenComposite (com.kyj.fx.voeditor.visual.component.capture.CaptureScreenComposite)1 ReadOnlyConsole (com.kyj.fx.voeditor.visual.component.console.ReadOnlyConsole)1 ReadOnlySingletonConsole (com.kyj.fx.voeditor.visual.component.console.ReadOnlySingletonConsole)1 SystemConsole (com.kyj.fx.voeditor.visual.component.console.SystemConsole)1 WebViewConsole (com.kyj.fx.voeditor.visual.component.console.WebViewConsole)1