01: /*
02: * de.jwic.controls.RadioGroupControl
03: * Created on 03.11.2004
04: * $Id: RadioGroupControl.java,v 1.1 2006/01/16 08:31:12 lordsam Exp $
05: */
06: package de.jwic.controls;
07:
08: import de.jwic.base.IControlContainer;
09:
10: /**
11: * Displays a list of radio buttons.
12: * @author Florian Lippisch
13: * @version $Revision: 1.1 $
14: */
15: public class RadioGroupControl extends ListControl {
16:
17: private static final long serialVersionUID = 2L;
18:
19: private int columns = 0;
20:
21: /**
22: * @param container
23: */
24: public RadioGroupControl(IControlContainer container) {
25: super (container, null);
26: }
27:
28: /**
29: * @param container
30: * @param name
31: */
32: public RadioGroupControl(IControlContainer container, String name) {
33: super (container, name);
34: }
35:
36: /**
37: * Used by the velocity template to determine if a new line is required.
38: * @param count
39: * @return
40: */
41: public boolean isDoBreak(int count) {
42: return columns != 0 && count % columns == 0;
43: }
44:
45: /**
46: * @return Returns the columns.
47: */
48: public int getColumns() {
49: return columns;
50: }
51:
52: /**
53: * @param columns The columns to set.
54: */
55: public void setColumns(int columns) {
56: this.columns = columns;
57: requireRedraw();
58: }
59: }
|