當前位置: 首頁>>代碼示例>>Java>>正文


Java DropDownChoice.add方法代碼示例

本文整理匯總了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);
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:21,代碼來源:RepositoriesTabPanel.java

示例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);
}
 
開發者ID:LogicalOverflow,項目名稱:MasterStats,代碼行數:31,代碼來源:BasePage.java

示例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);

}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:27,代碼來源:AssignmentCatalogPanel.java

示例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);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:21,代碼來源:LoggingConfigPanel.java

示例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);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:14,代碼來源:LoggingConfigPanel.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:24,代碼來源:RoleMemberPanel.java

示例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;
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:23,代碼來源:AllFacetValuesPanel.java

示例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;
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:20,代碼來源:SearchResultsHeaderPanel.java

示例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);
}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:26,代碼來源:SelecaoMenuItem.java

示例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);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:21,代碼來源:UploadPanel.java

示例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);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:26,代碼來源:DerivationTypeDropDownChoicePanel.java

示例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);
	}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:26,代碼來源:FilterExpressionPanel.java

示例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);
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:23,代碼來源:WicketAddonsImpl.java

示例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);
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:23,代碼來源:RepositoriesTabPanel.java

示例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);
}
 
開發者ID:Evolveum,項目名稱:gizmo-v3,代碼行數:21,代碼來源:PageDashboard.java


注:本文中的org.apache.wicket.markup.html.form.DropDownChoice.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。