com.townleyenterprises.swing
Interface UIBuilder

All Known Implementing Classes:
AbstractUIBuilder

public interface UIBuilder

This interface is part of an implementation of the Builder pattern which provides ways to dynamically build portions of a Swing application's User Interface. This mechanism was originally inspired by the 1999 verion of the Swing Notepad demo (version 1.15) by Timothy Prinzing, but has come a long way from the original adaptation. This implementation makes the technique into a full-blow implementation of the Builder pattern which is extensible to different types of physical UI layout representations.

This interface provides the basic part builder methods, but it doesn't define an equivalent getResult() method. The Director is expected to do what it needs with each of the individual pieces.

Since:
2.1
Version:
$Id: UIBuilder.java,v 1.4 2004/07/28 10:33:59 atownley Exp $
Author:
Andrew S. Townley

Method Summary
 javax.swing.JMenu buildMenu(java.lang.String key)
          This method builds a given menu based on the appropriate key value.
 javax.swing.JMenuBar buildMenuBar()
          This method will build a completely initialized menu bar from the input source.
 javax.swing.JMenuBar buildMenuBar(java.lang.String key)
          This method will build a completely initialized menu bar from the input source with the specified key.
 javax.swing.JMenuItem buildMenuItem(java.lang.String key)
          This method builds a menu item based on the given key.
 

Method Detail

buildMenuBar

public javax.swing.JMenuBar buildMenuBar()
This method will build a completely initialized menu bar from the input source.

Returns:
a JMenuBar instance

buildMenuBar

public javax.swing.JMenuBar buildMenuBar(java.lang.String key)
This method will build a completely initialized menu bar from the input source with the specified key. This method is mainly used when more than one menubar needs to be built from the saem resource loader.

Parameters:
key - the resource key for the menubar
Returns:
a JMenuBar instance

buildMenu

public javax.swing.JMenu buildMenu(java.lang.String key)
This method builds a given menu based on the appropriate key value. For a given key, the following items should be defined:

Parameters:
key - the key for the menu
Returns:
a JMenu instance

buildMenuItem

public javax.swing.JMenuItem buildMenuItem(java.lang.String key)
This method builds a menu item based on the given key. For a given key, the following items should be defined:


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.