Changeset 7691
- Timestamp:
- 2004-07-02T08:11:08+12:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/table/GTableModel.java
r7511 r7691 175 175 builder.select_closest_metadata = metadatum; 176 176 } 177 // Otherwise, select the appropriate row in the table 177 // Otherwise, select the appropriate row in the table... 178 178 else { 179 180 // If there was no previous metadata, select the first row (if any) 181 if(metadatum == null) { 182 if(current_metadata.size() > 0) { 183 // We have to put the selection task onto the AWT thread 184 SelectionTask task = new SelectionTask(0); 185 SwingUtilities.invokeLater(task); 186 task = null; 187 } 179 // ...but only if there actually is some metadata in the table 180 if (current_metadata.size() == 0) { 181 return; 182 } 183 184 // If there was no previous metadata, select the first row 185 if (metadatum == null) { 186 // We have to put the selection task onto the AWT thread 187 SelectionTask task = new SelectionTask(0); 188 SwingUtilities.invokeLater(task); 189 task = null; 188 190 return; 189 191 } … … 205 207 // Select the same row as before, except if it would select a different element - in which case select the first element 206 208 ElementWrapper element = metadatum.getElement(); 207 if (i < 0) {209 if (i < 0) { 208 210 Gatherer.println("Could not find suitable row to select!"); 209 i =0; // select the first one210 //return;211 }else {211 i = 0; // select the first one 212 } 213 else { 212 214 Metadata newly_selected_metadatum = (Metadata) current_metadata.get(i); 213 215 if (!newly_selected_metadatum.getElement().equals(element)) { 214 216 // Try one row previous 215 217 i--; 216 if (i < 0) {218 if (i < 0) { 217 219 Gatherer.println("Could not find suitable row to select!"); 218 i=0; 219 //return; 220 } else { 221 220 i = 0; 221 } 222 else { 222 223 newly_selected_metadatum = (Metadata) current_metadata.get(i); 223 224 if (!newly_selected_metadatum.getElement().equals(element)) { 224 225 Gatherer.println("Could not find suitable row to select!"); 225 i=0; 226 //return; 226 i = 0; 227 227 } 228 228 }
Note:
See TracChangeset
for help on using the changeset viewer.