swingwtx.swing
Class JPasswordField

java.lang.Object
  extended byswingwt.awt.Component
      extended byswingwt.awt.Container
          extended byswingwtx.swing.JComponent
              extended byswingwtx.swing.text.JTextComponent
                  extended byswingwtx.swing.JTextField
                      extended byswingwtx.swing.JPasswordField
All Implemented Interfaces:
ImageObserver, MenuContainer, SwingConstants

public class JPasswordField
extends JTextField


Nested Class Summary
 
Nested classes inherited from class swingwtx.swing.text.JTextComponent
JTextComponent.TextEventHandler
 
Nested classes inherited from class swingwtx.swing.JComponent
JComponent.InternalFrameSelectionListener
 
Field Summary
protected  char pEchoChar
          The char to use instead of showing what's typed (defaults to a *)
protected  org.eclipse.swt.widgets.Text ppeer
          The peer
protected  java.lang.String pText
          Cache of the text to be loaded into the peer
 
Fields inherited from class swingwtx.swing.JTextField
pCols
 
Fields inherited from class swingwtx.swing.text.JTextComponent
caret, doc, iRetVal, pEditable, pRows, pWordWrap, selEnd, selStart, 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 swingwtx.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface swingwt.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JPasswordField()
          Creates a new JPasswordField
JPasswordField(Document document, java.lang.String text, int columns)
          Creates a new JPasswordField
JPasswordField(int columns)
          Creates a new JPasswordField
JPasswordField(java.lang.String text)
          Creates a new JPasswordField
JPasswordField(java.lang.String text, int columns)
          Creates a new JPasswordField
 
Method Summary
protected  Dimension calculatePreferredSize()
          Overriden to calculate non-realised preferred size.
 char getEchoChar()
           
 char[] getPassword()
           
 java.lang.String getText()
           
 boolean isEchoCharSet()
           
 void setEchoChar(char c)
           
 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.JTextField
calculateFromCols, getColumns, isEditable, setColumns, setEditable
 
Methods inherited from class swingwtx.swing.text.JTextComponent
addInputMethodListener, copy, cut, getCaret, getCaretPosition, getDocument, getSelectionEnd, getSelectionStart, paste, replaceSelection, select, selectAll, setCaret, setCaretPosition, setDocument, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart
 
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, 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
The peer


pText

protected java.lang.String pText
Cache of the text to be loaded into the peer


pEchoChar

protected char pEchoChar
The char to use instead of showing what's typed (defaults to a *)

Constructor Detail

JPasswordField

public JPasswordField()
Creates a new JPasswordField


JPasswordField

public JPasswordField(java.lang.String text)
Creates a new JPasswordField

Parameters:
text - The text to put in the field

JPasswordField

public JPasswordField(int columns)
Creates a new JPasswordField

Parameters:
columns - The number of chars allowed

JPasswordField

public JPasswordField(java.lang.String text,
                      int columns)
Creates a new JPasswordField

Parameters:
text - The text for the field
columns - The number of chars allowed

JPasswordField

public JPasswordField(Document document,
                      java.lang.String text,
                      int columns)
Creates a new JPasswordField

Parameters:
document - The Document model to supply data to the component
text - The text to put in the field
columns - The number of chars allowed
Method Detail

getEchoChar

public char getEchoChar()
Returns:
The char used to output instead of the typed character

setEchoChar

public void setEchoChar(char c)
Parameters:
c - The char to output instead of what's typed

isEchoCharSet

public boolean isEchoCharSet()
Returns:
true if the echo char is set. This class defaults * as the echo char, so it's always set

getText

public java.lang.String getText()
Overrides:
getText in class JTextComponent
Returns:
the text of the field

getPassword

public char[] getPassword()
Returns:
The text of the field as a char array

setText

public void setText(java.lang.String text)
Overrides:
setText in class JTextComponent
Parameters:
text - The new text for the field

calculatePreferredSize

protected Dimension calculatePreferredSize()
Overriden to calculate non-realised preferred size.

Overrides:
calculatePreferredSize in class JTextField

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 JTextField
Throws:
java.lang.Exception