jdk/src/share/classes/sun/swing/SwingAccessor.java
changeset 25132 a778c3c853bb
parent 23328 4c53a6ebc779
equal deleted inserted replaced
25131:49006bd0e69d 25132:a778c3c853bb
    25 
    25 
    26 package sun.swing;
    26 package sun.swing;
    27 
    27 
    28 import sun.misc.Unsafe;
    28 import sun.misc.Unsafe;
    29 
    29 
    30 import java.awt.Point;
    30 import java.awt.*;
    31 import javax.swing.RepaintManager;
    31 import javax.swing.*;
    32 
    32 
    33 import javax.swing.text.JTextComponent;
    33 import javax.swing.text.JTextComponent;
    34 import javax.swing.TransferHandler;
       
    35 
    34 
    36 /**
    35 /**
    37  * The SwingAccessor utility class.
    36  * The SwingAccessor utility class.
    38  * The main purpose of this class is to enable accessing
    37  * The main purpose of this class is to enable accessing
    39  * private and package-private fields of classes from
    38  * private and package-private fields of classes from
    86      * An accessor for the RepaintManager class.
    85      * An accessor for the RepaintManager class.
    87      */
    86      */
    88     public interface RepaintManagerAccessor {
    87     public interface RepaintManagerAccessor {
    89         void addRepaintListener(RepaintManager rm, SwingUtilities2.RepaintListener l);
    88         void addRepaintListener(RepaintManager rm, SwingUtilities2.RepaintListener l);
    90         void removeRepaintListener(RepaintManager rm, SwingUtilities2.RepaintListener l);
    89         void removeRepaintListener(RepaintManager rm, SwingUtilities2.RepaintListener l);
       
    90     }
       
    91 
       
    92     /**
       
    93      * An accessor for PopupFactory class.
       
    94      */
       
    95     public interface PopupFactoryAccessor {
       
    96         Popup getHeavyWeightPopup(PopupFactory factory, Component owner, Component contents,
       
    97                                   int ownerX, int ownerY);
    91     }
    98     }
    92 
    99 
    93     /**
   100     /**
    94      * The javax.swing.text.JTextComponent class accessor object.
   101      * The javax.swing.text.JTextComponent class accessor object.
    95      */
   102      */
   154         if (repaintManagerAccessor == null) {
   161         if (repaintManagerAccessor == null) {
   155             unsafe.ensureClassInitialized(RepaintManager.class);
   162             unsafe.ensureClassInitialized(RepaintManager.class);
   156         }
   163         }
   157         return repaintManagerAccessor;
   164         return repaintManagerAccessor;
   158     }
   165     }
       
   166 
       
   167     /**
       
   168      * The PopupFactory class accessor object.
       
   169      */
       
   170     private static PopupFactoryAccessor popupFactoryAccessor;
       
   171 
       
   172     /**
       
   173      * Retrieve the accessor object for the PopupFactory class.
       
   174      */
       
   175     public static PopupFactoryAccessor getPopupFactoryAccessor() {
       
   176         if (popupFactoryAccessor == null) {
       
   177             unsafe.ensureClassInitialized(PopupFactory.class);
       
   178         }
       
   179         return popupFactoryAccessor;
       
   180     }
       
   181 
       
   182     /**
       
   183      * Set an Accessor object for the PopupFactory class.
       
   184      */
       
   185     public static void setPopupFactoryAccessor(PopupFactoryAccessor popupFactoryAccessor) {
       
   186         SwingAccessor.popupFactoryAccessor = popupFactoryAccessor;
       
   187     }
   159 }
   188 }