本文整理匯總了Java中org.apache.wicket.markup.html.form.DropDownChoice.add方法的典型用法代碼示例。如果您正苦於以下問題:Java DropDownChoice.add方法的具體用法?Java DropDownChoice.add怎麽用?Java DropDownChoice.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.html.form.DropDownChoice
的用法示例。
在下文中一共展示了DropDownChoice.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addExcludesPatternFields
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void addExcludesPatternFields(StringResourceModel helpMessage,
final List<CommonPathPattern> includesExcludesSuggestions) {
TextArea excludesTa = new TextArea("excludesPattern");
excludesTa.setEnabled(isSystemAdmin());
excludesTa.setOutputMarkupId(true);
add(excludesTa);
add(new HelpBubble("excludesHelp", helpMessage));
//Excludes suggestions
Model<CommonPathPattern> exclude = new Model<>();
DropDownChoice<CommonPathPattern> excludesSuggest = new DropDownChoice<>(
"excludesSuggest", exclude, includesExcludesSuggestions);
if (!includesExcludesSuggestions.isEmpty()) {
excludesSuggest.setDefaultModelObject(includesExcludesSuggestions.get(0));
}
excludesSuggest.add(new UpdatePatternsBehavior(exclude, excludesTa));
excludesSuggest.setEnabled(isSystemAdmin());
add(excludesSuggest);
}
示例2: loadNavbar
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
/**
* generates the navbar and mark the active page
*
* @param activePage page to be marked active (null for no active page)
*/
private void loadNavbar(final PageType activePage) {
// add an entry for each page type
add(new ListView<PageType>("navbar_left_elements", Arrays.asList(PageType.values())) {
@Override
protected void populateItem(final ListItem<PageType> item) {
final PageType type = item.getModelObject();
// create a link for the page type
BookmarkablePageLink<String> link = new BookmarkablePageLink<>("navbar_left_element_link", type.getPageClass());
link.add(new Label("navbar_left_element_text", type.getLinkText()));
// if the type is same as active page, mark it as active
if (type.equals(activePage)) link.add(new AttributeAppender("class", "active", " "));
item.add(link);
}
});
// create the summoner search region drop down menu
// get all valid entries
List<String> endpoints = Arrays.asList(RiotEndpoint.PLAYABLE_ENDPOINTS)
.stream().map(RiotEndpoint::name).collect(Collectors.toList());
// add the options to the drop down menu
DropDownChoice<String> dropDownChoice = new DropDownChoice<>("navbar_form_regions_select",
new PropertyModel<>(this, "selectedRegion"), endpoints, new StringChoiceRenderer());
dropDownChoice.add(new AttributeModifier("name", "region"));
add(dropDownChoice);
}
示例3: initViewSelector
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void initViewSelector(WebMarkupContainer headerPanel){
DropDownChoice<AssignmentViewType> viewSelect = new DropDownChoice(ID_VIEW_TYPE, viewModel,
Model.ofList(viewTypeList != null && viewTypeList.size() > 0 ?
viewTypeList : createAssignableTypesList()),
new EnumChoiceRenderer<AssignmentViewType>(this));
viewSelect.add(new OnChangeAjaxBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
if (AssignmentViewType.USER_TYPE.equals(viewSelect.getModelObject())){
initUserViewSelectionPopup(createStringResource("AssignmentCatalogPanel.selectAssignmentsUserOwner"),
target);
} else {
searchModel.reset();
AssignmentCatalogPanel.this.addOrReplaceSearchPanel(getHeaderPanel());
AssignmentCatalogPanel.this.addOrReplaceLayout(target, getCatalogItemsPanelContainer(), getPageBase());
target.add(getCatalogItemsPanelContainer());
target.add(getHeaderPanel());
}
}
});
viewSelect.setOutputMarkupId(true);
headerPanel.add(viewSelect);
}
示例4: initRoot
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void initRoot() {
DropDownChoice<LoggingLevelType> rootLevel = new DropDownChoice<>(ID_ROOT_LEVEL,
new PropertyModel<LoggingLevelType>(getModel(), LoggingDto.F_ROOT_LEVEL),
WebComponentUtil.createReadonlyModelFromEnum(LoggingLevelType.class));
rootLevel.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
add(rootLevel);
DropDownChoice<String> rootAppender = new DropDownChoice<>(ID_ROOT_APPENDER,
new PropertyModel<String>(getModel(), LoggingDto.F_ROOT_APPENDER), createAppendersListModel());
rootAppender.setNullValid(true);
rootAppender.add(new OnChangeAjaxBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
rootAppenderChangePerformed(target);
}
});
rootAppender.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
add(rootAppender);
}
示例5: initAudit
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void initAudit(){
CheckBox auditLog = WebComponentUtil.createAjaxCheckBox("auditLog", new PropertyModel<Boolean>(getModel(), "auditLog"));
add(auditLog);
CheckBox auditDetails = WebComponentUtil.createAjaxCheckBox("auditDetails", new PropertyModel<Boolean>(getModel(), "auditDetails"));
add(auditDetails);
DropDownChoice<String> auditAppender = new DropDownChoice<>("auditAppender", new PropertyModel<String>(
getModel(), "auditAppender"), createAppendersListModel());
auditAppender.setNullValid(true);
auditAppender.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
add(auditAppender);
}
示例6: createDropDown
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private <V> DropDownChoice<V> createDropDown(String id, IModel<V> defaultModel, final List<V> values,
IChoiceRenderer<V> renderer) {
DropDownChoice<V> listSelect = new DropDownChoice<V>(id, defaultModel,
new AbstractReadOnlyModel<List<V>>() {
private static final long serialVersionUID = 1L;
@Override
public List<V> getObject() {
return values;
}
}, renderer);
listSelect.add(new OnChangeAjaxBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
refreshTable(target);
}
});
return listSelect;
}
示例7: createOptionsForm
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private Form createOptionsForm(String id) {
final Form options = new AjaxIndicatingForm(id);
final DropDownChoice<SortParam<FieldValuesOrder>> sortSelect
= new FieldValueOrderSelector("sort", new PropertyModel<SortParam<FieldValuesOrder>>(valuesProvider, "sort"));
sortSelect.add(new UpdateOptionsFormBehavior(options));
options.add(sortSelect);
final TextField filterField = new TextField<>("filter", new PropertyModel(filterModel, "name"));
filterField.add(new AjaxFormComponentUpdatingBehavior("keyup") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(valuesContainer);
}
});
options.add(filterField);
addOccurenceOptions(options);
return options;
}
示例8: createResultPageSizeForm
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private Form createResultPageSizeForm(String id, final IPageableItems resultsView) {
final Form resultPageSizeForm = new Form(id);
final DropDownChoice<Long> pageSizeDropDown
= new DropDownChoice<Long>("resultPageSize",
// bind to items per page property of pageable
new PropertyModel<Long>(resultsView, "itemsPerPage"),
ITEMS_PER_PAGE_OPTIONS);
pageSizeDropDown.add(new AjaxFormComponentUpdatingBehavior("change") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
onChange(target);
}
});
resultPageSizeForm.add(pageSizeDropDown);
return resultPageSizeForm;
}
示例9: onInitialize
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
Form form = new Form<String>("form");
Model<ModuleEntity> model = new Model<>(SingularSession.get().getCategoriaSelecionada());
final DropDownChoice<ModuleEntity> select = new DropDownChoice<>("select", model, categorias,
new ChoiceRenderer<>("name", "cod"));
form.add(select);
select.add(new BSSelectInitBehaviour());
select.add(new FormComponentAjaxUpdateBehavior("change", (target, component) -> {
final ModuleEntity categoriaSelecionada = (ModuleEntity) component.getDefaultModelObject();
SingularSession.get().setCategoriaSelecionada(categoriaSelecionada);
getPage().getPageParameters().set(MODULE_PARAM_NAME, categoriaSelecionada.getCod());
final BoxConfigurationData boxConfigurationMetadataDTO = getDefaultMenuSelection(categoriaSelecionada);
if (boxConfigurationMetadataDTO != null) {
getPage().getPageParameters().set(MENU_PARAM_NAME, boxConfigurationMetadataDTO.getLabel());
} else {
getPage().getPageParameters().remove(MENU_PARAM_NAME);
}
setResponsePage(getPage().getClass(), getPage().getPageParameters());
}));
add(form);
}
示例10: addEventTypeDropDown
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void addEventTypeDropDown() {
final List<String> eventTypes = EapEventType.getAllTypeNames();
if (!eventTypes.isEmpty()) {
eventTypeName = eventTypes.get(0);
}
final DropDownChoice<String> eventTypeDropDownChoice = new DropDownChoice<String>("eventTypeDropDownChoice", new Model<String>(), eventTypes);
eventTypeDropDownChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
eventTypeName = eventTypeDropDownChoice.getModelObject();
}
});
if (!eventTypes.isEmpty()) {
eventTypeDropDownChoice.setModelObject(eventTypes.get(0));
}
eventTypeDropDownChoice.setOutputMarkupId(true);
layoutForm.add(eventTypeDropDownChoice);
}
示例11: DerivationTypeDropDownChoicePanel
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
public DerivationTypeDropDownChoicePanel(final String id, final int entryId, final SimulationTreeTableProvider<Object> simulationTreeTableProvider) {
super(id);
final Form<Void> layoutForm = new Form<Void>("layoutForm");
final DropDownChoice<DerivationType> derivationTypeDropDownChoice = new DropDownChoice<DerivationType>("derivationTypeDropDownChoice", Model.of(simulationTreeTableProvider.getDerivationTypeForEntry(entryId)), this.derivationTypes);
derivationTypeDropDownChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
simulationTreeTableProvider.setDerivationTypeForEntry(derivationTypeDropDownChoice.getModelObject(), entryId);
if (DerivationTypeDropDownChoicePanel.this.treeTable != null) {
target.add(DerivationTypeDropDownChoicePanel.this.treeTable);
} else {
target.add(DerivationTypeDropDownChoicePanel.this.getPage());
}
}
});
derivationTypeDropDownChoice.setEnabled(true);
layoutForm.add(derivationTypeDropDownChoice);
this.add(layoutForm);
}
示例12: buildFilterExpressionOperatorDropDownChoice
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void buildFilterExpressionOperatorDropDownChoice() {
this.filterExpressionOperator = (FilterExpressionOperatorEnum) this.element.getValue();
final DropDownChoice<FilterExpressionOperatorEnum> filterExpressionOperatorDropDownChoice = new DropDownChoice<FilterExpressionOperatorEnum>("filterExpressionOperatorDropDownChoice", new PropertyModel<FilterExpressionOperatorEnum>(this, "filterExpressionOperator"), Arrays.asList(FilterExpressionOperatorEnum.values()), new ChoiceRenderer<FilterExpressionOperatorEnum>() {
private static final long serialVersionUID = 1L;
@Override
public Object getDisplayValue(final FilterExpressionOperatorEnum element) {
return element.getValue();
}
});
filterExpressionOperatorDropDownChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = -5452061293278720695L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
FilterExpressionPanel.this.element.setValue(FilterExpressionPanel.this.filterExpressionOperator);
FilterExpressionPanel.this.table.getSelectedElements().remove(FilterExpressionPanel.this.element);
target.add(FilterExpressionPanel.this.table);
}
});
filterExpressionOperatorDropDownChoice.setOutputMarkupId(true);
this.layoutForm.add(filterExpressionOperatorDropDownChoice);
}
示例13: createAndAddVcsConfigSection
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
@Override
public void createAndAddVcsConfigSection(Form form, RemoteRepoDescriptor repoDescriptor, boolean isCreate) {
WebMarkupContainer vcsSection = new WebMarkupContainer("vcsSupportSection");
vcsSection.add(new TitledBorderBehavior("fieldset-border", "Vcs"));
vcsSection.add(new DisabledAddonBehavior(AddonType.VCS));
vcsSection.add(new StyledCheckbox("enableVcsSupport").setTitle("Enable Vcs Support").setEnabled(false));
vcsSection.add(new DisabledAddonHelpBubble("enableVcsSupport.help", VCS));
DropDownChoice providerDropdown = new DropDownChoice("provider", Model.of(), Collections.emptyList());
providerDropdown.setEnabled(false);
providerDropdown.add(new DisabledAddonBehavior(AddonType.VCS));
vcsSection.add(providerDropdown);
vcsSection.add(new DisabledAddonHelpBubble("provider.help", VCS));
WebMarkupContainer downloadUrlField = new WebMarkupContainer("downloadUrlField");
downloadUrlField.setVisible(false);
downloadUrlField.add(new TextField("downloadUrl").setEnabled(false).setVisible(false));
downloadUrlField.add(new DisabledAddonHelpBubble("downloadUrl.help", VCS).setVisible(false));
vcsSection.add(downloadUrlField);
form.add(vcsSection);
}
示例14: addIncludesPatternFields
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void addIncludesPatternFields(StringResourceModel helpMessage,
final List<CommonPathPattern> includesExcludesSuggestions) {
TextArea includesTa = new TextArea("includesPattern");
includesTa.setEnabled(isSystemAdmin());
includesTa.setOutputMarkupId(true);
add(includesTa);
add(new HelpBubble("includesHelp", helpMessage));
Model<CommonPathPattern> include = new Model<>();
DropDownChoice<CommonPathPattern> includesSuggest = new DropDownChoice<>(
"includesSuggest", include, includesExcludesSuggestions);
if (!includesExcludesSuggestions.isEmpty()) {
includesSuggest.setDefaultModelObject(includesExcludesSuggestions.get(0));
}
includesSuggest.add(new UpdatePatternsBehavior(include, includesTa));
if (parent.isCreate()) {
includesSuggest.setDefaultModelObject(CommonPathPattern.ANY);
}
includesSuggest.setEnabled(isSystemAdmin());
add(includesSuggest);
}
示例15: initRealizatorInput
import org.apache.wicket.markup.html.form.DropDownChoice; //導入方法依賴的package包/類
private void initRealizatorInput(WebMarkupContainer realizator) {
DropDownChoice realizatorCombo = new DropDownChoice<User>(ID_REALIZATOR_COMBO,
new PropertyModel<User>(filter, WorkFilterDto.F_REALIZATOR),
GizmoUtils.createUsersModel(this), GizmoUtils.createUserChoiceRenderer()) {
@Override
protected String getNullValidKey() {
return "PageDashboard.everyone";
}
};
realizatorCombo.add(createMultipleVisibilityBehaviour(false));
realizatorCombo.setNullValid(true);
realizator.add(realizatorCombo);
ListMultipleChoice realizatorMulti = new ListMultipleChoice<User>(ID_REALIZATOR_MULTI,
new PropertyModel<List<User>>(filter, WorkFilterDto.F_REALIZATORS), GizmoUtils.createUsersModel(this),
GizmoUtils.createUserChoiceRenderer());
realizatorMulti.add(createMultipleVisibilityBehaviour(true));
realizator.add(realizatorMulti);
}