Jesktop Developer Documentation |
IntroductionJesktop applications ship in jars. The jar must contain a manifest that Jesktop can pick up on so that it know's what's inside the jar. Jesktop's manifest is placed in a directory called JESKTOP-INF inside the jar. The file name of the manifest is applications.xml and it is in XML format. A simple exampleThis xml file contains details of the application that may be included in the jar. Here is an example: <?xml version="1.0"?> <applications> <application single-instance="true"> <display-name>Frimble Demo2</display-name> <launchable-target-name>Demos/FrimbleDemo2</launchable-target-name> <class>org.jesktop.frimble.demo2.FrimbleDemo2</class> </application> </applications> That this says is that there is one application in the jar. It's name for the purposes of lookup is Demos/FrimbleDemo2, it has a certain class for launching and that Jesktop should ponly allow a single instance to run at any one time. A more complex exampleThis example details four other concepts.
The example: <?xml version="1.0"?> <applications> <default-application target-name="Tools/Clock" icon32="net/jesktop/apps/clock/Clock.gif" icon16="net/jesktop/apps/clock/ClockSmall.gif"/> <application> <display-name>Clock</display-name> <launchable-target-name>Tools/Clock</launchable-target-name> <class>org.jesktop.apps.clock.Clock</class> </application> <application> <display-name>Directory Explorer</display-name> <launchable-target-name>Tools/DirectoryExplorer</launchable-target-name> <class>org.jesktop.windowmanagers.DirectoryExplorer</class> </application> <application> <display-name>Text Viewer</display-name> <launchable-target-name>Tools/TextViewer</launchable-target-name> <class>org.jesktop.apps.notepad.TextViewer</class> </application> <application> <display-name>Image Viewer</display-name> <launchable-target-name>Tools/ImageViewer</launchable-target-name> <class>org.jesktop.apps.imageviewer.ImageViewer</class> <application-config-file>net/jesktop/apps/imageviewer/ImageViewer.xml</application-config-file> </application> <application> <display-name>Drag Monitor</display-name> <launchable-target-name>Tools/Misc/DragMonitor</launchable-target-name> <class>org.jesktop.apps.misc.DragMonitor</class> </application> </applications> The application specific file for Imageviewer. The file name is net/jesktop/apps/imageviewer/ImageViewer.xml: <?xml version="1.0"?> <application> <icons icon32="net/jesktop/apps/imageviewer/ImageViewer32.gif" icon16="net/jesktop/apps/imageviewer/ImageViewer16.gif" /> </application> Additional JarsEach jar that contains application may also contain other jars containing classes or resources that must be mounted in the classpath during execution. The following snippet illustrates Sun's XML parser and how an manifests may specify them as contained within the distribution. They follow the applications element in the applications.xml manifest. <additional-jars> <jar where="contained">lib/jaxp.jar</jar> <jar where="contained">lib/parser.jar</jar> </additional-jars> This additional jar element may also indicate jars that are not contained within the distribution jar. The following shows this in use: <additional-jars> <jar where="remote">http://somewhere.com/some/thing.jar</jar> </additional-jars> RulesThere are a number of rules to the use of this manifest.
Interoperation with the normal jar manifestIf you want to have an application that is dual mode in that it can run standalone as well as inside Jesktop, you'll want to have a META-INF/manifest.mf file that specifies the executable nature of the jar. This normal Java feature is completely supported. |
Copyright (c) 2004 The Jesktop Project Committers. All rights reserved.
Hosting provided by : | Jesktop API SourceForge project page |