JDT package path from CompilationUnit
chqu1012 opened this issue · 0 comments
chqu1012 commented
for (Object obj : dialog.getResult()) {
if (obj instanceof SourceType) {
SourceType type = (SourceType) obj;
CompilationUnit element = (CompilationUnit) type.getParent();
try {
System.out.println(element.getPackageDeclarations()[0].getElementName()+"."+element.getElementName());
factoryText.setText(element.getPackageDeclarations()[0].getElementName()+"."+element.getElementName());
} catch (JavaModelException e1) {
e1.printStackTrace();
}
}
}