/** * Creates a <code>ChoiceSelector</code>. * * @param formComponent * a <code>FormComponent</code> * @return ChoiceSelector a <code>ChoiceSelector</code> */ protected ChoiceSelector create(FormComponent<?> formComponent) { if (formComponent == null) { fail("Trying to select on null component."); } if (formComponent instanceof RadioGroup || formComponent instanceof DropDownChoice || formComponent instanceof RadioChoice) { return new SingleChoiceSelector(formComponent); } else if (allowMultipleChoice(formComponent)) { return new MultipleChoiceSelector(formComponent); } else { fail("Selecting on the component:'" + formComponent.getPath() + "' is not supported."); return null; } }
/** * Creates a <code>ChoiceSelector</code>. * * @param formComponent * a <code>FormComponent</code> * @return ChoiceSelector a <code>ChoiceSelector</code> */ protected ChoiceSelector create(FormComponent<?> formComponent) { if (formComponent == null) { fail("Trying to select on null component."); return null; } else if (formComponent instanceof RadioGroup || formComponent instanceof AbstractSingleSelectChoice) { return new SingleChoiceSelector(formComponent); } else if (allowMultipleChoice(formComponent)) { return new MultipleChoiceSelector(formComponent); } else { fail("Selecting on the component:'" + formComponent.getPath() + "' is not supported."); return null; } }
/** * Creates a <code>ChoiceSelector</code>. * * @param formComponent * a <code>FormComponent</code> * @return ChoiceSelector a <code>ChoiceSelector</code> */ protected ChoiceSelector create(FormComponent formComponent) { if (formComponent == null) { fail("Trying to select on null component."); } if (formComponent instanceof RadioGroup || formComponent instanceof DropDownChoice || formComponent instanceof RadioChoice) { return new SingleChoiceSelector(formComponent); } else if (allowMultipleChoice(formComponent)) { return new MultipleChoiceSelector(formComponent); } else { fail("Selecting on the component:'" + formComponent.getPath() + "' is not supported."); return null; } }
/** * Creates a <code>ChoiceSelector</code>. * * @param formComponent * a <code>FormComponent</code> * @return ChoiceSelector a <code>ChoiceSelector</code> */ protected ChoiceSelector create(FormComponent<?> formComponent) { if (formComponent == null) { fail("Trying to select on null component."); return null; } else if (formComponent instanceof RadioGroup || formComponent instanceof AbstractSingleSelectChoice) { return new SingleChoiceSelector(formComponent); } else if (allowMultipleChoice(formComponent)) { return new MultipleChoiceSelector(formComponent); } else { fail("Selecting on the component:'" + formComponent.getPath() + "' is not supported."); return null; } }
/** * Constructor. * * @param formComponent * a <code>FormComponent</code> */ protected MultipleChoiceSelector(FormComponent<?> formComponent) { super(formComponent); if (!allowMultipleChoice(formComponent)) { fail("Component:'" + formComponent.getPath() + "' Does not support multiple selection."); } }