- Timestamp:
- 2018-12-16T20:59:37+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/gui/TestingPreparation.java
r32689 r32695 6 6 7 7 public class TestingPreparation { 8 public static boolean TEST_MODE = false;9 8 public static boolean TEST_MODE = true; // TODO: set to true for debugging. Reset to false when committing to svn 9 public static boolean DEBUGGING_TEST_MODE = true; 10 10 11 11 /* … … 21 21 - https://stackoverflow.com/questions/28639294/in-java-how-to-get-name-of-component-which-is-clicked 22 22 */ 23 public static void setNamesRecursively(Component root) { 24 if(!TEST_MODE) return; 25 26 // setNamesRecursively won't assign a name if one is already set 27 // But GUIManager for instance g_man has a name "frame0" assigned automatically 28 // Setting explicitly since GUIManager is preferred for its name 29 30 // Workaround to force replacement of non-informative names like frame0 for GUIManager 31 // and dialog0 for OpenCollectioNDialog 32 // Workaround is to not check if name already set for root, but to set it ourselves 33 String className = root.getClass().getSimpleName(); 34 root.setName(className); 35 36 setNamesRecursively("", root); 37 if (DEBUGGING_TEST_MODE) printComponentNames(root, ""); 38 } 39 23 40 public static void setNamesRecursively(String prefix, Component root) { 24 41 if(!TEST_MODE) return; … … 110 127 111 128 112 // For debugging swing Component names assigned with Container's setName() 129 // For debugging swing Component names assigned with Container's setName() 113 130 public static void printComponentNames(Component root, String tabbing) { 114 131 if(!TEST_MODE) return;
Note:
See TracChangeset
for help on using the changeset viewer.