|
Starting A New Programming Project
In JDeveloper, you use
workspaces to keep track of the projects you'll use while developing your Java
program. You use projects to keep track of the related files that together make
up an application or applet.
When
organizing your work in the workspace, you can:
Create a new workspace
To create a new workspace:
1.Choose File | New Workspace.
2.If you have unsaved files remaining in the current workspace,
you will be prompted to save them now. After selecting which to save, click
OK.
The current
workspace closes and a new workspace with the default name
Untitled.jws
appears in the Navigator.
Open an existing workspace
To open an existing workspace, whether recently
opened or not:
1.Choose File | Open.
2.In the File Open/Create dialog, select the appropriate
workspace.
3.Click Open.
To open an existing workspace
that was recently opened:
1.Choose File | Reopen.
2.From the submenu, select the appropriate workspace from the
listing at the top .
If the workspace
you want to use does not appear in the Reopen submenu, use the
File | Open command instead.
Whenever you open another workspace,
the current workspace closes.
Save a workspace configuration
To save a workspace configuration:
1.Arrange the open windows as you want them to appear when you
next open the workspace.
2.Choose File | Save Workspace.
If you haven't saved the workspace
before, you will be prompted to do so now.
Using Save Workspace
saves the workspace file and its configuration only: it does not save the files
contained within it. To save the files within a workspace, use Save All.
Add projects to the workspace
You can add
existing projects to your workspace in three ways:
1.By using the File | Open command
To add a project using the File | Open command:
1.Check that the Workspace tab in the Navigator
is selected.
2.Select the workspace.
3.Choose File | Open to display the File
Open/Create dialog.
4.From the Files of Type dropdown list, select
Java Projects to display only JDeveloper project files.
5.Select the project (.jpr)
file you want to open.
Note that, by default, the
Add to Project checkbox at the bottom of the dialog is selected.
6.Click Open.
2.By using the Add button
To add a project using the Add button:
1.Check that the Workspace tab in the Navigator
is selected.
2.Select the workspace.
3.Click the Add to Workspace or Project button
( ).
4.In the File Open/Create dialog, select Java Projects
from the Files of Type dropdown list to display only JDeveloper
project files.
5.Select the project (.jpr)
file you want to open.
Note that, by default, the
Add to Project checkbox at the bottom of the dialog is selected.
6.Click Open.
3.By browsing the directory tree
To add a project by browsing the directory tree:
1.In the Navigator, select the Directory tab.
2.In the directory tree, double-click the directories or click the
navigation buttons above the directory tree to navigate to the project you want
to open.
3.Drag the project file over the Workspace tab.
To add the project to your opened
list, drag the project file over the Opened tab.
Remove projects from the workspace
A project
contains the set of files that together make up a JDeveloper application or
applet. If you no longer need a particular project, you can remove it from the
workspace.
You can remove
projects from the workspace in two ways:
1.By using the Remove Project command on the context menu
To remove a project using the Remove Project
command:
1.Check that the Workspace tab in the Navigator
is selected.
2.Right-click on the project in the Navigator.
3.Choose Remove Project.
When you remove a project from the
workspace, it is not removed from the hard drive.
2.By using the Remove button
To remove a project using the Remove button:
The
Remove from Workspace or Project button is available only on the
Workspace tab or in the Navigator. On the Opened
tab, the button changes to Remove from Opened List.
1.Check that the Workspace tab in the Navigator
is selected.
2.Select the project you want to remove from the workspace.
3.Click Remove from Workspace or Project button ( ).
When you remove a project from the
workspace, it is not removed from the hard drive.
Removing a project from your
workspace doesn't delete the project from your hard drive: it simply takes it
out of the workspace's file list.
Save a workspace
To save all the files in a current workspace,
including all projects:
To save a particular project,
including its dependent files, you will need to save the entire workspace within
which the project resides.
Using Save or
Save As on a selected project node saves or duplicates the
project file only: it does not save or duplicate the files within the project.
Using Save Project, whether with the project node or any of its
contained files selected, also saves only the project file itself, and none of
its contained files.
While
working with projects, you can:
Create a new project
To create a new
project with custom settings, use the Project Wizard. To create a new project
with default settings you bypass the wizard.
To create a new empty project with default settings:
�
Choose File | New Empty Project.
A new empty
project appears in the Navigation pane. To alter project properties,
double-click on the filename.
To create a new project with
custom settings:
1.Choose File | New Project.
2.Click Next.
3.Select where you want the project files to be stored. If you
aren't sure, click Browse to find an appropriate directory.
4.Select the type of program you want to create in the project.
The selection you
make will determine what wizard will be displayed when you finish with the
Project Wizard. If you choose to create an empty project, no wizard will be
launched when you finish with the Project Wizard.
5.Click Next.
6.Enter a default package, the project's source root, and the
output directory of the project.
The default
package will be included in the package statement for the Java files in this
project. The Java files will be stored in the source root, and the class files
(the compiled
.java
files) will be placed in the output directory.
7.Click Next.
8.Enter descriptive information about the project. Check the
Generate Project HTML file checkbox if you want an HTML file
containing information about your project to be automatically created.
These fields are
not required, but you can use them to automatically generate header comments in
each of the class files you create for this project.
9.Click Next.
The Finish page
is displayed. It shows you the details of your project. If you need to make any
changes, click Back. If the project is correct, click
Finish.
The Project
Wizard automatically builds a project file one level up from the specified
package directory, ready for files to be added. The project is displayed in the
Navigator.
Depending on what type of project you
built, other wizards (such as the Frame Wizard) may be launched.
Open an existing project
There are three
ways to open an existing project:
1.By using the Open Project button
To open a project using the Add button:
1.Click the Workspace tab in the Navigator.
2.Click Add to Workspace or Project ( ).
3.In the File Open/Create dialog, select Java Projects
from the Files of Type dropdown list to display only
JDeveloper project files.
4.By default, the Add to Workspace checkbox
should be selected.
5.Select a project file.
6.Click Open.
2.By using the File | Open command
To open a project using the File | Open command:
1.Choose File | Open to display the File
Open/Create dialog.
2.From the Files of Type dropdown list, select
Java Projects to display only JDeveloper project files.
3.Select the .jpr
file you want to open.
4.If you want to add the project to the current workspace, check
Add to Workspace.
5.Click Open.
3.By browsing the directory tree
To open a project using the directory tree:
1.
Click the Directory tab.
The directory tree is displayed in
the Navigation pane.
2.In the directory tree, double-click the directories, or click
the navigation buttons above the directory tree, to navigate to the project you
want to open.
3.Drag the project file over the Opened tab.
The project is added to your list of
opened files. To add the project to your workspace, drag the project file icon
over the Workspace tab at the bottom of the Navigator.
Save a project
To save all the files in a current workspace,
including all projects:
To save a particular project,
including its dependent files, you will need to save the entire workspace within
which the project resides.
Using Save or
Save As on a selected project node saves or duplicates the
project file only: it does not save or duplicate the files within the project.
Using Save Project, whether with the project node or any of its
contained files selected, also saves only the project file itself, and none of
its contained files.
Create a new file
To create a new file:
1.Choose File | New.
The Object Gallery opens.
2.Select the tab corresponding to the type of file you wish to
create. For more information on file types, click Help from
within the corresponding page.
Add files to a project
When you create a
new file, the file is added to the active project automatically. The node for
the active project appears in bold in the Navigator. You can also explicitly add
existing files to your project in three ways:
1.By using the File | Open command
To add files to a project using the File menu:
1.Check that the Workspace tab in the Navigator
is selected.
2.Select the project to which you want to add the file(s).
3.Choose File | Open.
4.In the File Create/Open dialog, use the file browser to locate
and select the file you want to add.
Note that, by
default, the Add to Project checkbox at the bottom of the
dialog is selected.
5.Click Open.
2.By using the Add button
To add files to a project using the Add button:
1.Check that the Workspace tab in the Navigator
is selected.
2.Select the project to which you want to add the file(s).
3.Click the Add to Project or Workspace button ( ).
4.In the File Create/Open dialog, use the file browser to locate
and select the file you want to add.
Note that, by
default, the Add to Project checkbox at the bottom of the
dialog is selected.
5.Click Open.
3.By using either the Directory or the Opened list
To add files to a project using the Directory List:
1.In the Navigator, with the Workspace tab
selected, click on the project node to select the project you want to add files
to.
2.Select the Directory tab.
3.Use the directory tree to navigate to the file you want to add
to the project.
4.Drag the file icon from the directory tree to the
Workspace tab.
To add files to a project
using the Opened List:
1.In the Navigator, with the Workspace tab
selected, click on the project node to select the project you want to add files
to.
2.Select the Opened tab.
3.Drag any of the file icons onto the Workspace
tab.
Remove files from a project
If you no longer
want to use a file in your project, you can remove it to reduce clutter and
avoid confusion. You can remove files from the project list in two ways:
1.By using the File | Remove command on the File menu
To remove a file using the File | Remove File
command:
1.Check that the Workspace tab in the Navigator
is selected.
2.Select the file you want to remove.
3.Choose File | Remove File.
2.By using the Remove button
To remove a file using the Remove button:
The
Remove from Workspace or Project button is available only on the
Workspace tab or in the Navigator. On the Opened
tab, the button changes to Remove from Opened List.
1.Check that the Workspace tab in the Navigator
is selected.
2.Select the file you want to remove from the project.
3.Click Remove from Workspace or Project button ( ).
Removing a file from your project
doesn't delete the file: it simply takes it out of the project's file list.
After you remove the file from your project, you can delete the file normally
using the standard method for your operating system.
Set the properties for individual projects
You can set project properties for
individual projects, replacing any default properties that may have been set
across projects, in the Project Properties dialog.
To
customize the default properties for all projects,
use the Default Project Properties dialog instead.
To view or change the settings
for a particular project:
1.Select the project in the Navigation pane.
2.Choose Project | Project Properties
from the main menu, or right-click the project to access its context menu and
choose Properties, or double-click on the project node itself.
Customize the default properties for all subsequent projects
You can set the
project properties for all projects in the Default Project Properties dialog.
The defaults you designate will apply to all projects subsequently created. To
replace these default settings for any individual project, use the Project
Properties dialog instead.
To view or change the default settings for all
projects:
1.Choose Tools | Default Project Properties.
The Default Project Properties dialog
box opens.
2.Select the appropriate tab.
The current default settings are
displayed.
3.Set the various properties just as you do for individual projects in the Project Properties
dialog.
For further details while in the IDE,
click Help.
4.When finished, click OK.
|