Package introspector.controller
Class ExportTreeController
java.lang.Object
introspector.controller.ExportTreeController
This controller defines how to export a tree into different formats.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExportTreeController(JFrame frame, List<JTree> trees) Constructor of the controller.ExportTreeController(JFrame frame, JTree tree) Constructor of the controller. -
Method Summary
Modifier and TypeMethodDescriptionbooleanexportToHtml(String filename, boolean expandSelectedNode) Exports the selected node to a HTML file.booleanexportToHtml(JLabel statusLabel, boolean expandSelectedNode) Exports the selected node to an HTML file and shows the success or failure message.booleanexportToTxt(String filename, boolean expandSelectedNode) Exports the selected node to a text file.booleanexportToTxt(JLabel statusLabel, boolean expandSelectedNode) Exports the selected node to a text file and shows the success or failure message.static StringremoveFileExtension(String fileName) Removes the extension of a file name.
-
Field Details
-
trees
The tree views associated with the action -
frame
The parent frame
-
-
Constructor Details
-
ExportTreeController
Constructor of the controller.- Parameters:
frame- the parent frametrees- the JTrees where the tree is displayed
-
ExportTreeController
Constructor of the controller.- Parameters:
frame- the parent frametree- the JTree where the tree is displayed
-
-
Method Details
-
exportToTxt
Exports the selected node to a text file.- Parameters:
filename- the name of the text file.expandSelectedNode- true means it is the selected node to be exported; false is the whole tree- Returns:
- whether the export action was successful.
-
exportToTxt
Exports the selected node to a text file and shows the success or failure message.- Parameters:
statusLabel- the label where the success or failure message is shownexpandSelectedNode- true means it is the selected node to be exported; false is the whole tree- Returns:
- whether the export action was successful.
-
exportToHtml
Exports the selected node to a HTML file.- Parameters:
filename- the name of the HTML file.expandSelectedNode- true means it is the selected node to be exported; false is the whole tree- Returns:
- whether the export action was successful.
-
exportToHtml
Exports the selected node to an HTML file and shows the success or failure message.- Parameters:
statusLabel- the label where the success or failure message is shownexpandSelectedNode- true means it is the selected node to be exported; false is the whole tree- Returns:
- whether the export action was successful.
-
removeFileExtension
Removes the extension of a file name.- Parameters:
fileName- the name of the file- Returns:
- the name of the file without the extension
-