com.klg.jclass.field.cell
Class JCTextFieldCellEditorRenderer
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.text.JTextComponent
|
+--javax.swing.JTextField
|
+--com.klg.jclass.field.JCTextField
|
+--com.klg.jclass.field.cell.JCTextFieldCellEditorRenderer
- public class JCTextFieldCellEditorRenderer
- extends JCTextField
- implements com.klg.jclass.cell.JCCellEditor, com.klg.jclass.cell.JCComponentCellRenderer, com.klg.jclass.cell.JCValidateInterface, KeyListener, MouseListener
BaseCellEditor
provides a simple text editing component.
- See Also:
- Serialized Form
Methods inherited from class com.klg.jclass.field.JCTextField |
addNotify,
addPropertyChangeListener,
addValueListener,
commitEdit,
createField,
getAbout,
getDataProperties,
getInvalidInfo,
getSelectOnEnter,
getState,
getValidator,
getValue,
getValueModel,
isRequired,
removePropertyChangeListener,
removeValueListener,
setAbout,
setBackground,
setDataProperties,
setForeground,
setInvalidInfo,
setRequired,
setSelectOnEnter,
setValidator,
setValue,
setValueModel |
Methods inherited from class javax.swing.JTextField |
addActionListener,
createDefaultModel,
fireActionPerformed,
getAccessibleContext,
getActions,
getColumns,
getColumnWidth,
getHorizontalAlignment,
getHorizontalVisibility,
getPreferredSize,
getScrollOffset,
getUIClassID,
isValidateRoot,
paramString,
postActionEvent,
removeActionListener,
scrollRectToVisible,
setActionCommand,
setColumns,
setFont,
setHorizontalAlignment,
setScrollOffset |
Methods inherited from class javax.swing.text.JTextComponent |
addCaretListener,
addInputMethodListener,
addKeymap,
copy,
cut,
fireCaretUpdate,
getCaret,
getCaretColor,
getCaretPosition,
getDisabledTextColor,
getDocument,
getFocusAccelerator,
getHighlighter,
getInputMethodRequests,
getKeymap,
getKeymap,
getMargin,
getPreferredScrollableViewportSize,
getScrollableBlockIncrement,
getScrollableTracksViewportHeight,
getScrollableTracksViewportWidth,
getScrollableUnitIncrement,
getSelectedText,
getSelectedTextColor,
getSelectionColor,
getSelectionEnd,
getSelectionStart,
getText,
getText,
getUI,
isEditable,
isFocusTraversable,
isOpaque,
loadKeymap,
modelToView,
moveCaretPosition,
paste,
processComponentKeyEvent,
processInputMethodEvent,
read,
removeCaretListener,
removeKeymap,
removeNotify,
replaceSelection,
select,
selectAll,
setCaret,
setCaretColor,
setCaretPosition,
setDisabledTextColor,
setDocument,
setEditable,
setEnabled,
setFocusAccelerator,
setHighlighter,
setKeymap,
setMargin,
setOpaque,
setSelectedTextColor,
setSelectionColor,
setSelectionEnd,
setSelectionStart,
setText,
setUI,
updateUI,
viewToModel,
write |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isLightweightComponent,
isManagingFocus,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
processFocusEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
data
protected Object data
- This editor can dynamically alter its reserved key list based upon
the key the user has last typed. Thus, typing navigation keys will
cause the cell editor to traverse, but after typing a non-navigation
key, the user is placed into edit mode. At that point, the reserved
keys are re-enabled and the traversal keys will traverse within the
editor itself. The only way to get out of edit mode is to press
Enter, Escape, or use the mouse to click on another cell.
caretPosition
protected int caretPosition
initialEvent
protected AWTEvent initialEvent
support
protected com.klg.jclass.cell.JCCellEditorSupport support
selectAll
protected boolean selectAll
reservedKeys
protected com.klg.jclass.cell.JCKeyModifier[] reservedKeys
validate_support
protected com.klg.jclass.cell.validate.ValidateSupport validate_support
JCTextFieldCellEditorRenderer
public JCTextFieldCellEditorRenderer()
- Default constructor
getRendererComponent
public Component getRendererComponent(com.klg.jclass.cell.JCCellInfo cellInfo,
Object o,
boolean selected)
- Specified by:
- getRendererComponent in interface com.klg.jclass.cell.JCComponentCellRenderer
initialize
public void initialize(AWTEvent ev,
com.klg.jclass.cell.JCCellInfo info,
Object o)
- Specified by:
- initialize in interface com.klg.jclass.cell.JCCellEditor
getComponent
public Component getComponent()
- Returns the edit component.
- Specified by:
- getComponent in interface com.klg.jclass.cell.JCCellEditor
getCellEditorValue
public Object getCellEditorValue()
- Returns the object to be commited.
- Specified by:
- getCellEditorValue in interface com.klg.jclass.cell.JCCellEditor
isModified
public boolean isModified()
- Returns true if the data has been modified.
- Specified by:
- isModified in interface com.klg.jclass.cell.JCCellEditor
fireValidated
protected boolean fireValidated(com.klg.jclass.cell.validate.JCValidateEvent ev)
stopCellEditing
public boolean stopCellEditing()
- Called when the edit process is stopped
- Specified by:
- stopCellEditing in interface com.klg.jclass.cell.JCCellEditor
cancelCellEditing
public void cancelCellEditing()
- Called when the edit process is cancelled.
- Specified by:
- cancelCellEditing in interface com.klg.jclass.cell.JCCellEditor
getPreferredSize
public Dimension getPreferredSize(Graphics gc,
com.klg.jclass.cell.JCCellInfo cellInfo,
Object o)
getReservedKeys
public com.klg.jclass.cell.JCKeyModifier[] getReservedKeys()
- This editor reserves the LEFT and RIGHT arrow keys for its own use.
However, after the edit comitted or cancelled, it temporarily
"unreserves" these keys.
- Specified by:
- getReservedKeys in interface com.klg.jclass.cell.JCCellEditor
setVisible
public void setVisible(boolean b)
- Overrides
setVisible
in order to control the caret
position.
- Overrides:
- setVisible in class JComponent
addCellEditorListener
public void addCellEditorListener(com.klg.jclass.cell.JCCellEditorListener l)
- Add a listener to the list that's notified when the editor starts,
stops, or cancels editing.
- Parameters:
l
- the CellEditorListener
removeCellEditorListener
public void removeCellEditorListener(com.klg.jclass.cell.JCCellEditorListener l)
- Remove a listener from the list that's notified
- Parameters:
l
- the CellEditorListener
processKeyEvent
public void processKeyEvent(KeyEvent e)
- Overrides:
- processKeyEvent in class JComponent
keyPressed
public void keyPressed(KeyEvent e)
- Specified by:
- keyPressed in interface KeyListener
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
- mouseClicked in interface MouseListener
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
- mouseEntered in interface MouseListener
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
- mouseExited in interface MouseListener
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
- mousePressed in interface MouseListener
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
- mouseReleased in interface MouseListener
keyReleased
public void keyReleased(KeyEvent e)
- Specified by:
- keyReleased in interface KeyListener
keyTyped
public void keyTyped(KeyEvent e)
- Specified by:
- keyTyped in interface KeyListener
selectAllText
public void selectAllText()
- Uses hint from CellInfo to select all the text in the component.
addValidateListener
public void addValidateListener(com.klg.jclass.cell.validate.JCValidateListener l)
- Add a new ValidateListener to the list.
- Specified by:
- addValidateListener in interface com.klg.jclass.cell.JCValidateInterface
removeValidateListener
public void removeValidateListener(com.klg.jclass.cell.validate.JCValidateListener l)
- Remove a ValidateListener from the list.
- Specified by:
- removeValidateListener in interface com.klg.jclass.cell.JCValidateInterface