- Timestamp:
- 01/27/12 14:44:44 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/InsertTextEquals.java
r230 r364 16 16 import de.ugoe.cs.eventbench.assertions.TextEqualsReplay; 17 17 import de.ugoe.cs.eventbench.data.Event; 18 import de.ugoe.cs.util.ArrayTools; 19 18 20 import org.eclipse.swt.events.SelectionAdapter; 19 21 import org.eclipse.swt.events.SelectionEvent; … … 58 60 item = item.getParentItem(); 59 61 while( item!=null ) { 60 targetString = item.getText()+targetString; 62 // TODO the "." is hard coded for the JFCMonitor. should be flexible 63 targetString = item.getText()+"."+targetString; 61 64 item = item.getParentItem(); 62 65 } … … 106 109 private void buildTargetTree() { 107 110 for( String target : targets ) { 108 TreeItem item = new TreeItem(targetTree, SWT.NULL); 109 item.setText(target); 110 // TODO needs rule that "splits" targets if necessary 111 TreeItem currentParent = null; 112 TreeItem[] currentItems = targetTree.getItems(); 113 114 //TODO needs rule for target splitting. currently its hard coded for JFCEvent targets. 115 String[] targetParts = target.split("\\.\\["); 116 for( String targetPart : targetParts) { 117 String[] currentTexts = new String[currentItems.length]; 118 for( int i=0; i<currentItems.length ; i++ ) { 119 currentTexts[i] = currentItems[i].getText(); 120 } 121 int index = ArrayTools.findIndex(currentTexts, targetPart); 122 if( index>= 0 ) { 123 currentParent = currentItems[index]; 124 } else { 125 if( currentParent==null ) { 126 currentParent = new TreeItem(targetTree, SWT.NULL); 127 currentParent.setText(targetPart); 128 } else { 129 currentParent = new TreeItem(currentParent, SWT.NULL); 130 currentParent.setText("["+targetPart); 131 } 132 } 133 currentItems = currentParent.getItems(); 134 } 111 135 } 112 136
Note: See TracChangeset
for help on using the changeset viewer.