Java Reference
In-Depth Information
Implement methods
—Available in classes that implement an interface or
whose superclass is abstract and that haven't implemented all the required
methods. Creates stub method implementations. Equivalent to the com-
mand
Code | Implement Methods
.
■
Implement abstract method
—Active when inside an abstract method of
an abstract class. Locates classes that extend the abstract class and stubs
out the method in them, if they haven't implemented it already. This is
useful when you're adding a new method to an abstract class with a num-
ber of existing concrete classes.
■
The following are common variable- and assignment-related intentions:
Split declaration
—Available during a variable declaration and assignment
operation, for example
int count = 0
. Splits the operation into two lines
of code: declaration of the variable alone, followed by an assignment of the
value to the variable on the next line.
■
Va r i a b l e t y p e f i x
—Changes a variable's declared type to be compatible with
an assignment operation. For example, if you try to assign a
boolean
to an
int
variable, this action changes the declared variable type to
boolean
.
■
Create field from parameter
—Appears inside an object's constructor that
has unused parameters. Creates a new field (an instance variable) based on
the unused parameter, and uses the constructor to initialize its value.
■
Create field/variable/parameter from usage
—Introduces a new variable
based on an assignment or usage in context. Depending on the context,
you can create fields, local variables, and method parameters.
■
Finally, here are a few other intention actions you'll probably encounter:
Fetch external resource
—Appears in the
XML
editor when the document
references an external resource, such as a
DTD
. Downloads the resource to
the local server so that
IDEA
may use it for validation purposes. You can
review or edit the selection in the Resources area of the
IDEA
settings.
■
Ignore external resource
—Like the previous action, but tells
IDEA
to not
attempt to validate against the resource nor warn you about it in the
future. To un-ignore a resource, remove it from the ignore list in the
Resources
area of the
IDEA
Settings.
■
Invert if condition
—Available on conditional statements (position your
caret at the
if
keyword to activate). Inverts the condition, and swaps the
■