I'm implementing an Eclipse plug-in to refresh a new view part when any change occurs in a Java file. Is this possible? And how?
Besides that, I need to identify the abstract syntax tree (AST) of the present code in the Java editor. Any suggestion?
I'm implementing an Eclipse plug-in to refresh a new view part when any change occurs in a Java file. Is this possible? And how?
Besides that, I need to identify the abstract syntax tree (AST) of the present code in the Java editor. Any suggestion?
You can listen to changes of the underlying IDocument
as described here: Eclipse Plugin to granularly monitor editor changes
The Java editor input also adapts to IJavaElement
. For example:
editor.getEditorInput().getAdapter( IJavaElement.class )
If the result is an ICompilationUnit
, you can create an AST thereof as described here: https://www.eclipse.org/articles/article.php?file=Article-JavaCodeManipulation_AST/index.html