Issue
I'm working in an old application that's been written in Swing, and I'm moving it to JavaFX. Because of that I have a misfortune of having many classes that have the same names, but are from different packages. For example:
javafx.event.ActionEvent
java.awt.event.ActionEvent
On more then one occasion I've asked IntelliJ to import the wrong one and spend a lot of time on figuring out why my controllers aren't working, only to find out I used wrong ActionEvent
. Like fellow in this question: Error resolving "onAction" while loading FXML
So I've begin to wonder if there's an option to foolproof it for the future. Like telling IntelliJ, in which order it should suggest imports, so that all that's under javafx
would be suggested before java.awt
. Alternatively display a warning (but preferably an error) each time anything from some package is imported.
Solution
Sounds like a job for the Preferences | Editor | General | Auto Import page's list of exclusions. See documentation.
Answered By - nitind
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.