jdk/src/share/classes/javax/swing/text/JTextComponent.java
changeset 3084 67ca55732362
parent 1287 a04aca99c77a
child 3737 83fb4621a129
equal deleted inserted replaced
3083:1954edd3b7a7 3084:67ca55732362
    74 
    74 
    75 
    75 
    76 import sun.swing.PrintingStatus;
    76 import sun.swing.PrintingStatus;
    77 import sun.swing.SwingUtilities2;
    77 import sun.swing.SwingUtilities2;
    78 import sun.swing.text.TextComponentPrintable;
    78 import sun.swing.text.TextComponentPrintable;
       
    79 import sun.swing.SwingAccessor;
    79 
    80 
    80 /**
    81 /**
    81  * <code>JTextComponent</code> is the base class for swing text
    82  * <code>JTextComponent</code> is the base class for swing text
    82  * components.  It tries to be compatible with the
    83  * components.  It tries to be compatible with the
    83  * <code>java.awt.TextComponent</code> class
    84  * <code>java.awt.TextComponent</code> class
   759      */
   760      */
   760     public final DropMode getDropMode() {
   761     public final DropMode getDropMode() {
   761         return dropMode;
   762         return dropMode;
   762     }
   763     }
   763 
   764 
       
   765     static {
       
   766         SwingAccessor.setJTextComponentAccessor(
       
   767             new SwingAccessor.JTextComponentAccessor() {
       
   768                 public TransferHandler.DropLocation dropLocationForPoint(JTextComponent textComp,
       
   769                                                                          Point p)
       
   770                 {
       
   771                     return textComp.dropLocationForPoint(p);
       
   772                 }
       
   773                 public Object setDropLocation(JTextComponent textComp,
       
   774                                               TransferHandler.DropLocation location,
       
   775                                               Object state, boolean forDrop)
       
   776                 {
       
   777                     return textComp.setDropLocation(location, state, forDrop);
       
   778                 }
       
   779             });
       
   780     }
       
   781 
   764 
   782 
   765     /**
   783     /**
   766      * Calculates a drop location in this component, representing where a
   784      * Calculates a drop location in this component, representing where a
   767      * drop at the given point should insert data.
   785      * drop at the given point should insert data.
   768      * <p>
   786      * <p>