jdk/src/share/classes/javax/swing/text/JTextComponent.java
changeset 21982 fd6e5fe509df
parent 21278 ef8a3a2a72f2
child 22260 c9185e010e03
equal deleted inserted replaced
21981:48b31d370bc9 21982:fd6e5fe509df
    85  * You can find information on how to use the functionality
    85  * You can find information on how to use the functionality
    86  * this class provides in
    86  * this class provides in
    87  * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/generaltext.html">General Rules for Using Text Components</a>,
    87  * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/generaltext.html">General Rules for Using Text Components</a>,
    88  * a section in <em>The Java Tutorial.</em>
    88  * a section in <em>The Java Tutorial.</em>
    89  *
    89  *
    90  * <p>
       
    91  * <dl>
    90  * <dl>
    92  * <dt><b><font size=+1>Caret Changes</font></b>
    91  * <dt><b><font size=+1>Caret Changes</font></b>
    93  * <dd>
    92  * <dd>
    94  * The caret is a pluggable object in swing text components.
    93  * The caret is a pluggable object in swing text components.
    95  * Notification of changes to the caret position and the selection
    94  * Notification of changes to the caret position and the selection
   106  * behavior can be changed by the {@link DefaultCaret#setUpdatePolicy} method.
   105  * behavior can be changed by the {@link DefaultCaret#setUpdatePolicy} method.
   107  * <br>
   106  * <br>
   108  * <b>Note</b>: Non-editable text components also have a caret though
   107  * <b>Note</b>: Non-editable text components also have a caret though
   109  * it may not be painted.
   108  * it may not be painted.
   110  *
   109  *
   111  * <p>
       
   112  * <dt><b><font size=+1>Commands</font></b>
   110  * <dt><b><font size=+1>Commands</font></b>
   113  * <dd>
   111  * <dd>
   114  * Text components provide a number of commands that can be used
   112  * Text components provide a number of commands that can be used
   115  * to manipulate the component.  This is essentially the way that
   113  * to manipulate the component.  This is essentially the way that
   116  * the component expresses its capabilities.  These are expressed
   114  * the component expresses its capabilities.  These are expressed
   118  * using the <code>TextAction</code> implementation.
   116  * using the <code>TextAction</code> implementation.
   119  * The set of commands supported by the text component can be
   117  * The set of commands supported by the text component can be
   120  * found with the {@link #getActions} method.  These actions
   118  * found with the {@link #getActions} method.  These actions
   121  * can be bound to key events, fired from buttons, etc.
   119  * can be bound to key events, fired from buttons, etc.
   122  *
   120  *
   123  * <p>
       
   124  * <dt><b><font size=+1>Text Input</font></b>
   121  * <dt><b><font size=+1>Text Input</font></b>
   125  * <dd>
   122  * <dd>
   126  * The text components support flexible and internationalized text input, using
   123  * The text components support flexible and internationalized text input, using
   127  * keymaps and the input method framework, while maintaining compatibility with
   124  * keymaps and the input method framework, while maintaining compatibility with
   128  * the AWT listener model.
   125  * the AWT listener model.
   204  * <li>removing content with the backspace and del
   201  * <li>removing content with the backspace and del
   205  *  keys.
   202  *  keys.
   206  * <li>caret movement forward and backward
   203  * <li>caret movement forward and backward
   207  * </ul>
   204  * </ul>
   208  *
   205  *
   209  * <p>
       
   210  * <dt><b><font size=+1>Model/View Split</font></b>
   206  * <dt><b><font size=+1>Model/View Split</font></b>
   211  * <dd>
   207  * <dd>
   212  * The text components have a model-view split.  A text component pulls
   208  * The text components have a model-view split.  A text component pulls
   213  * together the objects used to represent the model, view, and controller.
   209  * together the objects used to represent the model, view, and controller.
   214  * The text document model may be shared by other views which act as observers
   210  * The text document model may be shared by other views which act as observers
   229  * {@link DocumentEvent} which allows the views to stay up to date with the model.
   225  * {@link DocumentEvent} which allows the views to stay up to date with the model.
   230  * This event is sent to observers that have implemented the
   226  * This event is sent to observers that have implemented the
   231  * {@link DocumentListener}
   227  * {@link DocumentListener}
   232  * interface and registered interest with the model being observed.
   228  * interface and registered interest with the model being observed.
   233  *
   229  *
   234  * <p>
       
   235  * <dt><b><font size=+1>Location Information</font></b>
   230  * <dt><b><font size=+1>Location Information</font></b>
   236  * <dd>
   231  * <dd>
   237  * The capability of determining the location of text in
   232  * The capability of determining the location of text in
   238  * the view is provided.  There are two methods, {@link #modelToView}
   233  * the view is provided.  There are two methods, {@link #modelToView}
   239  * and {@link #viewToModel} for determining this information.
   234  * and {@link #viewToModel} for determining this information.
   240  *
   235  *
   241  * <p>
       
   242  * <dt><b><font size=+1>Undo/Redo support</font></b>
   236  * <dt><b><font size=+1>Undo/Redo support</font></b>
   243  * <dd>
   237  * <dd>
   244  * Support for an edit history mechanism is provided to allow
   238  * Support for an edit history mechanism is provided to allow
   245  * undo/redo operations.  The text component does not itself
   239  * undo/redo operations.  The text component does not itself
   246  * provide the history buffer by default, but does provide
   240  * provide the history buffer by default, but does provide
   247  * the <code>UndoableEdit</code> records that can be used in conjunction
   241  * the <code>UndoableEdit</code> records that can be used in conjunction
   248  * with a history buffer to provide the undo/redo support.
   242  * with a history buffer to provide the undo/redo support.
   249  * The support is provided by the Document model, which allows
   243  * The support is provided by the Document model, which allows
   250  * one to attach UndoableEditListener implementations.
   244  * one to attach UndoableEditListener implementations.
   251  *
   245  *
   252  * <p>
       
   253  * <dt><b><font size=+1>Thread Safety</font></b>
   246  * <dt><b><font size=+1>Thread Safety</font></b>
   254  * <dd>
   247  * <dd>
   255  * The swing text components provide some support of thread
   248  * The swing text components provide some support of thread
   256  * safe operations.  Because of the high level of configurability
   249  * safe operations.  Because of the high level of configurability
   257  * of the text components, it is possible to circumvent the
   250  * of the text components, it is possible to circumvent the
   259  * the model, so the documentation of <code>AbstractDocument</code>
   252  * the model, so the documentation of <code>AbstractDocument</code>
   260  * describes the assumptions of the protection provided.
   253  * describes the assumptions of the protection provided.
   261  * The methods that are safe to call asynchronously are marked
   254  * The methods that are safe to call asynchronously are marked
   262  * with comments.
   255  * with comments.
   263  *
   256  *
   264  * <p>
       
   265  * <dt><b><font size=+1>Newlines</font></b>
   257  * <dt><b><font size=+1>Newlines</font></b>
   266  * <dd>
   258  * <dd>
   267  * For a discussion on how newlines are handled, see
   259  * For a discussion on how newlines are handled, see
   268  * <a href="DefaultEditorKit.html">DefaultEditorKit</a>.
   260  * <a href="DefaultEditorKit.html">DefaultEditorKit</a>.
   269  *
   261  *
   270  * <p>
   262  *
   271  * <dt><b><font size=+1>Printing support</font></b>
   263  * <dt><b><font size=+1>Printing support</font></b>
   272  * <dd>
   264  * <dd>
   273  * Several {@link #print print} methods are provided for basic
   265  * Several {@link #print print} methods are provided for basic
   274  * document printing.  If more advanced printing is needed, use the
   266  * document printing.  If more advanced printing is needed, use the
   275  * {@link #getPrintable} method.
   267  * {@link #getPrintable} method.