/Users/lyon/j4p/src/gui/tree/DnDUtils.java

1    package gui.tree; 
2     
3    import java.awt.dnd.DnDConstants; 
4     
5    public class DnDUtils { 
6        public static String showActions(int action) { 
7            String actions = ""; 
8            if ((action & (DnDConstants.ACTION_LINK | DnDConstants.ACTION_COPY_OR_MOVE)) == 0) { 
9                return "None"; 
10           } 
11    
12           if ((action & DnDConstants.ACTION_COPY) != 0) { 
13               actions += "Copy "; 
14           } 
15    
16           if ((action & DnDConstants.ACTION_MOVE) != 0) { 
17               actions += "Move "; 
18           } 
19    
20           if ((action & DnDConstants.ACTION_LINK) != 0) { 
21               actions += "Link"; 
22           } 
23    
24           return actions; 
25       } 
26    
27       public static boolean isDebugEnabled() { 
28           return debugEnabled; 
29       } 
30    
31       public static void debugPrintln(String s) { 
32           if (debugEnabled) { 
33               System.out.println(s); 
34           } 
35       } 
36    
37       private static boolean debugEnabled = 
38               (System.getProperty("DnDExamples.debug") != null); 
39   }