Class SourceEditorController
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.AbstractController
-
- net.sourceforge.pmd.util.fxdesigner.SourceEditorController
-
- All Implemented Interfaces:
javafx.fxml.Initializable
,SettingsOwner
public class SourceEditorController extends AbstractController
One editor, i.e. source editor and ast tree view.- Since:
- 6.0.0
- Author:
- Clément Fournier
-
-
Constructor Summary
Constructors Constructor Description SourceEditorController(DesignerRoot owner, MainDesignerController mainController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterParentInit()
Executed after the parent's initialization (so afterAbstractController.afterChildrenInit()
).protected void
beforeParentInit()
Executed before the parent's initialization.void
clearErrorNodes()
Clears the name occurences.void
clearNameOccurences()
Clears the name occurences.void
clearStyleLayers()
void
clearXPathHighlight()
Clears the highlighting of XPath results.java.lang.String
getAuxclasspathFiles()
java.util.Optional<net.sourceforge.pmd.lang.ast.Node>
getCompilationUnit()
Returns the most up-to-date compilation unit, or empty if it can't be parsed.net.sourceforge.pmd.lang.LanguageVersion
getLanguageVersion()
java.lang.String
getText()
void
highlightErrorNodes(java.util.Collection<? extends net.sourceforge.pmd.lang.ast.Node> nodes)
Highlights nodes that are in error (secondary highlight).void
highlightNameOccurrences(java.util.Collection<? extends net.sourceforge.pmd.lang.symboltable.NameOccurrence> occs)
Highlights name occurrences (secondary highlight).void
highlightXPathResults(java.util.Collection<? extends net.sourceforge.pmd.lang.ast.Node> nodes)
Highlights xpath results (xpath highlight).org.reactfx.value.Var<net.sourceforge.pmd.lang.LanguageVersion>
languageVersionProperty()
void
moveCaret(int line, int column)
Moves the caret to a position and makes the view follow it.java.util.Optional<net.sourceforge.pmd.lang.ast.Node>
refreshAST()
Refreshes the AST and returns the new compilation unit if the parse didn't fail.void
setAuxclasspathFiles(java.lang.String files)
void
setFocusNode(net.sourceforge.pmd.lang.ast.Node node)
Highlights the given node (or nothing if null).void
setLanguageVersion(net.sourceforge.pmd.lang.LanguageVersion version)
void
setText(java.lang.String expression)
void
showAuxclasspathSetupPopup(DesignerRoot root)
org.reactfx.value.Val<java.lang.String>
textProperty()
TextAwareNodeWrapper
wrapNode(net.sourceforge.pmd.lang.ast.Node node)
-
Methods inherited from class net.sourceforge.pmd.util.fxdesigner.util.AbstractController
afterChildrenInit, getChildren, getChildrenSettingsNodes, initialize
-
-
-
-
Constructor Detail
-
SourceEditorController
public SourceEditorController(DesignerRoot owner, MainDesignerController mainController)
-
-
Method Detail
-
beforeParentInit
protected void beforeParentInit()
Description copied from class:AbstractController
Executed before the parent's initialization. Always executed once at the start of the initialization of this controller.- Overrides:
beforeParentInit
in classAbstractController
-
afterParentInit
protected void afterParentInit()
Description copied from class:AbstractController
Executed after the parent's initialization (so afterAbstractController.afterChildrenInit()
). This also means, after persistent settings restoration. If this node has no parent, then this is never executed.- Overrides:
afterParentInit
in classAbstractController
-
refreshAST
public java.util.Optional<net.sourceforge.pmd.lang.ast.Node> refreshAST()
Refreshes the AST and returns the new compilation unit if the parse didn't fail.
-
showAuxclasspathSetupPopup
public void showAuxclasspathSetupPopup(DesignerRoot root)
-
clearErrorNodes
public void clearErrorNodes()
Clears the name occurences.
-
clearNameOccurences
public void clearNameOccurences()
Clears the name occurences.
-
clearXPathHighlight
public void clearXPathHighlight()
Clears the highlighting of XPath results.
-
setFocusNode
public void setFocusNode(net.sourceforge.pmd.lang.ast.Node node)
Highlights the given node (or nothing if null). Removes highlighting on the previously highlighted node.
-
highlightXPathResults
public void highlightXPathResults(java.util.Collection<? extends net.sourceforge.pmd.lang.ast.Node> nodes)
Highlights xpath results (xpath highlight).
-
highlightNameOccurrences
public void highlightNameOccurrences(java.util.Collection<? extends net.sourceforge.pmd.lang.symboltable.NameOccurrence> occs)
Highlights name occurrences (secondary highlight).
-
highlightErrorNodes
public void highlightErrorNodes(java.util.Collection<? extends net.sourceforge.pmd.lang.ast.Node> nodes)
Highlights nodes that are in error (secondary highlight).
-
clearStyleLayers
public void clearStyleLayers()
-
moveCaret
public void moveCaret(int line, int column)
Moves the caret to a position and makes the view follow it.
-
wrapNode
public TextAwareNodeWrapper wrapNode(net.sourceforge.pmd.lang.ast.Node node)
-
getLanguageVersion
public net.sourceforge.pmd.lang.LanguageVersion getLanguageVersion()
-
setLanguageVersion
public void setLanguageVersion(net.sourceforge.pmd.lang.LanguageVersion version)
-
languageVersionProperty
public org.reactfx.value.Var<net.sourceforge.pmd.lang.LanguageVersion> languageVersionProperty()
-
getCompilationUnit
public java.util.Optional<net.sourceforge.pmd.lang.ast.Node> getCompilationUnit()
Returns the most up-to-date compilation unit, or empty if it can't be parsed.
-
getText
public java.lang.String getText()
-
setText
public void setText(java.lang.String expression)
-
textProperty
public org.reactfx.value.Val<java.lang.String> textProperty()
-
getAuxclasspathFiles
public java.lang.String getAuxclasspathFiles()
-
setAuxclasspathFiles
public void setAuxclasspathFiles(java.lang.String files)
-
-