blob: 6c45052c12146247374ac5e8779ffa772f1135ff [file]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="copyright" content=
"Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." />
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type=
"text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>
Navigate to a Java element's declaration
</title>
<script language="JavaScript" type="text/javascript" src=
"PLUGINS_ROOT/org.eclipse.help/livehelp.js">
</script>
</head>
<body>
<h1>
Navigate to a Java element's declaration
</h1>
<p>
In this section, you will learn how to open a type in the Java Editor and
how to navigate to related types and members.
</p>
<ol>
<li>Open the <strong>Open Type</strong> dialog by pressing
<kbd>Ctrl+Shift+T</kbd>, choosing <strong>Navigate &gt; Open
Type...</strong>, or clicking the toolbar icon (<img src=
"../images/org.eclipse.jdt.ui/etool16/opentype.svg" alt=
"Open Type toolbar button" />). Type <kbd>Money</kbd>, press the
<kbd>Arrow Down</kbd> key a few times to select <em>MoneyTest</em>, and
then press <kbd>Enter</kbd> to open the type in the Java editor.
<p>
<img src="images/navigate_opentype.png" alt="Open Type dialog" />
</p>
</li>
<li>On the first line of the <em>MoneyTest</em> class declaration, select
the superclass <em>TestCase</em> and either
<ul>
<li>from the menu bar select <strong>Navigate &gt; Open
Declaration</strong> or
</li>
<li>press <kbd>F3</kbd>.
</li>
</ul>
<p>
<img src="images/navigate_opendeclaration.png" alt=
"Menu open declaration" />
</p>The TestCase class opens in the editor area and is also represented
in the Outline view.<br />
<em>Note: This command also works on methods and fields.</em>
<p>
<img src="images/editor_testcase.png" alt="Opened declaration" />
</p>
</li>
<li>With the <em>TestCase.java</em> editor open and the class declaration
selected:
<ul>
<li>from the menu bar select <strong>Navigate &gt; Open Type
Hierarchy</strong> or
</li>
<li>press <kbd>F4</kbd>.
</li>
</ul>
<p>
<img src="images/navigate_open_typehieracrchy.png" alt=
"Menu open type hierarchy" />
</p>
</li>
<li>The Type Hierarchy view opens with the TestCase class displayed.
<p>
<img src="images/view_typehierarchy_testcase.png" alt=
"Type Hierarchy view" />
</p><em>Note: You can also open editors on types and methods in the
Type Hierarchy view.</em>
</li>
</ol>
<p class="nav_footer" id="nav_footer">
Next Section: <a href="qs-6.htm">Viewing the type hierarchy</a>
</p>
<h3 class="related">Related tasks</h3>
<a href="../tasks/tasks-73.htm">Opening an editor for a selected
element</a><br />
<h3 class="related">Related references</h3>
<a href="../reference/views/ref-type-hierarchy.htm">Type Hierarchy
View</a><br />
</body>
</html>