| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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 new source folder with exclusion filter |
| </title> |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| </head> |
| <body> |
| <h1> |
| Creating a new source folder with exclusion filter |
| </h1> |
| In a project that uses source folders, you can create a new folder to contain Java source code with exclusion patterns. Exclusion |
| patterns are useful if you have nested source folders. There are two ways to do it: |
| <ol> |
| <li>You don't already have an existing Java project in which you want to create a source folder with exclusion pattern.</li> |
| <li>You already have an existing Java project.</li> |
| </ol> |
| <h2>Starting from scratch</h2> |
| <ol> |
| <li>First follow the steps of the task "Creating a new source folder".</li> |
| <li>Once a first source folder is created, if you want to create another source folder that is nested inside the first one, you |
| need to use the exclusion pattern. |
| </li> |
| <li> |
| Open the <a href="../reference/ref-123.htm">Java Build Path</a> page <strong>(Project > Properties > Java Build Path)</strong> and click the <strong>Source</strong> tab. |
| </li> |
| <li> |
| Click <strong>Add Folder</strong>, select an existing source folder, and click <strong>Create New Folder</strong> to create a folder that is nested inside the first one. |
| </li> |
| <li>You will get a dialog saying that exclusion filter has been added to the first source folder. |
| <blockquote>NOTE: The trailing '/' at the end of the exclusion pattern <b>is required</b> to exclude the children of this folder. |
| The exclusion pattern follows the ant exclusion pattern syntax. |
| </blockquote> |
| </li> |
| <li> |
| Click <strong>OK</strong> and <strong>Finish</strong> when you are done. |
| </li> |
| </ol> |
| <h2>From an existing Java Project</h2> |
| <ol> |
| <li>Before you start, make sure that your project properties are enabled to handle exclusion filters in source folders. |
| </li> |
| <li> |
| In the Package Explorer, select the project where you want the new source folder to reside. |
| </li> |
| <li> |
| From the project's pop-up menu, select <strong>New</strong> > <strong>Source Folder</strong>. The New Source Folder wizard opens. |
| </li> |
| <li> |
| In the <strong>Project Name</strong> field, the name of the selected project appears. If you need to edit this field, you can either type a path or |
| click <strong>Browse</strong> to choose a project that uses source folders. |
| </li> |
| <li> |
| In the <strong>Folder Name</strong> field, type a name for the new source folder. If you choose a path that is nested |
| inside an existing source folder, you will see an error saying that you have nested source folders. |
| </li> |
| <li> |
| Check <strong>Update exclusion filters in other source folders to solve nesting</strong>. |
| </li> |
| <li> |
| Click <strong>Finish</strong> when you are done. |
| </li> |
| </ol> |
| <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-11.htm">Creating Java elements</a><br> |
| <a href="tasks-12.htm">Creating a new Java project</a><br> |
| <a href="tasks-15.htm">Creating a new Java package</a><br> |
| <a href="tasks-13.htm">Creating a Java project as its own source container</a><br> |
| <a href="tasks-14.htm">Creating a Java project with source folders</a><br> |
| <a href="tasks-26.htm">Creating a new source folder</a> |
| </p> |
| <p> |
| <img src="../images/ngrelr.png" alt="Related reference" border="0" > |
| </p> |
| <p> |
| <a href="../reference/ref-128.htm">New Source Folder 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> |
| </p> |
| |
| </body> |
| </html> |
| |