Revision 6577

View differences:

trunk/libraries/libUI/src/org/gvsig/gui/beans/comboBoxItemsSeeker/JComboBoxItemsSeekerDynamic.java
87 87
* This class allows users to insert a chain of characters and show all the sentences of the JComboBox that match its first ones characters with it.
88 88
* This class is also a Java Bean, and is made according the MVC (Model - View - Controller) pattern.
89 89
* This class has the View, the Control and can access to the Model.
90
* The behavior of this componet can be configurated by 7 flags:
90
* The behavior of this componet can be configurated by 7 flags: (Esto lo cambio!!!!!)
91 91
*  + The appearence of the items showed at the beginning and when the user presses the ESCAPE key: (This is configured with 2 flags -> 3 different states are possible) 
92 92
*  	   -> maintainPositionItems -> When we see the list of all items, this are showed in the ordenation as they have been introduced (if true); (if false) each new item 
93
*           when we write on the TextField of this Component will be showed at the end
93
*           when we write on the TextField of this Component will be showed at the end (esto ?ltimo creo q. no -> revisarlo)
94 94
*      -> all_Alphanumeric_Sorted -> All items we can see in this Component will be showed in alphanumeric ordenation (if true)
95 95
*  + The list of the items showed when the user makes a search writting or pressing the BACK-SPACE key (This is configured with 1 flag -> 2 different states are possible)
96 96
*      -> alphanumericSortedSearches -> When we write on the TextField of this Component all results (items) are showed in alphanumeric ordenation (if true)
......
135 135
	private Set notRemovedItems;
136 136
	private Set removedItems;*/
137 137
	
138
	
138 139
	// CONFIGURATION FLAGS
139 140
	private boolean onlyOneColor;
140 141
	private boolean completeMatchedItem;
......
148 149
	private int lastSelectedIndex;
149 150
	
150 151
	// pueDE QUE TB. SOBRE
151
	private int num = 0;
152
//	private int num = 0;
152 153
//	private JTextField txtField;
153 154
	
154 155
	// Reference to the ui
trunk/libraries/libUI/src/org/gvsig/gui/beans/comboBoxItemsSeeker/ComboBoxItemsSeekerDynamicModel.java
61 61
public class ComboBoxItemsSeekerDynamicModel extends DefaultComboBoxModel implements java.io.Serializable {
62 62
	// INNER MODEL STRUCTURES
63 63
	private Set itemsShowed;
64
	private Object itemsShowedSortedOrDisordered[];	
64
	private Object itemsShowedSortedOrDisordered[];
65
	private String writtenText;
65 66
//	private String writtenString = "";
66 67
	// END INNER MODEL STRUCTURES
67 68
	
68
	// CONFIGURATION FLAGS
69
	// CONTANTS FOR CONFIGURE THE BEHAVIOR
70
	public final int ORIGINAL_POSITION_ALL = 0;
71
	public final int SORTED_ALL = 1;
72
	public final int DISORDERED_ALL = 2;
73

  
74
	public final int ORIGINAL_POSITION_SEARCH = 0;
75
	public final int SORTED_SEARCH = 1;
76
	public final int DISORDERED_SEARCH = 2;
77
	// END CONTANTS FOR CONFIGURE THE BEHAVIOR
78
	
79
	// CONFIGURATION FLAGS (Voy a Cambiar algunas!!!!)
69 80
	private boolean maintainPositionItems;	
70 81
	private boolean alphanumericSortedSearches;
71 82
	private boolean allAlphanumericSorted;
......
127 138
		thisIsAComboBoxItemsSeekerDynamicModelClass = true;
128 139
		
129 140
//		this.currentString = "";
141
		this.writtenText = "";
130 142
		this.setDefaultBehaviorFlagsConfiguration();
131 143
		this.allItemsAreSorted = false;
132 144
		this.allItemsAreDisordered = false;
......
346 358
	public Object getElementAt(int index) {
347 359
		if (this.showAllItems)
348 360
		{
361

  
362
			// Primero considerar el mostrar todos al comienzo
363
			
364
			
365
			
366
			// Caso de las b?squedas
367
			
349 368
			// If the items have to be showed in ascending order
350 369
			if (this.alphanumericSortedSearches)
351 370
			{
......
538 557
//	}
539 558
	
540 559
	
541

  
542
	public void setWrittenString(String writtenString) {
560
	/**
561
	 * 
562
	 */
563
	public void setWrittenString(String text) {
543 564
//		System.out.println("Entrada: " + writtenString);
565
		writtenText = text;
544 566
		
545 567
		if ((!this.maintainPositionItems) && (!this.alphanumericSortedSearches))
546 568
			this.disorderItemsCopy();

Also available in: Unified diff