EGL can automatically organize the import statements
in your code.
Organizing import statements
involves reordering and grouping the statements by the package name.
Also, EGL removes unnecessary import statements
from your code.
To set preferences for organizing the
import statements
in your code, do as follows:
- From the main menu, click . The Preferences window
is displayed.
- In the Preferences window, expand and
click Organize Imports. The Organize
Imports pane is displayed.
- On the Organize Imports pane of the Preferences window,
set the order for import statements in the
list of package names:
- To add a new import statement (package or prefix) to the list,
click New and type the new name. You can use
the asterisk character as a wild card at the end of the package name.
- To edit an import statement, select the name of the package or
prefix name and click Edit.
- To remove an import statement from the import list, select the
name of the package or prefix and click Remove.
- To reorder the import statements, click a package or prefix in
the list to select it and then click Up or Down.
- To import an import statement, click Import and
specify the XML file that contains the import statement to be imported.
- To export an import statement, click Export and
specify the location and name of the XML file to contain the import
statement.
- In the Number of imports needed field,
enter the minimum number of individual import statements
in the same package to simplify into an import statement
with a wild card character. For example, your file might
have the following similar import statements:
import com.mypackage.myPart1;
import com.mypackage.myPart2;
import com.mypackage.myPart3;
If you set the Number
of imports needed field to 3, the editor
will simplify these import statements into
the following single import statement:import com.mypackage.*;
- To save the changes and remain in the Preferences window,
click Apply. To save the changes and exit the
window, click OK.
To organize your import statements,
open a source file in the editor, right-click the file, and then click Organize
Imports. Alternatively, you can organize the import statements
for every file in a project or package by right-clicking the project
or package in the Project Explorer view and then clicking Organize
Imports.