Changeset 364 for trunk/EventBenchConsole/src/de/ugoe/cs
- Timestamp:
- 01/27/12 14:44:44 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt
- Files:
-
- 2 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 -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SequencesDialog.java
r287 r364 116 116 if( SequenceInstanceOf.isCollectionOfSequences(dataObject)) { 117 117 sequences = (Collection<java.util.List<Event<?>>>) dataObject; 118 int seqDigits = 4; // TODO calculate seqDigits dynamically118 int seqDigits = Integer.toString(sequences.size()).length(); 119 119 int counter = 1; 120 120 for( java.util.List<Event<?>> sequence : sequences ) { 121 String seqName = "#"+ Integer.toString(counter, seqDigits)+": "+sequence.size();121 String seqName = "#"+String.format("%0"+seqDigits+"d", counter)+": "+sequence.size(); 122 122 sequenceList.add(seqName); 123 123 counter++; … … 144 144 } 145 145 } else { 146 // TODO this should not happen - needs to be handled anyways 146 MessageBox messageBox = new MessageBox(shell, SWT.ERROR); 147 messageBox.setMessage("Internal error. Sequences object not of expected type!"); 148 messageBox.setText("Error"); 149 messageBox.open(); 147 150 } 148 151 }
Note: See TracChangeset
for help on using the changeset viewer.