/[classpath]/classpath/javax/swing/TransferHandler.java
ViewVC logotype

Diff of /classpath/javax/swing/TransferHandler.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5.2.8 by gnu_andrew, Wed Nov 2 00:43:49 2005 UTC revision 1.5.2.9 by gnu_andrew, Sun Nov 27 21:00:38 2005 UTC
# Line 75  public class TransferHandler implements Line 75  public class TransferHandler implements
75          }          }
76      }      }
77        
78        /**
79         * Get the system cliboard. If not available, create and return the VM-local
80         * clipboard.
81         *
82         * @param component a component, used to get the toolkit.
83         * @return the clipboard
84         */
85      private static Clipboard getClipboard(JComponent component)      private static Clipboard getClipboard(JComponent component)
86      {      {
87        SecurityManager sm = System.getSecurityManager();        try
88                {
89        if (sm != null)            SecurityManager sm = System.getSecurityManager();
90          {            if (sm != null)
91            try              sm.checkSystemClipboardAccess();
             {  
               sm.checkSystemClipboardAccess();  
92    
93                // We may access system clipboard.            // We may access the system clipboard.
94                return component.getToolkit().getSystemClipboard();            return component.getToolkit().getSystemClipboard();
95              }          }
96            catch (SecurityException e)        catch (Exception e)
97              {          {
98                // We may not access system clipboard.            // We may not access system clipboard.
99              }            // Create VM-local clipboard if none exists yet.
100          }            if (clipboard == null)
101                    clipboard = new Clipboard("Clipboard");
102        // Create VM-local clipboard if non exists yet.            return clipboard;
103        if (clipboard == null)          }
         clipboard = new Clipboard("Clipboard");  
   
       return clipboard;  
104      }      }
105    }    }
106        

Legend:
Removed from v.1.5.2.8  
changed lines
  Added in v.1.5.2.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26