JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.cell.editors
Class JCMultilineCellEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JScrollPane
                          |
                          +--com.klg.jclass.cell.editors.JCMultilineCellEditor
All Implemented Interfaces:
Accessible, EventListener, FocusListener, ImageObserver, JCCellEditor, JCCellEditorEventSource, JCCellTextEditor, KeyListener, MenuContainer, ScrollPaneConstants, Serializable
Direct Known Subclasses:
JCWordWrapCellEditor

public class JCMultilineCellEditor
extends JScrollPane
implements JCCellTextEditor, KeyListener, FocusListener

JCMultilineCellEditor provides a simple text editing component for multiline data.

See Also:
Serialized Form

Nested Class Summary
 class JCMultilineCellEditor.JCMultilineCellEditorTextArea
           
 
Nested classes inherited from class javax.swing.JScrollPane
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  int caretPosition
           
protected  Object data
           
protected  AWTEvent initialEvent
           
protected  com.klg.jclass.cell.JCKeyModifier[] keys
           
protected  boolean selectAll
           
protected  com.klg.jclass.cell.JCCellEditorSupport support
           
protected  JCMultilineCellEditor.JCMultilineCellEditorTextArea text
           
protected  com.klg.jclass.cell.validate.ValidateSupport validateSupport
           
 
Fields inherited from class javax.swing.JScrollPane
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport
 
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 javax.swing.ScrollPaneConstants
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JCMultilineCellEditor()
          Default constructor.
 
Method Summary
 void addCellEditorListener(com.klg.jclass.cell.JCCellEditorListener l)
          Adds a listener to the list that is notified when the edit starts, stops, or is canceled.
 void addValidateListener(com.klg.jclass.cell.validate.JCValidateListener l)
          Adds a new ValidateListener to the list.
 void cancelCellEditing()
          Called when the edit process is cancelled.
protected  boolean fireValidated(com.klg.jclass.cell.validate.JCValidateEvent ev)
           
 void focusGained(FocusEvent e)
           
 void focusLost(FocusEvent e)
           
 String getCellEditorText()
          Gets the text for the editor (as a String).
 Object getCellEditorValue()
          Returns the object contained in the editor.
 Component getComponent()
          Returns the edit component.
 JTextArea getEditor()
          Returns the internal JTextArea object used for editing.
 Dimension getMinimumSize()
          Overrides the minimumSize method to get the minimumSize based on an abitrary row/column pair.
 Dimension getPreferredSize(Graphics gc, com.klg.jclass.cell.JCCellInfo cellInfo, Object o)
           
 com.klg.jclass.cell.JCKeyModifier[] getReservedKeys()
          This editor reserves the enter key and navigation keys.
 boolean getSelectAll()
          Returns whether this editor will select the text on initialization.
 String getText()
          getText() must map to JTextArea in Swing version.
 void initialize(AWTEvent ev, com.klg.jclass.cell.JCCellInfo info, Object o)
          The container calls initialize() before the edit starts to let the editor know what kind of event started the edit (via the AWTEvent object).
 boolean isModified()
          Returns true if the data has been modified.
 void keyPressed(KeyEvent e)
           
 void keyReleased(KeyEvent e)
           
 void keyTyped(KeyEvent e)
           
 void processKeyEvent(KeyEvent e)
          Override the key event processor.
 void removeCellEditorListener(com.klg.jclass.cell.JCCellEditorListener l)
          Removes a listener from the list that is notified when the edit starts, stops, or is canceled.
 void removeValidateListener(com.klg.jclass.cell.validate.JCValidateListener l)
          Removes a ValidateListener from the list.
 void selectAllText()
          Uses hint from CellInfo to select all the text in the component.
 void setCellEditorText(String text)
          Sets the text for the editor.
 void setText(String s)
          setText() must map to JTextArea in Swing version.
 void setVisible(boolean b)
          Overridden in order to show selected text.
 boolean stopCellEditing()
          Tells the editor to stop editing and accept the current value.
 
Methods inherited from class javax.swing.JScrollPane
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, 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

data

protected Object data

support

protected com.klg.jclass.cell.JCCellEditorSupport support

selectAll

protected boolean selectAll

validateSupport

protected com.klg.jclass.cell.validate.ValidateSupport validateSupport

keys

protected com.klg.jclass.cell.JCKeyModifier[] keys

text

protected JCMultilineCellEditor.JCMultilineCellEditorTextArea text

caretPosition

protected int caretPosition

initialEvent

protected AWTEvent initialEvent
Constructor Detail

JCMultilineCellEditor

public JCMultilineCellEditor()
Default constructor.

Method Detail

initialize

public void initialize(AWTEvent ev,
                       com.klg.jclass.cell.JCCellInfo info,
                       Object o)
Description copied from interface: JCCellEditor
The container calls initialize() before the edit starts to let the editor know what kind of event started the edit (via the AWTEvent object).
Note: The size of the cell comes from info.getDrawingArea().

Implementors must handle null AWTEvents.

Specified by:
initialize in interface JCCellEditor
Parameters:
ev - event that initiated the edit operation
info - cell that displays information for the editor
o - item to be edited

getComponent

public Component getComponent()
Returns the edit component.

Specified by:
getComponent in interface JCCellEditor
Returns:
edit component

getCellEditorValue

public Object getCellEditorValue()
Returns the object contained in the editor.

Specified by:
getCellEditorValue in interface JCCellEditor
Returns:
object contained in the editor

getCellEditorText

public String getCellEditorText()
Gets the text for the editor (as a String).

Specified by:
getCellEditorText in interface JCCellTextEditor
Returns:
the current text in the editor

setCellEditorText

public void setCellEditorText(String text)
Sets the text for the editor.

Specified by:
setCellEditorText in interface JCCellTextEditor
Parameters:
text - the new cell editor text value

fireValidated

protected boolean fireValidated(com.klg.jclass.cell.validate.JCValidateEvent ev)

stopCellEditing

public boolean stopCellEditing()
Tells the editor to stop editing and accept the current value.

Specified by:
stopCellEditing in interface JCCellEditor
Returns:

isModified

public boolean isModified()
Returns true if the data has been modified.

Specified by:
isModified in interface JCCellEditor
Returns:
true if the data has been modified

cancelCellEditing

public void cancelCellEditing()
Called when the edit process is cancelled.

Specified by:
cancelCellEditing in interface JCCellEditor

setText

public void setText(String s)
setText() must map to JTextArea in Swing version.

Parameters:
s -

getText

public String getText()
getText() must map to JTextArea in Swing version.

Returns:

getSelectAll

public boolean getSelectAll()
Returns whether this editor will select the text on initialization.

Specified by:
getSelectAll in interface JCCellTextEditor
Returns:
the value of selectAll

getEditor

public JTextArea getEditor()
Returns the internal JTextArea object used for editing.

Returns:
the internal JTextArea editor

getMinimumSize

public Dimension getMinimumSize()
Overrides the minimumSize method to get the minimumSize based on an abitrary row/column pair.

Overrides:
getMinimumSize in class JComponent
Returns:

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 enter key and navigation keys.

Specified by:
getReservedKeys in interface JCCellEditor
Returns:

addCellEditorListener

public void addCellEditorListener(com.klg.jclass.cell.JCCellEditorListener l)
Adds a listener to the list that is notified when the edit starts, stops, or is canceled.

Specified by:
addCellEditorListener in interface JCCellEditorEventSource
Parameters:
l -

removeCellEditorListener

public void removeCellEditorListener(com.klg.jclass.cell.JCCellEditorListener l)
Removes a listener from the list that is notified when the edit starts, stops, or is canceled.

Specified by:
removeCellEditorListener in interface JCCellEditorEventSource
Parameters:
l -

processKeyEvent

public void processKeyEvent(KeyEvent e)
Override the key event processor. This allows the parent to pass a key event to this editor that it otherwise might not get.

Specified by:
processKeyEvent in interface JCCellTextEditor
Overrides:
processKeyEvent in class JComponent
Parameters:
e - The event to pass

keyPressed

public void keyPressed(KeyEvent e)
Specified by:
keyPressed in interface KeyListener

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.


setVisible

public void setVisible(boolean b)
Overridden in order to show selected text.

Overrides:
setVisible in class JComponent
Parameters:
b -

addValidateListener

public void addValidateListener(com.klg.jclass.cell.validate.JCValidateListener l)
Adds a new ValidateListener to the list.

Parameters:
l -

removeValidateListener

public void removeValidateListener(com.klg.jclass.cell.validate.JCValidateListener l)
Removes a ValidateListener from the list.

Parameters:
l -

focusGained

public void focusGained(FocusEvent e)
Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent e)
Specified by:
focusLost in interface FocusListener

Copyright © 2004 Quest Software Inc..
All rights reserved.