Building an Application from Scratch
This section builds a Mac OS X application from scratch. It will start with the base SimpleEdit JAR file that was built in Chapter 4 and Chapter 5, and then add the necessary elements to convert it to a full Mac OS X application bundle. It will build out the directory structure shown in Figure 7-5; you might want to refer to this figure as you walk through this example.

Figure 7-5. Minimal directory structure
Directory Layout
Create a new folder called
SimpleEdit in your home directory
(~) by using the Finder. Add a folder inside this
new directory called Contents
. This is where you’ll
add the Info.plist file. Next,
create a MacOS
folder (no space) inside the Contents directory. Here, add a
“stub” file that acts as a native
launcher stub for the application.
Create a Resources folder inside Contents. This is where you will add an icns file, an icon that will be displayed in the Finder and standard file dialogs. Finally, add a Java directory to the Resources folder. This is where you’ll put the required Java libraries (JAR files).
Property List
Directly inside the Contents folder, add an Info.plist file with the contents shown back in Example 7-2.
Tip
Several of the properties are already set, including the main class and some arguments passed in to load SimpleEdit plug-ins (specifically, the SimpleEdit plug-ins developed in Chapter 9). Understanding ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access