blob: 907da4973f978c0348ac2e1c92a8dc82b10fef93 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2007. 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=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>
Navigate to a Java element's declaration
</title>
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script>
</head>
<body>
<h1>
Navigate to a Java element's declaration
</h1>
<ol>
<li> Open the
<a class="command-link" href='javascript:executeCommand("org.eclipse.jdt.ui.commands.openElementInEditor(elementRef=JUnit/junit.samples.money.MoneyTest)")'>
<img src="PLUGINS_ROOT/org.eclipse.help/command_link.png" alt="Open file">
<em>junit.samples.money.MoneyTest.java</em></a>
file in the Java editor.
</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 Navigate &gt; Open Declaration 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 Navigate &gt; Open Type Hierarchy 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 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 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>
<p>
<img src="../images/ngrelt.png" alt="Related tasks" border="0" >
</p>
<p>
<a href="../tasks/tasks-73.htm">Opening an editor for a selected element</a><br>
</p>
<p>
<img src="../images/ngrelr.png" alt="Related reference">
</p>
<p>
<a href="../reference/ref-type-hierarchy.htm">Type Hierarchy View</a><br>
</p>
</body>
</html>