Class MainDesignerController
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.MainDesignerController
-
- All Implemented Interfaces:
javafx.fxml.Initializable,SettingsOwner
public class MainDesignerController extends java.lang.Object implements javafx.fxml.Initializable, SettingsOwner
Main controller of the app. Mediator for subdivisions of the UI.- Since:
- 6.0.0
- Author:
- Clément Fournier
- See Also:
NodeInfoPanelController,SourceEditorController,EventLogController,XPathPanelController
-
-
Constructor Summary
Constructors Constructor Description MainDesignerController(DesignerRoot owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBottomTabIndex()java.util.List<SettingsOwner>getChildrenSettingsNodes()Gets the children of this node in order.net.sourceforge.pmd.lang.LanguageVersiongetLanguageVersion()java.lang.StringgetRecentFiles()java.lang.StringgetXpathVersion()voidhandleSelectedNodeInError(java.util.List<net.sourceforge.pmd.lang.ast.Node> n)Handles nodes that potentially caused an error.voidhighlightXPathResults(java.util.List<net.sourceforge.pmd.lang.ast.Node> nodes)Replaces previously highlighted XPath results with the given nodes.voidinitialize(java.net.URL location, java.util.ResourceBundle resources)voidinvalidateAst()booleanisBottomTabExpanded()booleanisMaximized()org.reactfx.value.Val<net.sourceforge.pmd.lang.LanguageVersion>languageVersionProperty()voidonNameDeclarationSelected(net.sourceforge.pmd.lang.symboltable.NameDeclaration declaration)voidonNodeItemSelected(net.sourceforge.pmd.lang.ast.Node selectedValue)Executed when the user selects a node in a treeView or listView.voidrefreshAST()Attempts to refresh the AST with the up-to-date source, also updating XPath results.voidrefreshXPathResults()Refreshes the XPath results if the compilation unit is valid.voidresetSelectedErrorNodes()voidresetXPathResults()java.util.List<net.sourceforge.pmd.lang.ast.Node>runXPathQuery(java.lang.String query)Runs an XPath (2.0) query on the current AST.voidsetBottomTabExpanded(boolean b)voidsetBottomTabIndex(int i)voidsetLanguageVersion(net.sourceforge.pmd.lang.LanguageVersion version)voidsetMaximized(boolean b)voidsetRecentFiles(java.lang.String files)voidsetXpathVersion(java.lang.String version)voidshutdown()TextAwareNodeWrapperwrapNode(net.sourceforge.pmd.lang.ast.Node node)Returns a wrapper around the given node that gives access to its textual representation in the editor area.org.reactfx.value.Val<java.lang.String>xpathVersionProperty()
-
-
-
Constructor Detail
-
MainDesignerController
public MainDesignerController(DesignerRoot owner)
-
-
Method Detail
-
initialize
public void initialize(java.net.URL location, java.util.ResourceBundle resources)- Specified by:
initializein interfacejavafx.fxml.Initializable
-
shutdown
public void shutdown()
-
refreshAST
public void refreshAST()
Attempts to refresh the AST with the up-to-date source, also updating XPath results.
-
refreshXPathResults
public void refreshXPathResults()
Refreshes the XPath results if the compilation unit is valid. Otherwise does nothing.
-
wrapNode
public TextAwareNodeWrapper wrapNode(net.sourceforge.pmd.lang.ast.Node node)
Returns a wrapper around the given node that gives access to its textual representation in the editor area.
-
onNodeItemSelected
public void onNodeItemSelected(net.sourceforge.pmd.lang.ast.Node selectedValue)
Executed when the user selects a node in a treeView or listView.
-
onNameDeclarationSelected
public void onNameDeclarationSelected(net.sourceforge.pmd.lang.symboltable.NameDeclaration declaration)
-
runXPathQuery
public java.util.List<net.sourceforge.pmd.lang.ast.Node> runXPathQuery(java.lang.String query) throws XPathEvaluationExceptionRuns an XPath (2.0) query on the current AST. Performs no side effects.- Parameters:
query- the query- Returns:
- the matched nodes
- Throws:
XPathEvaluationException- if the query fails
-
handleSelectedNodeInError
public void handleSelectedNodeInError(java.util.List<net.sourceforge.pmd.lang.ast.Node> n)
Handles nodes that potentially caused an error. This can for example highlight nodes on the editor. Effects can be reset withresetSelectedErrorNodes().- Parameters:
n- Node
-
resetSelectedErrorNodes
public void resetSelectedErrorNodes()
-
resetXPathResults
public void resetXPathResults()
-
highlightXPathResults
public void highlightXPathResults(java.util.List<net.sourceforge.pmd.lang.ast.Node> nodes)
Replaces previously highlighted XPath results with the given nodes.
-
invalidateAst
public void invalidateAst()
-
getLanguageVersion
public net.sourceforge.pmd.lang.LanguageVersion getLanguageVersion()
-
setLanguageVersion
public void setLanguageVersion(net.sourceforge.pmd.lang.LanguageVersion version)
-
languageVersionProperty
public org.reactfx.value.Val<net.sourceforge.pmd.lang.LanguageVersion> languageVersionProperty()
-
getXpathVersion
public java.lang.String getXpathVersion()
-
setXpathVersion
public void setXpathVersion(java.lang.String version)
-
xpathVersionProperty
public org.reactfx.value.Val<java.lang.String> xpathVersionProperty()
-
getRecentFiles
public java.lang.String getRecentFiles()
-
setRecentFiles
public void setRecentFiles(java.lang.String files)
-
isMaximized
public boolean isMaximized()
-
setMaximized
public void setMaximized(boolean b)
-
isBottomTabExpanded
public boolean isBottomTabExpanded()
-
setBottomTabExpanded
public void setBottomTabExpanded(boolean b)
-
getBottomTabIndex
public int getBottomTabIndex()
-
setBottomTabIndex
public void setBottomTabIndex(int i)
-
getChildrenSettingsNodes
public java.util.List<SettingsOwner> getChildrenSettingsNodes()
Description copied from interface:SettingsOwnerGets the children of this node in order.- Specified by:
getChildrenSettingsNodesin interfaceSettingsOwner
-
-