stella.jview
Class JElementEdit

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by jview.AbstractDisplayable
                  extended by stella.jview.JElementDisplay
                      extended by stella.jview.JElementEdit
All Implemented Interfaces:
ActionListener, Cloneable, EventListener, Displayable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class JElementEdit
extends JElementDisplay

An element editor provides a GUI that allows easy editing of ElementHelper instances. It extends the JElementDisplay in a sense that it provides a panel ready to put into an input dialog. Additionally to the parent class, it shows two buttons to confirm all inputs and a cancel button that denies all changes, which does not mean that it can undo changes in the variables confirmed with return in text-fields or by entering lists, provided by buttons. It merely allows the user to change some/all text-fields within the component (no return pressed) and then update all fields together with a click on the okay button.


Nested Class Summary
static class JElementEdit.Show
          A class to test the layout.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  JButton abort
          The cancel button.
private static String DEFCANCEL
          The default string to display on the cancel button.
private static String DEFOK
          The default string to display on the okay-button.
static String KEY_CANCEL
          The string to display on the cancel button.
static String KEY_OK
          The string to display on the confirmation button.
private  Object lock
          An object to be notified on button events.
private  JButton okay
          The okay button.
 
Fields inherited from class stella.jview.JElementDisplay
KEY_DEFINEDCOLOR, KEY_IDCOLOR, KEY_MAXLENGTH, KEY_MISSINGCOLOR, KEY_NOTREQUIREDCOLOR, KEY_NULL
 
Fields inherited from class jview.AbstractDisplayable
KEY_COMPONENTNAME, KEY_ICON, KEY_INSETS
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
JElementEdit(Map prop)
          Constructs a new element editor.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Catches action events on the okay and cancel button.
 Component getRepresentation()
          Delivers a panel consiting of the panel delivered by the parent component plus two buttons.
 void registerNotification(Object notify)
          Assigns a notification object to this editor.
 
Methods inherited from class stella.jview.JElementDisplay
registerStatusField, registerUserAdjustable, updateFields
 
Methods inherited from class jview.AbstractDisplayable
getComponentName, getIcon, getIcon
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 

Field Detail

KEY_OK

public static final String KEY_OK
The string to display on the confirmation button.

See Also:
Constant Field Values

KEY_CANCEL

public static final String KEY_CANCEL
The string to display on the cancel button.

See Also:
Constant Field Values

DEFOK

private static final String DEFOK
The default string to display on the okay-button.

See Also:
Constant Field Values

DEFCANCEL

private static final String DEFCANCEL
The default string to display on the cancel button.

See Also:
Constant Field Values

okay

private JButton okay
The okay button.


abort

private JButton abort
The cancel button.


lock

private Object lock
An object to be notified on button events.

Constructor Detail

JElementEdit

public JElementEdit(Map prop)
Constructs a new element editor. Prior to using it, also prior to displaying it the UserAdjustable must be assigned to it.

Method Detail

registerNotification

public void registerNotification(Object notify)
Assigns a notification object to this editor. This object is notified if the user presses the okay or cancel button. If called with a null-argument, notifiaction is turned off.


getRepresentation

public Component getRepresentation()
Delivers a panel consiting of the panel delivered by the parent component plus two buttons. Pressing the button updates all fields or disregards all changes not already confirmed. An object may be registered that is notified on button presses.

Specified by:
getRepresentation in interface Displayable
Overrides:
getRepresentation in class JElementDisplay

actionPerformed

public void actionPerformed(ActionEvent ae)
Catches action events on the okay and cancel button. If okay was pressed we validate all fields.

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class JElementDisplay