Book Image

Getting Started with Eclipse Juno

By : Rodrigo Fraxino Araujo, Vinicius H. S. Durelli, Rafael M. Teixeira
Book Image

Getting Started with Eclipse Juno

By: Rodrigo Fraxino Araujo, Vinicius H. S. Durelli, Rafael M. Teixeira

Overview of this book

<p>Integrated Development Environments (IDEs) such as Eclipse are examples of tools that help developers by automating an assortment of software development-related tasks. By reading this book you will learn how to get Eclipse to automate common development tasks, which will give you a boost of productivity.<br /><br />Getting Started with Eclipse Juno is targeted at any Java programmer interested in taking advantage of the benefits provided by a full-fledged IDE. This book will get the reader up to speed with Eclipse’s powerful features to write, refactor, test, debug, and deploy Java applications.<br /><br />This book covers all you need to know to get up to speed in Eclipse Juno IDE. It is mainly tailored for Java beginners that want to make the jump from their text editors to a powerful IDE. However, seasoned Java developers not familiar with Eclipse will also find the hands-on tutorials in this book useful.</p> <p><br />The book starts off by showing how to perform the most basic activities related to implementing Java applications (creating and organizing Java projects, refactoring, and setting launch configurations), working up to more sophisticated topics as testing, web development, and GUI programming.</p> <p><br />This book covers managing a project using a version control system, testing and debugging an application, the concepts of advanced GUI programming, developing plugins and rich client applications, along with web development.</p>
Table of Contents (17 chapters)
Getting Started with Eclipse Juno
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
4
Version Control Systems
Index

File editor shortcuts


In this section, we'll present some shortcuts that can be useful when using file editors. Mastering them can ease tasks such as code editing, navigation, and code generation.

Code edition shortcuts

The following table contains some of the most used shortcuts related to code editing:

Shortcut

Purpose

Ctrl + C

Copy

Ctrl + X

Cut

Ctrl + V

Paste

Ctrl + Z

Undo

Ctrl + Y

Redo

Ctrl + F

Find/replace

Ctrl + D

Deletes the current line

Alt + up arrow

Alt + down arrow

Moves the current line up or down

Ctrl + Shift + Delete

Deletes the current line's content after the caret

Ctrl + Shift + C

Comments/uncomments the currently selected lines by adding "//"

Ctrl + Shift + /

Comments the current selection by adding /* … */

Alt + Shift + J

Generates element comment to the currently selected element

Ctrl + Shift + B

Adds/removes breakpoint in the current line

Tab

Shift + Tab

Increases/decreases the selected lines' indentation

Ctrl + I

Fixes the selected lines' indentation

Ctrl + Shift + up arrow

Expands the current selection to enclosing element (selects whole method if a portion of the method's code is selected, for example)

Ctrl + Shift + left arrow

Ctrl + Shift + right arrow

Expands the current selection to next/previous element

Code generation and code refactoring shortcuts

As we have seen in Chapter 2, Java Development, Eclipse can generate and refactor code for you. It can perform tasks such as creating method snippets, organizing a class' imports, among others. The following table shows some shortcuts for these tasks:

Shortcut

Purpose

Alt + Shift + R

Renames the currently selected method

Alt + Shift + M

Extracts the current selection to a method

Alt + Shift + O

Organizes imports

Alt + Shift + F

Formats the selection

Alt + Shift + S

Opens the Source dialog (allows generating getters/setters, constructors, to String methods, and so on)

Ctrl + 1

Opens the Quick Fix dialog

Code navigation shortcuts

In big projects, navigating through your source code can be a painful task. Big and numerous source files make it hard to find what you want. Having the following shortcuts under your sleeve might be handy:

Shortcut

Purpose

Ctrl + Shift + up arrow

Ctrl + Shift + down arrow

Moves to next/previous element of the source code (parameter, method, and so on)

Ctrl + Shift + P

When a bracket is selected, it goes to matching bracket

Ctrl + L

Goes to a line

Ctrl + Q

Goes back to last edit location

Ctrl + .

Ctrl + ,

Goes to next/previous annotation (warnings, errors, and so on)

Ctrl + Page Up

Ctrl + Page Down

Goes to next/previous editor window

Ctrl + left-click

When a class name is selected, opens its source code (if available in workspace)

Ctrl + Shift + T

Open Type – Allows you to search workspace's classes by name

Ctrl + Shift + R

Open the Resource—Allows you to search workspace's resources by name

Java shortcuts

The following Java-specific shortcuts are also very useful:

Shortcut

Purpose

F2

Opens the currently selected class' JavaDoc in a tooltip box

F3

Goes to the currently selected element definition (class definition if class is selected, variable declaration if variable is selected)

F4

Opens the Type Hierarchy view for the currently selected class

Ctrl + O

Opens the outline tooltip box for the class currently being edited

Ctrl + Alt + H

Opens the Call Hierarchy view for the method currently being edited