本文整理汇总了Java中org.apache.wicket.ajax.markup.html.form.AjaxCheckBox类的典型用法代码示例。如果您正苦于以下问题:Java AjaxCheckBox类的具体用法?Java AjaxCheckBox怎么用?Java AjaxCheckBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AjaxCheckBox类属于org.apache.wicket.ajax.markup.html.form包,在下文中一共展示了AjaxCheckBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CheckBoxPanel
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
public CheckBoxPanel(String id, IModel<Boolean> model, final IModel<Boolean> enabled) {
super(id);
AjaxCheckBox check = new AjaxCheckBox(ID_CHECK, model) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
CheckBoxPanel.this.onUpdate(target);
}
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
CheckBoxPanel.this.updateAjaxAttributes(attributes);
}
};
check.setOutputMarkupId(true);
check.add(new VisibleEnableBehaviour() {
@Override
public boolean isEnabled() {
return enabled.getObject();
}
});
add(check);
}
示例2: initLayout
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
private void initLayout(final IModel<ObjectWrapper> model) {
AjaxCheckBox check = new AjaxCheckBox("check", new PropertyModel<Boolean>(model, "selected")) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
PrismOptionButtonPanel.this.checkBoxOnUpdate(target);
}
};
check.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return model.getObject().isSelectable();
}
});
check.setOutputMarkupId(true);
add(check);
initButtons(model);
}
示例3: testSelectAllCheckbox
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
public void testSelectAllCheckbox() {
addDependencyValues();
Assert.assertFalse(((AjaxCheckBox) tester.getComponentFromLastRenderedPage(listViewPath + ":0:deleteCheckbox")).getModel().getObject());
// click checkbox
FormTester formTester = tester.newFormTester(formPath, false);
formTester.setValue("dependenciesContainer:selectAllCheckbox", true);
tester.executeAjaxEvent(formPath + ":dependenciesContainer:selectAllCheckbox", "onclick");
ComponentHierarchyIterator allCheckboxes = tester.getLastRenderedPage().visitChildren(AjaxCheckBox.class);
int numberOfCheckedBoxes = 0;
for (Component box : allCheckboxes) {
numberOfCheckedBoxes++;
System.out.println("PATH: " + box.getPageRelativePath());
Assert.assertTrue(((AjaxCheckBox) box).getModel().getObject());
}
Assert.assertEquals(3, numberOfCheckedBoxes);
}
示例4: DesignerArchitectureMatrixCellDataPanel
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
public DesignerArchitectureMatrixCellDataPanel(String id, final LogicalService parentRow, final ProcessingNode parentCol) {
super(id);
this.parentRow = parentRow;
this.parentCol = parentCol;
this.selected = getParentsAssociation(getParentCol(), getParentRow()) != null;
Form<Void> form = new Form<>("form");
AjaxCheckBox associated = new AjaxCheckBox("associated", new PropertyModel<Boolean>(this, "selected")) {
private static final long serialVersionUID = 3106596297110619383L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
onCheck((Boolean) getDefaultModelObject(), target);
}
};
form.add(associated);
add(form);
}
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:18,代码来源:DesignerArchitectureMatrixCellDataPanel.java
示例5: private_application_should_be_listed_as_private
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
@Test
public void private_application_should_be_listed_as_private() throws Exception {
// GIVEN
// Prepare mocks for app provider
prepareMocksForPrivateApp();
// WHEN : go to the applications list
myTester.startPage(ApplicationsPage.class);
// click on "all applications" checkbox to see the app
AjaxCheckBox chkbx = (AjaxCheckBox) myTester.getComponentFromLastRenderedPage("allAppsCheckbox");
myTester.getRequest().getPostParameters().setParameterValue(chkbx.getInputName(), "true");
myTester.executeAjaxEvent("allAppsCheckbox", "click");
// THEN : the application has visibility attribute set to private
myTester.assertContains(ApplicationVisibilityPanel.APP_VISIBILITY_PRIVATE);
}
示例6: addFormFields
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
/**
* @see org.projectforge.web.calendar.AbstractICSExportDialog#addFormFields()
*/
@Override
protected void addFormFields()
{
if (teamCal.getOwnerId() != null && teamCal.getOwnerId().equals(PFUserContext.getUserId()) == true) {
// Export reminders for owners as default.
exportReminders = true;
}
final FieldsetPanel fs = gridBuilder.newFieldset(getString("label.options")).suppressLabelForWarning();
final DivPanel checkBoxesPanel = new DivPanel(fs.newChildId(), DivType.BTN_GROUP);
fs.add(checkBoxesPanel);
@SuppressWarnings("serial")
final AjaxCheckBox checkBox = new AjaxCheckBox(CheckBoxPanel.WICKET_ID, new PropertyModel<Boolean>(this, "exportReminders")) {
@Override
protected void onUpdate(final AjaxRequestTarget target)
{
target.add(urlTextArea);
}
};
checkBoxesPanel.add(new CheckBoxButton(checkBoxesPanel.newChildId(), checkBox, getString("plugins.teamcal.export.reminder.checkbox"))
.setTooltip(getString("plugins.teamcal.export.reminder.checkbox.tooltip")));
}
示例7: AdvancedSearchOptionsPanel
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
public AdvancedSearchOptionsPanel(String id, IModel theCollectionModel) {
super(id);
this.collectionModel = new ReloadableEntityModel<RecordCollection>(
theCollectionModel);
AjaxCheckBox enabledCheckbox = getEnabledCheckbox();
add(enabledCheckbox);
ListView enabledRules = getEnabledRulesListView();
add(enabledRules);
DropDownChoice initialRulesNumberDropdownChoice = getInitialRulesNumberDropdownChoice();
add(initialRulesNumberDropdownChoice);
add(new WebMarkupContainer("enabledRulesHeader") {
@Override
public boolean isVisible() {
RecordCollection collection = collectionModel.getObject();
return collection.isAdvancedSearchEnabled();
}
});
}
示例8: getEnabledCheckbox
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
private AjaxCheckBox getEnabledCheckbox() {
AjaxCheckBox enabledCheckbox = new AjaxCheckBox("enabled",
new PropertyModel(collectionModel, "advancedSearchEnabled")) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
EntityManager entityManager = ConstellioPersistenceContext
.getCurrentEntityManager();
if (!entityManager.getTransaction().isActive()) {
entityManager.getTransaction().begin();
}
RecordCollection collection = collectionModel.getObject();
RecordCollectionServices recordCollectionServices = ConstellioSpringUtils
.getRecordCollectionServices();
recordCollectionServices.merge(collection);
entityManager.getTransaction().commit();
target.addComponent(AdvancedSearchOptionsPanel.this);
}
};
return enabledCheckbox;
}
示例9: ScheduleValidator
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
public ScheduleValidator(TaskManager manager, AjaxCheckBox recurring, AjaxCheckBox bound, TextField<Integer> interval, TextField<String> cron) {
//System.out.println("new ScheduleValidator: recurring = " + recurring + ", bound = " + bound);
taskManager = manager;
this.recurring = recurring;
this.bound = bound;
this.interval = interval;
this.cron = cron;
}
示例10: initLayout
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
protected void initLayout(VisibleEnableBehaviour checkBoxVisibleEnable) {
final AjaxCheckBox checkBox = new AjaxCheckBox(ID_ADVANCED_FEATURES, getModel()) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
onAdvancedFeaturesUpdate(target);
}
};
if (checkBoxVisibleEnable != null) {
checkBox.add(checkBoxVisibleEnable);
}
add(checkBox);
}
示例11: hasToZip
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
private boolean hasToZip() {
BoxedTablePanel table = (BoxedTablePanel) getListTable();
SearchFragment header = (SearchFragment) table.getHeader();
AjaxCheckBox zipCheck = header.getZipCheck();
return zipCheck.getModelObject();
}
示例12: onInitialize
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
final boolean isGroupAdmin = hasGroupAdminLevel(getRights());
userToadd.setEnabled(!isGroupAdmin);
add(new RequiredTextField<String>("name").setLabel(Model.of(getString("165"))));
add(logo);
add(new TextField<String>("tag").setLabel(Model.of(getString("admin.group.form.tag"))));
add(new CheckBox("restricted").setLabel(Model.of(getString("restricted.group.files"))));
add(new AjaxCheckBox("limited") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(
maxFilesSize.setEnabled(getModelObject())
, maxRecordingsSize.setEnabled(getModelObject())
, maxRooms.setEnabled(getModelObject())
, recordingTtl.setEnabled(getModelObject())
, reminderDays.setEnabled(getModelObject())
);
}
}.setLabel(Model.of(getString("admin.group.form.limited"))));
add(maxFilesSize.setLabel(Model.of(getString("admin.group.form.maxFilesSize"))).setEnabled(false).setOutputMarkupId(true));
add(maxRecordingsSize.setLabel(Model.of(getString("admin.group.form.maxRecordingsSize"))).setEnabled(false).setOutputMarkupId(true));
add(maxRooms.setLabel(Model.of(getString("admin.group.form.maxRooms"))).setEnabled(false).setOutputMarkupId(true));
add(recordingTtl.setLabel(Model.of(getString("admin.group.form.recordingTtl"))).setEnabled(false).setOutputMarkupId(true));
add(reminderDays.setLabel(Model.of(getString("admin.group.form.reminderDays"))).setEnabled(false).setOutputMarkupId(true));
}
示例13: onInitialize
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
@Override
protected void onInitialize() {
urlLabel = new Label("urlLabel", getString("calendar.url"));
userLabel = new Label("userLabel", getString("114"));
passLabel = new Label("passLabel", getString("110"));
add(title);
add(feedback.setOutputMarkupId(true));
add(url.setRequired(true).setOutputMarkupId(true));
add(username.setOutputMarkupPlaceholderTag(true));
add(urlLabel.setOutputMarkupId(true));
add(pass.setRequired(false).setOutputMarkupPlaceholderTag(true));
add(userLabel.setOutputMarkupPlaceholderTag(true));
add(passLabel.setOutputMarkupPlaceholderTag(true));
gcal = new AjaxCheckBox("gcal", Model.of(false)) {
private static final long serialVersionUID = 1L;
//Checkbox, which when in "true" state will be in
// the Google Calendar State, otherwise in the CalDAV state
@Override
protected void onUpdate(AjaxRequestTarget target) {
setGCalVisibility(getModelObject());
target.add(UserCalendarForm.this);
}
};
add(gcal);
super.onInitialize();
}
示例14: onBeforeRender
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
@Override
protected void onBeforeRender() {
this.parentPage = (ApplicationsPage) getPage();
createSearchCriteriaForm();
viewAllCheckBox = new AjaxCheckBox("allAppsCheckbox", new Model<Boolean>(WicketSession.get().getViewAll())) {
private static final long serialVersionUID = -336651607302799133L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
WicketSession.get().setViewAll(getModelObject());
getApplicationsFromDB();
//
initTable();
refreshContainer.replace(dataTable);
target.add(refreshContainer);
}
};
searchCriteriaForm.addOrReplace(viewAllCheckBox);
getApplicationsFromDB();
initTable();
refreshContainer.addOrReplace(dataTable) ;
super.onBeforeRender();
}
示例15: onBeforeRender
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; //导入依赖的package包/类
@Override
protected void onBeforeRender() {
createSearchCriteriaForm();
viewAllCheckBox = new AjaxCheckBox("allEnvironmentsCheckbox", new Model<Boolean>(WicketSession.get().getViewAll())) {
private static final long serialVersionUID = 6279581094195253824L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
WicketSession.get().setViewAll(getModelObject());
updateEnvDetailsPanel(target);
}
};
viewAllCheckBox.setLabel(WicketUtils.getStringResourceModel(this, "portal.environment.table.header.all"));
viewAllCheckBox.setVisible(release == null);
searchCriteriaForm.addOrReplace(viewAllCheckBox);
SimpleFormComponentLabel viewAllLabel = new SimpleFormComponentLabel("allEnvironmentsLabel", viewAllCheckBox);
viewAllLabel.setVisible(release == null);
searchCriteriaForm.addOrReplace(viewAllLabel);
getEnvironmentsFromDB();
initTable();
refreshContainer.addOrReplace(dataTable);
super.onBeforeRender();
}