use of kyj.Fx.dao.wizard.core.model.vo.TableModelDVO in project Gargoyle by callakrsos.
the class DaoWizardViewController method menuToVoEditorOnAction.
/********************************
* 작성일 : 2016. 2. 27. 작성자 : KYJ
*
* 내용 : VO에티터로 결과내용을 전달처리한다.
*******************************/
public void menuToVoEditorOnAction(ActionEvent e) {
ObservableList<TbpSysDaoColumnsDVO> items = tbMappings.getItems();
if (items.isEmpty())
return;
DatabaseTypeMappingFunction typeConverter = new DatabaseTypeMappingFunction();
try {
FXMLLoader loader = FxUtil.createNewFxmlLoader();
loader.setLocation(getClass().getResource("VoEditorView.fxml"));
BorderPane root = loader.load();
VoEditorController controller = loader.getController();
List<TableModelDVO> resultItems = items.stream().map(m -> {
TableModelDVO dvo = new TableModelDVO();
dvo.setName(ValueUtil.getPrefixLowerTextMyEdit(m.getColumnName()));
String programType = m.getProgramType();
if (programType == null || programType.isEmpty()) {
programType = typeConverter.apply(m.getColumnType());
}
dvo.setType(programType);
return dvo;
}).collect(Collectors.toList());
controller.addItem(resultItems);
SharedMemory.getSystemLayoutViewController().loadNewSystemTab("New VO", root);
} catch (IOException e1) {
LOGGER.error(ValueUtil.toString(e1));
}
}
use of kyj.Fx.dao.wizard.core.model.vo.TableModelDVO in project Gargoyle by callakrsos.
the class VoEditorController method replace.
private void replace(int idx1, int idx2) {
TableModelDVO tableModelDVO1 = tbVoEditor.getItems().get(idx1);
TableModelDVO tableModelDVO2 = tbVoEditor.getItems().get(idx2);
tbVoEditor.getItems().set(idx2, tableModelDVO1);
tbVoEditor.getItems().set(idx1, tableModelDVO2);
}
use of kyj.Fx.dao.wizard.core.model.vo.TableModelDVO 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 kyj.Fx.dao.wizard.core.model.vo.TableModelDVO in project Gargoyle by callakrsos.
the class VoEditorController method defaultTableModelDVO.
/**
* 디폴트 TableModelDVO 반환
*
* @작성자 : KYJ
* @작성일 : 2015. 10. 15.
* @return
*/
private TableModelDVO defaultTableModelDVO() {
TableModelDVO tableModelDVO = new TableModelDVO();
String typeName = ConfigResourceLoader.getInstance().get(ConfigResourceLoader.VOEDITOR_DEFAULT_TYPE_NAME);
tableModelDVO.setType(typeName);
return tableModelDVO;
}
use of kyj.Fx.dao.wizard.core.model.vo.TableModelDVO in project Gargoyle by callakrsos.
the class ExcelUtilTest method makeExcelFile.
@org.junit.Before
public void makeExcelFile() throws Exception {
List<TableMasterDVO> listTable = VoWizardUtil.listTable("tbm_sm_user");
List<TableModelDVO> listColumns = VoWizardUtil.listColumns(listTable.get(0));
File userDir = SystemUtils.getUserDir();
createExcelFile = VoWizardUtil.createExcelFile(userDir, "TbmSmUserDVO.xlsx", listColumns, true);
}
Aggregations