Class XPathPanelController
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.app.AbstractController<MainDesignerController>
-
- net.sourceforge.pmd.util.fxdesigner.XPathPanelController
-
- All Implemented Interfaces:
javafx.fxml.Initializable
,ApplicationComponent
,NodeSelectionSource
,SettingsOwner
public class XPathPanelController extends AbstractController<MainDesignerController> implements NodeSelectionSource
XPath panel controller. One such controller is a presenter for anObservableXPathRuleBuilder
, which stores all data about one currently edited rule.- Since:
- 6.0.0
- Author:
- Clément Fournier
- See Also:
ExportXPathWizardController
-
-
Field Summary
Fields Modifier and Type Field Description javafx.scene.control.Button
exportXpathToRuleButton
ToolbarTitledPane
expressionTitledPane
-
Fields inherited from class net.sourceforge.pmd.util.fxdesigner.app.AbstractController
parent
-
-
Constructor Summary
Constructors Constructor Description XPathPanelController(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.org.reactfx.value.Val<java.util.List<net.sourceforge.pmd.lang.ast.Node>>
currentResultsProperty()
void
evaluateXPath(net.sourceforge.pmd.lang.ast.Node compilationUnit, net.sourceforge.pmd.lang.LanguageVersion version)
Evaluate the contents of the XPath expression area on the given compilation unit.java.util.List<SettingsOwner>
getChildrenSettingsNodes()
Gets the children of this node in order.java.lang.String
getXpathExpression()
java.lang.String
getXpathVersion()
void
invalidateResultsExternal(boolean error)
Called by the rest of the app.java.util.List<net.sourceforge.pmd.lang.ast.Node>
runXPathQuery(net.sourceforge.pmd.lang.ast.Node compilationUnit, net.sourceforge.pmd.lang.LanguageVersion version, java.lang.String query)
void
setFocusNode(net.sourceforge.pmd.lang.ast.Node node)
Updates the UI to react to a change in focus node.void
setXpathExpression(java.lang.String expression)
void
setXpathVersion(java.lang.String xpathVersion)
void
showExportXPathToRuleWizard()
org.reactfx.value.Var<java.lang.String>
xpathExpressionProperty()
org.reactfx.value.Var<java.lang.String>
xpathVersionProperty()
-
Methods inherited from class net.sourceforge.pmd.util.fxdesigner.app.AbstractController
afterChildrenInit, getChildren, getDesignerRoot, initialize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sourceforge.pmd.util.fxdesigner.app.ApplicationComponent
getDebugName, getDesignerRoot, getLogger, getMainStage, isDeveloperMode, logInternalDebugInfo, logInternalException, logMessageTrace, logUserException, raiseParsableSourceFlag, raiseParsableXPathFlag
-
Methods inherited from interface net.sourceforge.pmd.util.fxdesigner.app.NodeSelectionSource
initNodeSelectionHandling
-
-
-
-
Field Detail
-
expressionTitledPane
public ToolbarTitledPane expressionTitledPane
-
exportXpathToRuleButton
public javafx.scene.control.Button exportXpathToRuleButton
-
-
Constructor Detail
-
XPathPanelController
public XPathPanelController(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<MainDesignerController>
-
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<MainDesignerController>
-
setFocusNode
public void setFocusNode(net.sourceforge.pmd.lang.ast.Node node)
Description copied from interface:NodeSelectionSource
Updates the UI to react to a change in focus node. This is called whenever some selection source in the tree records a change.- Specified by:
setFocusNode
in interfaceNodeSelectionSource
-
evaluateXPath
public void evaluateXPath(net.sourceforge.pmd.lang.ast.Node compilationUnit, net.sourceforge.pmd.lang.LanguageVersion version)
Evaluate the contents of the XPath expression area on the given compilation unit. This updates the xpath result panel, and can log XPath exceptions to the event log panel.- Parameters:
compilationUnit
- The AST rootversion
- The language version
-
runXPathQuery
public java.util.List<net.sourceforge.pmd.lang.ast.Node> runXPathQuery(net.sourceforge.pmd.lang.ast.Node compilationUnit, net.sourceforge.pmd.lang.LanguageVersion version, java.lang.String query) throws XPathEvaluationException
- Throws:
XPathEvaluationException
-
invalidateResultsExternal
public void invalidateResultsExternal(boolean error)
Called by the rest of the app.
-
showExportXPathToRuleWizard
public void showExportXPathToRuleWizard()
-
currentResultsProperty
public org.reactfx.value.Val<java.util.List<net.sourceforge.pmd.lang.ast.Node>> currentResultsProperty()
-
getXpathExpression
public java.lang.String getXpathExpression()
-
setXpathExpression
public void setXpathExpression(java.lang.String expression)
-
xpathExpressionProperty
public org.reactfx.value.Var<java.lang.String> xpathExpressionProperty()
-
getXpathVersion
public java.lang.String getXpathVersion()
-
setXpathVersion
public void setXpathVersion(java.lang.String xpathVersion)
-
xpathVersionProperty
public org.reactfx.value.Var<java.lang.String> xpathVersionProperty()
-
getChildrenSettingsNodes
public java.util.List<SettingsOwner> getChildrenSettingsNodes()
Description copied from interface:SettingsOwner
Gets the children of this node in order.- Specified by:
getChildrenSettingsNodes
in interfaceSettingsOwner
- Overrides:
getChildrenSettingsNodes
in classAbstractController<MainDesignerController>
-
-