Tutorials
WebSphereIn this tutorial you will learn about Content/code assist, Using content/code assist, Add and organize import declarations, Add Import, Adding required import statements,Organize Imports andOrganizing existing import statements.
If activated from a valid line of code in an editor, this command opens a scrollable list of available code completions. Some tips for using code assist:

Configure the behaviour of the content assist in the Editor preference page (Code Assist tab).
1. Place your cursor in a valid position on a line of code in an editor and either
If the Java editor finds valid candidates for this position, a list of possible completions is shown in a floating window. You can type further to narrow the list. You can also hover over the selected list items to view its Javadoc information, if it is available.
2. Use the arrow keys or the mouse pointer to navigate through the possible completions.
3. Select an item in the list to complete the fragment by doing one of the following:
Note: When a list item is selected, you can view any available Javadoc information for this item in hover help. Note that you must click an item to select it in the list before you can view Javadoc hover help for it.
Keyboard Shortcut: Ctrl + Shift + M
Creates an import declaration for a type reference currently selected. If the type reference if qualified, the qualification will be removed if possible. If the referenced type name can not be mapped uniquely to a type of the current project you will be prompted to specify the correct type. Add Import tries to follow the import order as specified in the Organize Import preference page
The Java editor can help you add required import statements for a selected type inside a compilation unit.
1. Select a reference to a type in your Java code, and do one of the following:

2. Either the editor can identify the type or you are prompted to choose the desired type from a list of possible types.
3. The import statement is generated and inserted as specified by the import order preference.
Keyboard Shortcut: Ctrl + Shift + O
Organizes the import declarations in the compilation unit currently open or selected. Unnecessary import declarations are removed, and required import declarations are ordered as specified in the Organize Import preference page (Window > Preferences > Java > Organize Import). Organize import can be executed on incomplete source and will prompt you when a referenced type name can not be mapped uniquely to a type in the current project. You can also organize multiple compilation units by invoking the action on a package or selecting a set of compilation units.
The Java editor can help you improve the existing import statements inside a compilation unit.
Do one of the following while editing your Java code:
Select Source > Organize Imports from the pop-up menu in the editor
Select Source > Organize Imports from the menu bar
Press Ctrl+Shift+O.

The Java editor generates a complete list of import statements, as specified by the import order preference, and new import statements replace the old ones.
Note: You can specify the order of the import declarations in Preferences (Window > Preferences > Java > Organize Imports).
_____________
Author: Mikalai Zaikin. Please Click Here to visit Authors site for any updates and changes to the study notes.