Elements elements = control.getElements();
Trees trees = control.getTrees();
Types types = control.getTypes();
TypeElement applet = elements.getTypeElement("java.applet.Applet"); //NOI18N
TypeElement japplet = elements.getTypeElement("javax.swing.JApplet"); //NOI18N
CompilationUnitTree cu = control.getCompilationUnit();
List<? extends Tree> topLevels = cu.getTypeDecls();
for (Tree topLevel : topLevels) {
if (topLevel.getKind() == Tree.Kind.CLASS) {
TypeElement type = (TypeElement) trees.getElement(TreePath.getPath(cu, topLevel));
if (type != null) {
Set<Modifier> modifiers = type.getModifiers();