use of com.kyj.fx.voeditor.visual.util.VoEditorConverter in project Gargoyle by callakrsos.
the class VoEditorController method btnGenerateOnMouseClick.
/********************************
* 작성일 : 2016. 6. 6. 작성자 : KYJ
*
* 생성 마우스 클릭
*
* @param me
********************************/
public void btnGenerateOnMouseClick(MouseEvent me) {
try {
checkValidation();
String className = txtClassName.getText();
String location = txtLocation.getText();
String packageName = txtPackageName.getText();
String extendsBaseClass = ConfigResourceLoader.getInstance().get(ConfigResourceLoader.VOEDITOR_DEFAULT_EXTENDS_CLASS);
ObservableList<TableModelDVO> items = tbVoEditor.getItems();
ClassMeta classMeta = EditorUtil.extractedClassMeta(className, packageName, extendsBaseClass);
VoEditorConverter converter = new VoEditorConverter(classMeta, items);
VoEditor voEditor = converter.convert();
if (location != null && !location.isEmpty()) {
Optional<Pair<String, String>> showYesOrNoDialog = DialogUtil.showYesOrNoDialog("파일생성여부", "파일도 만드시겠습니까? ");
showYesOrNoDialog.ifPresent(string -> {
if ("Y".equals(string.getValue())) {
try {
voEditor.toFile(location);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
JavaTextView simpleTextView = new JavaTextView(voEditor.toText());
simpleTextView.show();
} catch (Exception e) {
DialogUtil.showExceptionDailog(e);
return;
}
}
Aggregations