use of com.kyj.fx.voeditor.core.VoEditor 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;
}
}
use of com.kyj.fx.voeditor.core.VoEditor in project Gargoyle by callakrsos.
the class DefaultGenerateVoEditorFunction method apply.
@Override
public VoEditor apply(ClassMeta t, List<FieldMeta> fields) {
VoEditor voEditor = new VoEditor(t, fields);
voEditor.build();
return voEditor;
}
use of com.kyj.fx.voeditor.core.VoEditor in project Gargoyle by callakrsos.
the class SimpleTest method test.
@Test
public void test() throws Exception {
FieldMeta fieldMeta = new FieldMeta((Modifier.PRIVATE), "sample", String.class);
fieldMeta.setPrimarykey(true);
fieldMeta.setAlias("키속성");
FieldMeta fieldMeta2 = new FieldMeta((Modifier.PRIVATE), "sample2", String.class);
FieldMeta fieldMeta3 = new FieldMeta((Modifier.PRIVATE), "check", boolean.class);
FieldMeta fieldMeta4 = new FieldMeta((Modifier.PRIVATE), "count", int.class);
FieldMeta fieldMeta5 = new FieldMeta((Modifier.PRIVATE), "name", StringProperty.class, SimpleStringProperty.class);
FieldMeta fieldMeta6 = new FieldMeta((Modifier.PRIVATE), "name2", StringProperty.class, SimpleStringProperty.class);
/*
* , FxVo.class, new Class<?>[] { IExtractClass .class, IExtractField
* .class }
*/
ClassMeta classMeta = new ClassMeta("com.sample", "Simple");
VoEditor voEditor = new VoEditor(classMeta, fieldMeta, fieldMeta2, fieldMeta3, fieldMeta4, fieldMeta5, fieldMeta6);
voEditor.build();
String text = voEditor.toText();
LOGGER.debug(text);
}
use of com.kyj.fx.voeditor.core.VoEditor in project Gargoyle by callakrsos.
the class VoWizardUtil method toVoString.
/**
* VO문자열로 리턴
*
* @param classMeta
* @param models
* @return
* @throws Exception
*/
public static String toVoString(ClassMeta classMeta, List<TableModelDVO> models) throws Exception {
VoEditorConverter converter = new VoEditorConverter(classMeta, models);
VoEditor voEditor = converter.convert();
return voEditor.toText();
}
use of com.kyj.fx.voeditor.core.VoEditor in project Gargoyle by callakrsos.
the class VOEditorParser2 method main.
public static void main(String[] args) throws ParseException, IOException {
String fileName = "C:\\Users\\KYJ\\JAVA_FX\\gagoyleWorkspace\\VisualFxVoEditor\\src\\main\\java\\com\\kyj\\fx\\voeditor\\visual\\main\\model\\vo\\ClassPathEntry.java";
FileInputStream in = new FileInputStream(fileName);
CompilationUnit cu;
try {
// parse the file
cu = JavaParser.parse(in);
} finally {
in.close();
}
PackageDeclaration packageDeclaration = cu.getPackage();
// System.out.println(packageDeclaration.getName().toString());
// System.out.println();
// System.out.println(String.format("package name : %s",
// packageDeclaration.getName().getName()));
ClassMeta classMeta = new ClassMeta("");
classMeta.setPackageName(packageDeclaration.getName().toString());
ArrayList<FieldMeta> fields = new ArrayList<FieldMeta>();
VoEditor voEditor = new VoEditor(classMeta, fields);
List<Node> childrenNodes = cu.getChildrenNodes();
for (Node n : childrenNodes) {
}
new MethodVisitor().visit(cu, null);
}
Aggregations