Search in sources :

Example 1 with SpecialSearchItem

use of com.evolveum.midpoint.web.component.search.SpecialSearchItem in project midpoint by Evolveum.

the class RoleCatalogTabPanel method createScopeItem.

private SearchItem createScopeItem(Search search) {
    return new SpecialSearchItem(search) {

        @Override
        public ObjectFilter createFilter(PageBase pageBase, VariablesMap variables) {
            return null;
        }

        @Override
        public SearchSpecialItemPanel createSpecialSearchPanel(String id) {
            return new SearchSpecialItemPanel(id, new PropertyModel(getRoleCatalogStorage(), RoleCatalogStorage.F_ORG_SEARCH_SCOPE)) {

                @Override
                protected WebMarkupContainer initSearchItemField(String id) {
                    DropDownChoicePanel inputPanel = new DropDownChoicePanel(id, getModelValue(), Model.of(Arrays.asList(SearchBoxScopeType.values())), new EnumChoiceRenderer(), false);
                    inputPanel.getBaseFormComponent().add(WebComponentUtil.getSubmitOnEnterKeyDownBehavior("searchSimple"));
                    inputPanel.getBaseFormComponent().add(AttributeAppender.append("style", "width: 88px; max-width: 400px !important;"));
                    inputPanel.setOutputMarkupId(true);
                    return inputPanel;
                }

                @Override
                protected IModel<String> createLabelModel() {
                    return getPageBase().createStringResource("abstractRoleMemberPanel.searchScope");
                }

                @Override
                protected IModel<String> createHelpModel() {
                    return getPageBase().createStringResource("abstractRoleMemberPanel.searchScope.tooltip");
                }
            };
        }
    };
}
Also used : SpecialSearchItem(com.evolveum.midpoint.web.component.search.SpecialSearchItem) DropDownChoicePanel(com.evolveum.midpoint.web.component.input.DropDownChoicePanel) EnumChoiceRenderer(org.apache.wicket.markup.html.form.EnumChoiceRenderer) PropertyModel(org.apache.wicket.model.PropertyModel) VariablesMap(com.evolveum.midpoint.schema.expression.VariablesMap) PageBase(com.evolveum.midpoint.gui.api.page.PageBase) SearchSpecialItemPanel(com.evolveum.midpoint.web.component.search.SearchSpecialItemPanel)

Aggregations

PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 VariablesMap (com.evolveum.midpoint.schema.expression.VariablesMap)1 DropDownChoicePanel (com.evolveum.midpoint.web.component.input.DropDownChoicePanel)1 SearchSpecialItemPanel (com.evolveum.midpoint.web.component.search.SearchSpecialItemPanel)1 SpecialSearchItem (com.evolveum.midpoint.web.component.search.SpecialSearchItem)1 EnumChoiceRenderer (org.apache.wicket.markup.html.form.EnumChoiceRenderer)1 PropertyModel (org.apache.wicket.model.PropertyModel)1