Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/javax/swing/text/DefaultStyledDocument.java
          +++ new/src/share/classes/javax/swing/text/DefaultStyledDocument.java
↓ open down ↓ 165 lines elided ↑ open up ↑
 166  166      /**
 167  167       * Inserts new elements in bulk.  This is useful to allow
 168  168       * parsing with the document in an unlocked state and
 169  169       * prepare an element structure modification.  This method
 170  170       * takes an array of tokens that describe how to update an
 171  171       * element structure so the time within a write lock can
 172  172       * be greatly reduced in an asynchronous update situation.
 173  173       * <p>
 174  174       * This method is thread safe, although most Swing methods
 175  175       * are not. Please see
 176      -     * <A HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
      176 +     * <A HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
 177  177       * in Swing</A> for more information.
 178  178       *
 179  179       * @param offset the starting offset &gt;= 0
 180  180       * @param data the element data
 181  181       * @exception BadLocationException for an invalid starting offset
 182  182       */
 183  183      protected void insert(int offset, ElementSpec[] data) throws BadLocationException {
 184  184          if (data == null || data.length == 0) {
 185  185              return;
 186  186          }
↓ open down ↓ 232 lines elided ↑ open up ↑
 419  419      /**
 420  420       * Sets the logical style to use for the paragraph at the
 421  421       * given position.  If attributes aren't explicitly set
 422  422       * for character and paragraph attributes they will resolve
 423  423       * through the logical style assigned to the paragraph, which
 424  424       * in turn may resolve through some hierarchy completely
 425  425       * independent of the element hierarchy in the document.
 426  426       * <p>
 427  427       * This method is thread safe, although most Swing methods
 428  428       * are not. Please see
 429      -     * <A HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
      429 +     * <A HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
 430  430       * in Swing</A> for more information.
 431  431       *
 432  432       * @param pos the offset from the start of the document &gt;= 0
 433  433       * @param s  the logical style to assign to the paragraph, null if none
 434  434       */
 435  435      public void setLogicalStyle(int pos, Style s) {
 436  436          Element paragraph = getParagraphElement(pos);
 437  437          if ((paragraph != null) && (paragraph instanceof AbstractElement)) {
 438  438              try {
 439  439                  writeLock();
↓ open down ↓ 36 lines elided ↑ open up ↑
 476  476      }
 477  477  
 478  478      /**
 479  479       * Sets attributes for some part of the document.
 480  480       * A write lock is held by this operation while changes
 481  481       * are being made, and a DocumentEvent is sent to the listeners
 482  482       * after the change has been successfully completed.
 483  483       * <p>
 484  484       * This method is thread safe, although most Swing methods
 485  485       * are not. Please see
 486      -     * <A HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
      486 +     * <A HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
 487  487       * in Swing</A> for more information.
 488  488       *
 489  489       * @param offset the offset in the document &gt;= 0
 490  490       * @param length the length &gt;= 0
 491  491       * @param s the attributes
 492  492       * @param replace true if the previous attributes should be replaced
 493  493       *  before setting the new attributes
 494  494       */
 495  495      public void setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace) {
 496  496          if (length == 0) {
↓ open down ↓ 32 lines elided ↑ open up ↑
 529  529              writeUnlock();
 530  530          }
 531  531  
 532  532      }
 533  533  
 534  534      /**
 535  535       * Sets attributes for a paragraph.
 536  536       * <p>
 537  537       * This method is thread safe, although most Swing methods
 538  538       * are not. Please see
 539      -     * <A HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
      539 +     * <A HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency
 540  540       * in Swing</A> for more information.
 541  541       *
 542  542       * @param offset the offset into the paragraph &gt;= 0
 543  543       * @param length the number of characters affected &gt;= 0
 544  544       * @param s the attributes
 545  545       * @param replace whether to replace existing attributes, or merge them
 546  546       */
 547  547      public void setParagraphAttributes(int offset, int length, AttributeSet s,
 548  548                                         boolean replace) {
 549  549          try {
↓ open down ↓ 2195 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX