swingwtx.swing.text
Class JTextComponent

java.lang.Object
  extended byswingwt.awt.Component
      extended byswingwt.awt.Container
          extended byswingwtx.swing.JComponent
              extended byswingwtx.swing.text.JTextComponent
All Implemented Interfaces:
ImageObserver, MenuContainer
Direct Known Subclasses:
FakeBrowserEditorPane, JEditorPane, JTextArea, JTextField, PlatformBrowserEditorPane, TextEditorPane

public class JTextComponent
extends JComponent

Superclass for all textual components. Note that we have to use a few tricks here as Swing can do a whole bunch of stuff we can't because of the native peer widgets. Basically, we make this work like a JTextField and leave it upto subclasses to override whatever they need to.


Nested Class Summary
protected  class JTextComponent.TextEventHandler
           
 
Nested classes inherited from class swingwtx.swing.JComponent
JComponent.InternalFrameSelectionListener
 
Field Summary
protected  Caret caret
           
protected  Document doc
           
protected  int iRetVal
           
protected  int pCols
           
protected  boolean pEditable
           
protected  org.eclipse.swt.widgets.Text ppeer
           
protected  int pRows
           
protected  java.lang.String pText
           
protected  boolean pWordWrap
           
protected  java.lang.String retVal
          Return value for thread safe accessors
protected  int selEnd
           
protected  int selStart
           
protected  PlainView view
           
 
Fields inherited from class swingwtx.swing.JComponent
accessibleContext, actionMap, ancestorInputMap, border, clientProperties, descendantHasPeer, focusInputMap, internalFrameAdapter, internalFrameParent, opaque, propertyChangeListeners, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, windowInputMap
 
Fields inherited from class swingwt.awt.Container
composite, comps, containerListeners, layout, queuedValidateRequest
 
Fields inherited from class swingwt.awt.Component
actionCommand, actionListeners, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListeners, componentName, consumeAvailableHeight, consumeAvailableWidth, focusable, focusListeners, graphicsConfig, inputMethodListeners, isUserSetFont, keyListeners, layoutModifier, LEFT_ALIGNMENT, LOCK, mouseListeners, mouseMotionListeners, mouseWheelListeners, parent, pBackground, pCursor, pDoubleBuffered, peer, pEnabled, pFont, pForeground, pLayoutData, pLocation, pMaxSize, pMinSize, pPrefSize, pSize, pToolTipText, pVisible, RIGHT_ALIGNMENT, swingWTDefaultActionEventAdapter, swingWTEventAdapter, TOP_ALIGNMENT
 
Fields inherited from interface swingwt.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JTextComponent()
           
 
Method Summary
 void addInputMethodListener()
           
 void copy()
           
 void cut()
           
 Caret getCaret()
           
 int getCaretPosition()
           
 Document getDocument()
           
 int getSelectionEnd()
           
 int getSelectionStart()
           
 java.lang.String getText()
           
 boolean isEditable()
           
 void paste()
           
 void replaceSelection(java.lang.String content)
          NOT IMPLEMENTED
 void select(int selectionStart, int selectionEnd)
           
 void selectAll()
           
 void setCaret(Caret caret)
           
 void setCaretPosition(int pos)
           
 void setDocument(Document doc)
           
 void setEditable(boolean b)
           
 void setSelectedTextColor(Color c)
          NOT IMPLEMENTED - Has no meaning in native plaf
 void setSelectionColor(Color c)
          NOT IMPLEMENTED - Has no meaning in native plaf
 void setSelectionEnd(int end)
           
 void setSelectionStart(int start)
           
 void setSwingWTParent(Container parent)
          Once a parent component receives an "add" call for a child, this being the child, this should be called to tell us to instantiate the peer and load in any cached properties.
 void setText(java.lang.String text)
           
 
Methods inherited from class swingwtx.swing.JComponent
add, add, add, add, add, addPropertyChangeListener, addPropertyChangeListener, checkInternalFrameChild, dispose, getAccessibleContext, getActionMap, getAutoscrolls, getBorder, getClientProperty, getInputMap, getInsets, getToolTipLocation, getToolTipText, getTopLevelAncestor, getVisibleRect, isDoubleBuffered, isOpaque, isOptimizedDrawingEnabled, isValidateRoot, paint, paintBackground, paintChildren, paintComponent, paintImmediately, paintImmediately, putClientProperty, remove, remove, removePropertyChangeListener, removePropertyChangeListener, repaint, revalidate, scrollRectToVisible, setActionMap, setAutoscrolls, setBorder, setDoubleBuffered, setInputMap, setMargin, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled
 
Methods inherited from class swingwt.awt.Container
addComponentToLayout, addContainerListener, debug_showContainmentTree, doAdd, doLayout, getComponent, getComponentCount, getComponentOrientation, getComponents, getComposite, getLayout, getMaximumSize, getMinimumSize, getParent, getPreferredSize, invalidate, minimumSize, preferredSize, processContainerEvent, processEvent, queuedValidate, removeAll, removeComponentFromCache, removeContainerListener, setLayout, setLayoutImpl, validate
 
Methods inherited from class swingwt.awt.Component
add, addActionListener, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, calculatePreferredSize, componentOnlyDispose, computePreferredSize, contains, contains, createImage, createListenerArrayFromVector, createVolatileImage, dispatchEvent, getActionCommand, getAlignmentX, getAlignmentY, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getListeners, getLocation, getLocationOnScreen, getName, getPeer, getPeerSize, getSize, getSize, getSWTPeer, getToolkit, getToolTipText, getTreeLock, getWidth, getX, getY, grabFocus, hasFocus, hasSetFont, hide, imageUpdate, inside, isEnabled, isFocusable, isMinimumSizeSet, isShowing, isVisible, processActionEvent, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, processTraverseEvent, registerActionEvents, registerComponentEvents, registerEvents, registerExtendedModifyEvents, registerFocusEvents, registerKeyEvents, registerModifyEvents, registerMouseEvents, registerPaintEvents, registerTraversalEvents, remove, removeActionListener, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, repaint, repaint, repaint, requestFocus, setActionCommand, setAlignmentX, setAlignmentY, setBackground, setBounds, setBounds, setCachedProperties, setComponentOrientation, setComponentRemoved, setCursor, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setFont, setForeground, setHeight, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setSize, setSize, setToolTipText, setVisible, setWidth, show, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ppeer

protected org.eclipse.swt.widgets.Text ppeer

pText

protected java.lang.String pText

pEditable

protected boolean pEditable

pWordWrap

protected boolean pWordWrap

pRows

protected int pRows

pCols

protected int pCols

selStart

protected int selStart

selEnd

protected int selEnd

caret

protected Caret caret

doc

protected Document doc

view

protected PlainView view

retVal

protected java.lang.String retVal
Return value for thread safe accessors


iRetVal

protected int iRetVal
Constructor Detail

JTextComponent

public JTextComponent()
Method Detail

getDocument

public Document getDocument()

setDocument

public void setDocument(Document doc)

getText

public java.lang.String getText()

setText

public void setText(java.lang.String text)

setEditable

public void setEditable(boolean b)

isEditable

public boolean isEditable()

getCaretPosition

public int getCaretPosition()

setCaretPosition

public void setCaretPosition(int pos)

copy

public void copy()

cut

public void cut()

paste

public void paste()

getCaret

public Caret getCaret()

setCaret

public void setCaret(Caret caret)

replaceSelection

public void replaceSelection(java.lang.String content)
NOT IMPLEMENTED


select

public void select(int selectionStart,
                   int selectionEnd)

selectAll

public void selectAll()

setSelectionStart

public void setSelectionStart(int start)

setSelectionEnd

public void setSelectionEnd(int end)

getSelectionStart

public int getSelectionStart()

getSelectionEnd

public int getSelectionEnd()

setSelectedTextColor

public void setSelectedTextColor(Color c)
NOT IMPLEMENTED - Has no meaning in native plaf


setSelectionColor

public void setSelectionColor(Color c)
NOT IMPLEMENTED - Has no meaning in native plaf


setSwingWTParent

public void setSwingWTParent(Container parent)
                      throws java.lang.Exception
Once a parent component receives an "add" call for a child, this being the child, this should be called to tell us to instantiate the peer and load in any cached properties.

Overrides:
setSwingWTParent in class JComponent
Throws:
java.lang.Exception

addInputMethodListener

public void addInputMethodListener()