2 Replies Latest reply on Nov 2, 2009 1:22 PM by thisisme138

    Quick way to check and add imports?

    thisisme138

      Is there a way to check to see if you have missing imports and add them automatically?

       

      the Shift-Command-O shortcut removes all imports that aren't necessary in the file, but doesn't add them.

       

      Say I copy and paste a code block, but those classes that are needed aren't already imported. I would like a quick way to add those classes to the imports.

       

      Is that a current possibility?

        • 1. Re: Quick way to check and add imports?
          mewk Level 3

          If you paste in a block of code and are missing import statements, then when you save the file (assuming auto-build is checked), you'll get compiler errors. The easiest way, I find, to fix the import errors is to go to the line throwing an error, delete one letter from the end of a declared type and then auto complete the name (ctrl + space). Of course, this only work if the class can be found in your library or source paths.

           

          - e

          1 person found this helpful
          • 2. Re: Quick way to check and add imports?
            thisisme138 Level 1

            Not a bad way to go about it. Unless there is another shortcut that does it all automatically, I will be using that shortcut.

             

            Thanks!

             

            -John Brown