Changeset 12823
- Timestamp:
- 2006-09-21T17:23:54+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/GComboBox.java
r9184 r12823 57 57 private Color selection_foreground = null; 58 58 59 private boolean sort_objects = true; 60 59 61 public GComboBox() { 60 62 super(); … … 79 81 } 80 82 83 public GComboBox(ArrayList data, boolean editable, boolean sorted) { 84 super(data.toArray()); 85 setEditable(editable); 86 setSorted(sorted); 87 init(); 88 } 89 81 90 public GComboBox(ComboBoxModel model) { 82 91 super(model); … … 101 110 } 102 111 112 public GComboBox(Object data[], boolean editable, boolean sorted) { 113 super(data); 114 setEditable(editable); 115 setSorted(sorted); 116 init(); 117 } 118 103 119 public GComboBox(Vector data) { 104 120 super(data); … … 112 128 } 113 129 130 public void setSorted(boolean sort) { 131 sort_objects = sort; 132 } 114 133 public int add(Object object) { 115 134 if (dataModel instanceof Model) { … … 247 266 private class Model 248 267 extends DefaultComboBoxModel { 249 268 269 250 270 public int add(Object extension) { 251 271 int position = 0; … … 255 275 int order = extension_str.compareTo(sibling); 256 276 // If we are now less than the sibling, insert here. 257 if( order < 0) {277 if(sort_objects && order < 0) { 258 278 insertElementAt(extension, position); 259 279 extension = null;
Note:
See TracChangeset
for help on using the changeset viewer.