Revision 1098 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.dynform/org.gvsig.tools.dynform.services/src/main/java/org/gvsig/tools/dynform/services/dynformset/subform/FormSetButtonBar.java

View differences:

FormSetButtonBar.java
156 156
	}
157 157
	
158 158
	private void updateRecords() {
159
		setEnabled(ActionNew, true);
159 160
		if( numrecords <= 0 ) {
160 161
			this.records.setText( "0 / 0");
161 162
			setEnabled(ActionFirst, false);
162 163
			setEnabled(ActionPrevious, false);
163 164
			setEnabled(ActionNext, false);
164
			setEnabled(ActionPrevious, false);
165
			setEnabled(ActionLast, false);
165 166
			return;
166 167
		} 
167 168
		this.records.setText((current+1) + " / " + numrecords);
......
210 211
		this.contents.add(createButton("Search", "search.png", ActionSearch));
211 212
		
212 213
		this.contents.add(createButton("Close", "close.png", ActionClose));
214
		this.initButtons();
213 215
		this.updateRecords();
214
		this.initButtons();
215 216
	}
216 217

  
217 218
	private void initButtons() {
......
219 220
		setActionActive(ActionNew, isActionActive(ActionNew));
220 221
		setActionActive(ActionSearch, isActionActive(ActionSearch));
221 222
		setActionActive(ActionDelete, isActionActive(ActionDelete));
223
		setActionActive(ActionClose, isActionActive(ActionClose));
222 224
	}
223 225

  
224 226
	private JComponent createButton(final String tip, final String image, final int action) {
......
263 265
	
264 266
	public void setActionActive(int action, boolean active){
265 267
		if(action == ActionSave || action == ActionDelete ||
266
			action == ActionNew ||	action == ActionSearch){
268
			action == ActionNew ||	action == ActionSearch||
269
			action == ActionClose){
267 270
				if( this.contents == null ) {
268 271
					this.initComponents();
269 272
				}

Also available in: Unified diff