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);
}
});
}
Aggregations