[jsword-devel] Deriving from an ActionFactory

DM Smith jsword-devel@crosswire.org
Tue, 06 Apr 2004 18:03:21 -0400


The following is useful:
    for creating a globally accessible ActionFactory
    for having more than one ActionFactory, each with its own resources.
    for having the resources in the same package name as the code that uses 
it

All that needs to be done to use it is
    put it in org/crosswire/jsword/view/swing/desktop
    rename
           resource/org.crosswire.common.swing.ActionFactory
       to
           
resource/org.crosswire.jsword.view.swing.desktop.DesktopActionFactory
    in DesktopActions change
           actions = new ActionFactory()
       to
           actions = DesktopActionFactory.instance();

public final class DesktopActionFactory extends ActionFactory
{

    private DesktopActionFactory()
    {
        super();
    }

    public static ActionFactory instance()
    {
        if (instance == null)
        {
            instance = new DesktopActionFactory();
        }
        return instance;
    }

    private static ActionFactory instance;
}

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/