org.ceryle.ui
Class AbstractMetaField

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.ceryle.ui.AbstractMetaField
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
ContributorField, CreatorField

public abstract class AbstractMetaField
extends JPanel

Extends JPanel providing an abstract class for displaying and editing grouped, fielded metadata. Extensions of this class are embedded as panels in the MetadataPanel, where this is used to create multiple metadata fields of the same type. The constructor is provided with both a Stack and JComponent parent container, and it provides features for managing the multiple fields.

Multiple value components within a list are delimited by semicolons as established by DCMI DCSV: A syntax for writing a list of labelled values in a text string.

Version:
$Id: AbstractMetaField.java,v 3.4 2007-06-15 12:09:35 altheim Exp $
Author:
Murray Altheim
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String DELIMITER
          The field delimiter character (";").
protected  JTextField fld
          This is protected (i.e., not private) only so that subclasses can write directly to it, avoiding the setContent(String) behaviour.
protected  MetadataPanel m_mdp
           
static int MAX_COUNT
          The maximum number of creator fields permitted.
protected  MessageHandler mh
           
protected  Services srvs
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AbstractMetaField(MetadataPanel metadatapanel, Stack fields, JComponent parent, String label, String tooltip)
          Default constructor for the AbstractMetaField.
 
Method Summary
 void clear()
          Clears this and any other AbstractMetaFields within the same parent.
protected abstract  boolean confirmAdd()
          Returns true if the user has confirmed a field addition.
protected abstract  boolean confirmRemove()
          Returns true if the user has confirmed a field removal.
 String getAllContent()
          Returns all content from the entire field group as a single String, null if either empty or composed of only whitespace.
 String getContent()
          Returns the metadata content as a String.
 int getIndex()
          Returns the index of this field within the overall group.
 boolean isAllEmpty()
          Returns true if all fields are empty or contains only whitespace.
 boolean isEmpty()
          Returns true if the field is empty or contains only whitespace.
 void matchFieldCount(int count)
          Matches the number of grouped fields to count by adding or removing fields as necessary.
protected  void setAddEnabled(boolean enabled)
          Sets the enabled state of the Add Another button.
protected abstract  void setContent()
          Queries the user for field content.
 void setContent(String content)
          Sets the metadata content for the currently-displayed Node to the String content.
protected  void updateAddEnabled()
          Set enabled state of the Add Another buttons based on total count.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DELIMITER

public static final String DELIMITER
The field delimiter character (";"). The semicolon delimiter for Dublin Core is established by the document

See Also:
Constant Field Values

MAX_COUNT

public static int MAX_COUNT
The maximum number of creator fields permitted.


fld

protected JTextField fld
This is protected (i.e., not private) only so that subclasses can write directly to it, avoiding the setContent(String) behaviour.


m_mdp

protected final MetadataPanel m_mdp

srvs

protected Services srvs

mh

protected MessageHandler mh
Constructor Detail

AbstractMetaField

public AbstractMetaField(MetadataPanel metadatapanel,
                         Stack fields,
                         JComponent parent,
                         String label,
                         String tooltip)
Default constructor for the AbstractMetaField.

Method Detail

clear

public void clear()
Clears this and any other AbstractMetaFields within the same parent.


matchFieldCount

public void matchFieldCount(int count)
Matches the number of grouped fields to count by adding or removing fields as necessary.


getIndex

public int getIndex()
Returns the index of this field within the overall group.


isEmpty

public boolean isEmpty()
Returns true if the field is empty or contains only whitespace.


isAllEmpty

public boolean isAllEmpty()
Returns true if all fields are empty or contains only whitespace.


setContent

protected abstract void setContent()
Queries the user for field content.


setContent

public void setContent(String content)
Sets the metadata content for the currently-displayed Node to the String content. Clears the field if a null value is supplied.


getContent

public String getContent()
Returns the metadata content as a String. Note that this method returns null if empty or composed of only whitepace.


getAllContent

public String getAllContent()
Returns all content from the entire field group as a single String, null if either empty or composed of only whitespace. If there are multiple fields they are delimited with DELIMITER.


setAddEnabled

protected void setAddEnabled(boolean enabled)
Sets the enabled state of the Add Another button.


updateAddEnabled

protected void updateAddEnabled()
Set enabled state of the Add Another buttons based on total count.


confirmAdd

protected abstract boolean confirmAdd()
Returns true if the user has confirmed a field addition.


confirmRemove

protected abstract boolean confirmRemove()
Returns true if the user has confirmed a field removal.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.