blob: 9f4863e8b55a484f6ce8f0bab04a14cd87b69f0f [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, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
<title>
Creating a nested interface
</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script>
</head>
<body>
<h1>
Creating a nested interface
</h1>
<p>
You can create interfaces that are enclosed in other types (that is, nested interfaces).
</p>
<ol>
<li>
Open the
<a class="command-link" href='javascript:executeCommand("org.eclipse.ui.newWizard(newWizardId=org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard)")'>
<img src="PLUGINS_ROOT/org.eclipse.help/command_link.png">
<strong>New Java Interface</strong></a> wizard.
</li>
<li>
Edit the&nbsp;<strong>Source Folder</strong> field to indicate in which folder you want the new interface to reside. You can either type a path or click
the&nbsp;<strong>Browse</strong> button to find the folder. If a folder is found for the current selection, that folder appears in the
<strong>Source&nbsp;</strong>Folder field as the container for the new interface.
</li>
<li>
Select the&nbsp;<strong>Enclosing type</strong> checkbox.
</li>
<li>
In the&nbsp;<strong>Enclosing type</strong> field, type the name of the enclosing type or click the&nbsp;<strong>Browse</strong> button
to select the enclosing type for the new interface.
</li>
<li>
In the&nbsp;<strong>Name</strong> field, type a name for the new interface.
(Optionally, in a 5.0 project, add type parameters enclosed in <strong>&lt;</strong> and <strong>&gt;</strong>).
</li>
<li>
Select the <strong>public</strong> or <strong>default</strong> access modifier by using the&nbsp;<strong>Modifiers</strong> radio buttons.
</li>
<li>
Select the&nbsp;<strong>static</strong> checkbox if you want the new interface to be static.
</li>
<li>
Click the&nbsp;<strong>Add</strong> button to add interfaces for the new interface to extend.
(Optionally, in a 5.0 project, add type arguments enclosed in <strong>&lt;</strong> and <strong>&gt;</strong>).
</li>
<li>
Click&nbsp;<strong>Finish</strong> when you are done.
</li>
</ol>
<p>
<strong>Note</strong>: The new interface is created in the same compilation unit as its enclosing type.
</p>
<p>
<img src="../images/ngrelc.png" alt="Related concepts" border="0" >
</p>
<p>
<a href="../concepts/concepts-3.htm">Java projects</a>
</p>
<p>
<img src="../images/ngrelt.png" alt="Related tasks" border="0" >
</p>
<p>
<a href="tasks-21.htm">Creating a new Java interface</a><br>
<a href="tasks-23.htm">Creating a top-level interface</a><br>
<a href="tasks-25.htm">Creating a new interface in a compilation unit</a><br>
<a href="tasks-94.htm">Renaming a type</a>
</p>
<p>
<img src="../images/ngrelr.png" alt="Related reference" border="0" >
</p>
<p>
<a href="../reference/ref-127.htm">New Java Interface wizard</a><br>
<a href="../reference/ref-3.htm">Java Toolbar actions</a><br>
<a href="../reference/ref-view-package-explorer.htm">Package Explorer</a><a href="../reference/ref-view-package-explorer.htm"></a>
</p>
</body>
</html>