com.partnersoft.gui.widget
Interface Widget


public interface Widget

A multipurpose GUI control for a datatype.

The Swing framework requires a variety of types of controls for various contexts. For example, for a simple text string, you may use a JLabel to view it, a JTextField to edit it, and variations on those two to view and edit them within a JTable. Our previous approach was to create separate classes for each case, but in fact a lot of the logic involved (e.g. updating or reading the underlying model, event management, etc.) is the same and some efficiency can be gained in the code. Also, and more importantly, forcing the implementor to support all contexts at once means that you don't end up with piecemeal library and know that if you have a viewer for something you'll also be able to show it in a JTable.

The name widget is yet another abuse of a generic term. It is a nod to the X Window Sysstem, but is otherwise unrelated.

Copyright 2007 Partner Software, Inc.

Version:
$Id: Widget.java 1012 2007-11-24 18:30:02Z paul $
Author:
Paul Reavis

Method Summary
 javax.swing.CellEditor createCellEditor()
           
 javax.swing.table.TableCellRenderer createCellRenderer()
           
 javax.swing.JComponent createEditor()
           
 javax.swing.JComponent createSmallViewer()
           
 javax.swing.JComponent createViewer()
           
 

Method Detail

createSmallViewer

javax.swing.JComponent createSmallViewer()

createViewer

javax.swing.JComponent createViewer()

createEditor

javax.swing.JComponent createEditor()

createCellEditor

javax.swing.CellEditor createCellEditor()

createCellRenderer

javax.swing.table.TableCellRenderer createCellRenderer()