/** * Set the 'watch this page' checkbox to the specified state. */ public void setWatchThisPageCheckbox(boolean watch) { if (watchPageCheckbox.isSelected() != watch) { watchPageCheckbox.toggle(); } }
public void deselect() { if (isSelected()) { checkbox.toggle(); } }
private void setCheckbox(final boolean whether, final PageElement checkbox) { if(checkbox.isSelected() ^ whether) { checkbox.toggle(); } }
public WhatsNewDialog uncheckDontShow() { if (isDontShowChecked()) dontShowCheckbox.toggle(); return this; }
public void enableAutoComplete() { if (autoCompleteDisabledCheckbox.isSelected()) { autoCompleteDisabledCheckbox.toggle(); } }
public void enableAutoFormat() { if (autoFormatDisabledCheckbox.isSelected()) { autoFormatDisabledCheckbox.toggle(); } }
/** * Sets the selected state of this element. * * @param element Element * @param selected <tt>true</tt> if the element should be selected */ public static void setSelected(final PageElement element, final boolean selected) { Validate.notNull(element, "Element cannot be null"); if (element.isSelected() != selected) { element.toggle(); } } }
public void setAlsoDeleteChildPages(boolean checked) { if (checked) { alsoDeleteChildrenCheckbox.select(); } else if (alsoDeleteChildrenCheckbox.isSelected()) { alsoDeleteChildrenCheckbox.toggle(); } }
public CopyDialog setIncludeChildrenChecked(boolean checked) { if (checked) { includeChildrenCheckbox.select(); } else { if (includeChildrenCheckbox.isSelected()) { includeChildrenCheckbox.toggle(); } } return this; }
private AddUserPage setCheckbox(final PageElement checkbox, final boolean state) { if (state) { checkbox.select(); } else if (checkbox.isSelected()) { checkbox.toggle(); } return this; }
private CopyPageHierarchyDialog setCheckboxChecked(PageElement checkbox, boolean checked) { if (checked) { checkbox.select(); } else { if (checkbox.isSelected()) { checkbox.toggle(); } } return this; } }
public AddUserWithAppPermissionsPage setDevelopersGroup(final boolean value) { if (value) { developersGroup.select(); } else if (developersGroup.isSelected()) { developersGroup.toggle(); } return this; }
/** * Submits the form with the given list of users and applications * @param applicationsToGrant a list of accesses: any combination of elements of getAvailableApplications(). Any other string will have no effect. Users * will not be granted to the other applications. */ public void submit(Set<SupportedApplication> applicationsToGrant) { List<PageElement> allCheckboxes = form.findAll(By.name("applications")); for (PageElement checkbox : allCheckboxes) { String applicationName = checkbox.getValue(); if (applicationsToGrant.contains(SupportedApplication.valueOf(applicationName))) { //We must tick the checkbox if (!checkbox.isSelected()) { checkbox.toggle(); } } else { //We must untick the checkbox if (checkbox.isSelected()) { checkbox.toggle(); } } } submitButton.click(); }