Java Reference
In-Depth Information
2.1.3
Using the editor tabs
The
IDEA
editor is tab-based. Each file you open is displayed in its own tab of the
editor window using the name of the file as the name of the tab. Hover your
mouse pointer over the tab to display a tool-tip containing the full path to the
source file. This information is also shown in the editor's title bar, but often it's
too long to display in its entirety. Clicking a tab switches the main window to the
contents of that file, allowing you to work on it. Your cursor position, history,
undo, and other elements are tied to the file, allowing you switch back and forth
between tabs without losing your place within a given file.
By default, the editor's tabs appear at the top of the editor, but you can change
their location through the
Appearance
options of the
IDE
settings panel. The
option
Editor tab placement
lets you move the tabs to the bottom, left side, or
right side of the window. Placing the tabs on the left or right potentially wastes a
lot of space on the screen, but you'll have to try it for yourself.
To select the current file for editing, click the tab to bring its contents to the
front. In addition to clicking a tab to change the active document, you can use the
keyboard shortcuts
Alt+Right arrow
and
Alt+Left arrow
to move through the edi-
tor tabs. Doing so lets you switch to another tab without having to use the mouse.
Moving between tabs
There are a number of ways to move between the currently open files in the edi-
tor, as summarized in table 2.1. It's important to understand the difference
between the
Next/Previous Tab
and
Back/Forward
commands. The
Next/Previ-
ous Tab
commands move back and forth through the editor's tabs in the order
they appear on the screen. These options provide a quick way to navigate back to
a specific file without having to step through a navigation history. Alternatively,
View | Recent Files
(
Ctrl+E
) brings up a keyboard-navigable pop-up window
displaying the most recently opened files. When you're moving between editor
tabs,
IDEA
remembers your cursor's position within each opened file.
The
Back/Forward
commands don't pay attention to on-screen tab order, but
rather move back and forth through your navigation history (much like a web
browser). As you work on a Java project, you'll naturally jump from location to
location, from file to file, in the course of editing.
IDEA
keeps track of these loca-
tions and lets you navigate through the list using the
Back
and
Forward
com-
mands. The
Back/Forward
navigation commands are analogous to the
Undo/
Redo
option for your navigation history, with the following distinction:
Back
and
Forward
control editor focus, whereas
Undo
and
Redo
alter your code by rolling
back or reapplying changes.