use of com.kyj.fx.voeditor.visual.component.popup.DatabaseTableView in project Gargoyle by callakrsos.
the class DaoWizardViewController method btnDaoDatabaseMouseClick.
/**
* 데이터베이스 선택시....
*
* @작성자 : KYJ
* @작성일 : 2015. 10. 21.
* @param e
*/
@FXML
public void btnDaoDatabaseMouseClick(MouseEvent e) {
DatabaseTableView view = new DatabaseTableView();
TableDVO tableDVO = view.show();
if (tableDVO != null) {
TableMasterDVO tableMasterDVO = tableDVO.getTableMasterDVO();
txtTableName.setText(tableMasterDVO.getTableName());
// TbmSysDaoDVO tbmSysDaoDVO = new TbmSysDaoDVO();
tbmSysDaoDVOProperty.get().setTableName(tableMasterDVO.getTableName());
}
}
use of com.kyj.fx.voeditor.visual.component.popup.DatabaseTableView in project Gargoyle by callakrsos.
the class VoEditorController method initialize.
/**
* 이벤트 초기화
*
* @작성자 : KYJ
* @작성일 : 2015. 10. 15.
*/
@FXML
public void initialize() {
colType.setCellFactory(new ClassTypeCheckBoxCellFactory());
colName.setCellFactory(TextFieldTableCell.forTableColumn());
colSize.setCellFactory(TextFieldTableCell.forTableColumn());
colDesc.setCellFactory(TextFieldTableCell.forTableColumn());
CommonsContextMenu.addMenus(tbVoEditor, (Menus.useCudButtons() | Menus.UP | Menus.DOWN));
// tbVoEditor.setContextMenu();
tbVoEditor.addEventHandler(ActionEvent.ACTION, event -> {
if (event instanceof CommonContextMenuEvent) {
CommonContextMenuEvent _event = (CommonContextMenuEvent) event;
int mode = _event.getMode();
ObservableList<TableModelDVO> items = tbVoEditor.getItems();
int selectedIndex = tbVoEditor.getSelectionModel().getSelectedIndex();
int rowSize = items.size();
boolean isMove = false;
if (Menus.isAdd(mode)) {
items.add(defaultTableModelDVO());
isMove = true;
} else if (Menus.isDelete(mode)) {
items.remove(selectedIndex);
isMove = true;
} else if (Menus.isUp(mode)) {
btnUpOnMouseClick();
} else if (Menus.isDown(mode)) {
btnDownOnMouseClick();
}
if (isMove) {
tbVoEditor.getSelectionModel().select(rowSize - 1);
}
}
});
// 컨트롤 키를 누르면 그리드 데이터 이동처리.
tbVoEditor.setOnKeyPressed(event -> {
if (event.isControlDown()) {
KeyCode code = event.getCode();
switch(code) {
case UP:
btnUpOnMouseClick();
break;
case DOWN:
btnDownOnMouseClick();
break;
default:
break;
}
event.consume();
}
});
btnGenerate.addEventHandler(MouseEvent.MOUSE_CLICKED, this::btnGenerateOnMouseClick);
btnSelect.setOnMouseClicked(this::btnSelectOnMouseClick);
btnDatabase.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
DatabaseTableView databaseTableView = new DatabaseTableView();
TableDVO show = databaseTableView.show();
if (show != null) {
TableMasterDVO tableMasterDVO = show.getTableMasterDVO();
List<TableModelDVO> tableModelDVOList = show.getTableModelDVOList();
ObservableList<TableModelDVO> items = tbVoEditor.getItems();
if (tableMasterDVO != null) {
txtClassName.setText(tableMasterDVO.getClassName());
txtAreaDesc.setText(tableMasterDVO.getDescription());
}
if (tableModelDVOList != null) {
items.clear();
items.addAll(tableModelDVOList);
}
}
}
});
}
use of com.kyj.fx.voeditor.visual.component.popup.DatabaseTableView in project Gargoyle by callakrsos.
the class TableInfoTab method supplyNode.
@Override
public BorderPane supplyNode() {
try {
return FxUtil.loadAndControllerAction(TableInfoController.class, (TableInfoController c) -> {
c.setBorTableDefine(new DatabaseTableView());
TableView<Object> tbDefined = new TableView<>();
c.setBorTableCollect(tbDefined);
});
} catch (Exception e) {
LOGGER.error(ValueUtil.toString(e));
}
return new DatabaseTableView();
}
Aggregations