nu.zoom.swing.desktop.component.stringmenu.impl
Class StringMenuFactoryImpl

java.lang.Object
  extended by nu.zoom.swing.desktop.component.stringmenu.impl.StringMenuFactoryImpl
All Implemented Interfaces:
StringMenuFactory

public class StringMenuFactoryImpl
extends Object
implements StringMenuFactory


Constructor Summary
StringMenuFactoryImpl(Preferences preferences, Workbench workbench, org.ops4j.gaderian.Messages messages)
           
 
Method Summary
<T extends Comparable<T> & Serializable>
StringMenu<T>
getCachedMenu(Class<T> clazz, String preferenceKey)
          Retrieve a previously created menu.
<T extends Comparable<T> & Serializable>
StringMenu<T>
getMenu(Class<T> clazz, String preferenceKey, String menuPresentationName, Icon menuIcon)
          Get a menu.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringMenuFactoryImpl

public StringMenuFactoryImpl(Preferences preferences,
                             Workbench workbench,
                             org.ops4j.gaderian.Messages messages)
Method Detail

getCachedMenu

public <T extends Comparable<T> & Serializable> StringMenu<T> getCachedMenu(Class<T> clazz,
                                                                           String preferenceKey)
Description copied from interface: StringMenuFactory
Retrieve a previously created menu.

Specified by:
getCachedMenu in interface StringMenuFactory
Returns:
The menu or null if not created.
See Also:
#getMenu(String, String, Icon)

getMenu

public <T extends Comparable<T> & Serializable> StringMenu<T> getMenu(Class<T> clazz,
                                                                     String preferenceKey,
                                                                     String menuPresentationName,
                                                                     Icon menuIcon)
Description copied from interface: StringMenuFactory
Get a menu. The menu will be cached with the preferenceKey as the cache key, subsequent calls to this method with the same preference key will always return the same menu instance.

Specified by:
getMenu in interface StringMenuFactory
preferenceKey - The key to use to store the menu when the application shuts down. Will be used to restore the menu when it is created.
menuPresentationName - The menu will have this set as its name.
menuIcon - The icon to set on the menu. May be null.
Returns:
A StringMenu


Copyright © 2011. All Rights Reserved.