org.ananas.mac.menu
Class ApplicationItemFactory

java.lang.Object
  |
  +--org.ananas.mac.menu.ApplicationItemFactory

public final class ApplicationItemFactory
extends java.lang.Object

This class provides a set of methods to create "application-smart" menu items.

An "application-smart" menu item is a menu item that will appear in in the application menu under MacOS. It will be managed as a regular menu under other OS.

You can force the use of regular menu items by setting the org.ananas.mac.menu.forcePortable system property to true. This is useful for testing on MacOS that the menu behaves as expected on other platforms.

You can launch the application in this testing mode with the -D command line option, as demonstrated below:


java -Dorg.ananas.mac.menu.forcePortable=true -jar menu.jar

Version:
1.0
Author:
Benoît Marchal
See Also:
ApplicationItem

Constructor Summary
ApplicationItemFactory()
           
 
Method Summary
static ApplicationItem createAboutItem()
          Creates a new "application-smart" menu item for the about menu.
static ApplicationItem createPreferencesItem()
          Creates a new "application-smart" menu item for the preferences menu.
static ApplicationItem createQuitItem()
          Creates a new "application-smart" menu item for the quit menu.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationItemFactory

public ApplicationItemFactory()
Method Detail

createQuitItem

public static ApplicationItem createQuitItem()
Creates a new "application-smart" menu item for the quit menu.
Returns:
the new menu item

createAboutItem

public static ApplicationItem createAboutItem()
Creates a new "application-smart" menu item for the about menu.
Returns:
the new menu item

createPreferencesItem

public static ApplicationItem createPreferencesItem()
Creates a new "application-smart" menu item for the preferences menu.
Returns:
the new menu item