jdk/src/share/classes/java/awt/TextComponent.java
changeset 19807 9f7860fad128
parent 16734 da1901d79073
child 20172 f48935a247ec
equal deleted inserted replaced
19806:dda89341ee2d 19807:9f7860fad128
    33 import sun.awt.InputMethodSupport;
    33 import sun.awt.InputMethodSupport;
    34 import java.text.BreakIterator;
    34 import java.text.BreakIterator;
    35 import javax.swing.text.AttributeSet;
    35 import javax.swing.text.AttributeSet;
    36 import javax.accessibility.*;
    36 import javax.accessibility.*;
    37 import java.awt.im.InputMethodRequests;
    37 import java.awt.im.InputMethodRequests;
       
    38 import sun.security.util.SecurityConstants;
    38 
    39 
    39 /**
    40 /**
    40  * The <code>TextComponent</code> class is the superclass of
    41  * The <code>TextComponent</code> class is the superclass of
    41  * any component that allows the editing of some text.
    42  * any component that allows the editing of some text.
    42  * <p>
    43  * <p>
   726      */
   727      */
   727     private boolean canAccessClipboard() {
   728     private boolean canAccessClipboard() {
   728         SecurityManager sm = System.getSecurityManager();
   729         SecurityManager sm = System.getSecurityManager();
   729         if (sm == null) return true;
   730         if (sm == null) return true;
   730         try {
   731         try {
   731             sm.checkSystemClipboardAccess();
   732             sm.checkPermission(SecurityConstants.AWT.ACCESS_CLIPBOARD_PERMISSION);
   732             return true;
   733             return true;
   733         } catch (SecurityException e) {}
   734         } catch (SecurityException e) {}
   734         return false;
   735         return false;
   735     }
   736     }
   736 
   737