JAPI 0.9.0
Yet another Java API
API Documentation

net.sf.japi.swing.prefs
Class AbstractPrefs

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 net.sf.japi.swing.prefs.AbstractPrefs
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Prefs
Direct Known Subclasses:
KeyStrokePrefs, ProxyPrefs

public abstract class AbstractPrefs
extends JPanel
implements Prefs

Abstract preferences implementation. Subclass this. Build the panel in your constructor. The default layout of an AbstractPrefs is BoxLayout with BoxLayout.Y_AXIS.

Author:
Christian Hujer
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
 
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
protected AbstractPrefs()
          Constructor.
protected AbstractPrefs(LayoutManager layout)
          Constructor that allows setting the initial layout.
 
Method Summary
 JComponent getEditComponent()
          Provide a component for editing the prefs.
 String getHelpText()
          Provide help (HTML).
 URL getHelpURL()
          Provide help.
 String getLabelText()
          Provide text to be displayed as title for this prefs module.
 Icon getListLabelIcon()
          Provide an icon to be displayed in the list where the user can choose amongst preferences.
 String getListLabelText()
          Provide a label to be displayed in the list where the user can choose amongst preferences.
protected  void setHelpText(String helpText)
          Set the help text.
protected  void setHelpURL(URL helpURL)
          Set the help URL.
protected  void setLabelText(String labelText)
          Set the title text that is to be displayed as title for this prefs module.
protected  void setListLabelIcon(Icon listLabelIcon)
          Set the icon that is to be displayed in the list where the user can choose amongst preferences.
protected  void setListLabelText(String listLabelText)
          Set the label text that is to be displayed in the list where the user can choose amongst preferences.
 
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
 
Methods inherited from interface net.sf.japi.swing.prefs.Prefs
apply, defaults, isChanged, revert
 

Constructor Detail

AbstractPrefs

protected AbstractPrefs()
Constructor.


AbstractPrefs

protected AbstractPrefs(LayoutManager layout)
Constructor that allows setting the initial layout.

Parameters:
layout - Layout
Method Detail

getEditComponent

public final JComponent getEditComponent()
Provide a component for editing the prefs. The edit component MUST NOT automatically change preferences itself. Preferences MUST only changed when the method Prefs.apply() is invoked.

Specified by:
getEditComponent in interface Prefs
Returns:
component for editing the prefs

getListLabelIcon

public final Icon getListLabelIcon()
Provide an icon to be displayed in the list where the user can choose amongst preferences.

Specified by:
getListLabelIcon in interface Prefs
Returns:
icon to be displayed in the list or null if no icon is available

setListLabelIcon

protected final void setListLabelIcon(Icon listLabelIcon)
Set the icon that is to be displayed in the list where the user can choose amongst preferences.

Parameters:
listLabelIcon - icon

getListLabelText

public final String getListLabelText()
Provide a label to be displayed in the list where the user can choose amongst preferences.

Specified by:
getListLabelText in interface Prefs
Returns:
text to be displayed in the list

setListLabelText

protected final void setListLabelText(String listLabelText)
Set the label text that is to be displayed in the list where the user can choose amongst preferences.

Parameters:
listLabelText - text

getLabelText

public final String getLabelText()
Provide text to be displayed as title for this prefs module.

Specified by:
getLabelText in interface Prefs
Returns:
title of this prefs module

setLabelText

protected final void setLabelText(String labelText)
Set the title text that is to be displayed as title for this prefs module.

Parameters:
labelText - text

getHelpURL

public final URL getHelpURL()
Provide help. This method may return null in which case the method Prefs.getHelpText() will be queried instead.

Specified by:
getHelpURL in interface Prefs
Returns:
help url or null

setHelpURL

protected final void setHelpURL(URL helpURL)
Set the help URL.

Parameters:
helpURL - Help URL

getHelpText

public final String getHelpText()
Provide help (HTML). This method will only be queried if Prefs.getHelpURL() returns null. This method may return null as well, which means that this prefs does not provide any help.

Specified by:
getHelpText in interface Prefs
Returns:
help text (HTML) or null

setHelpText

protected final void setHelpText(String helpText)
Set the help text.

Parameters:
helpText - Help text

JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright