Search in sources :

Example 51 with MidpointForm

use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.

the class PageReports method initLayout.

private void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<ReportType> table = new MainObjectListPanel<ReportType>(ID_TABLE, ReportType.class) {

        private static final long serialVersionUID = 1L;

        @Override
        protected UserProfileStorage.TableId getTableId() {
            return UserProfileStorage.TableId.PAGE_REPORTS;
        }

        @Override
        protected List<IColumn<SelectableBean<ReportType>, String>> createDefaultColumns() {
            return ColumnUtils.getDefaultObjectColumns();
        }

        @Override
        protected IColumn<SelectableBean<ReportType>, String> createCheckboxColumn() {
            return null;
        }

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            return PageReports.this.createInlineMenu();
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
}
Also used : UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)

Example 52 with MidpointForm

use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.

the class PageOrgs method initLayout.

protected void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<OrgType> table = new MainObjectListPanel<OrgType>(ID_TABLE, OrgType.class, getQueryOptions()) {

        @Override
        protected UserProfileStorage.TableId getTableId() {
            return UserProfileStorage.TableId.TABLE_ORGS;
        }

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            FocusListInlineMenuHelper<OrgType> listInlineMenuHelper = new FocusListInlineMenuHelper<OrgType>(OrgType.class, PageOrgs.this, this) {

                private static final long serialVersionUID = 1L;

                protected boolean isShowConfirmationDialog(ColumnMenuAction action) {
                    return PageOrgs.this.isShowConfirmationDialog(action);
                }

                protected IModel<String> getConfirmationMessageModel(ColumnMenuAction action, String actionName) {
                    return PageOrgs.this.getConfirmationMessageModel(action, actionName);
                }
            };
            return listInlineMenuHelper.createRowActions(getType());
        }

        @Override
        protected List<IColumn<SelectableBean<OrgType>, String>> createDefaultColumns() {
            return ColumnUtils.getDefaultOrgColumns(getPageBase());
        }

        @Override
        protected List<ItemPath> getFixedSearchItems() {
            List<ItemPath> fixedSearchItems = new ArrayList<>();
            fixedSearchItems.add(ObjectType.F_NAME);
            fixedSearchItems.add(AbstractRoleType.F_DISPLAY_NAME);
            fixedSearchItems.add(OrgType.F_PARENT_ORG_REF);
            return fixedSearchItems;
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
}
Also used : MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) ArrayList(java.util.ArrayList) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ColumnMenuAction(com.evolveum.midpoint.web.component.data.column.ColumnMenuAction) FocusListInlineMenuHelper(com.evolveum.midpoint.web.component.util.FocusListInlineMenuHelper) ItemPath(com.evolveum.midpoint.prism.path.ItemPath)

Example 53 with MidpointForm

use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.

the class PageTraceView method initLayout.

private void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    DropDownChoicePanel<GenericTraceVisualizationType> clockworkExecutionChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_CLOCKWORK_EXECUTION, createClockworkLevels(), new PropertyModel<>(model, TraceViewDto.F_CLOCKWORK_EXECUTION), this, false);
    clockworkExecutionChoice.setOutputMarkupId(true);
    mainForm.add(clockworkExecutionChoice);
    DropDownChoicePanel<GenericTraceVisualizationType> clockworkClickChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_CLOCKWORK_CLICK, createClockworkLevels(), new PropertyModel<>(model, TraceViewDto.F_CLOCKWORK_CLICK), this, false);
    clockworkClickChoice.setOutputMarkupId(true);
    mainForm.add(clockworkClickChoice);
    DropDownChoicePanel<GenericTraceVisualizationType> mappingEvaluationChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_MAPPING_EVALUATION, createMappingLevels(), new PropertyModel<>(model, TraceViewDto.F_MAPPING_EVALUATION), this, false);
    mappingEvaluationChoice.setOutputMarkupId(true);
    mainForm.add(mappingEvaluationChoice);
    DropDownChoicePanel<GenericTraceVisualizationType> focusLoadChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_FOCUS_LOAD, createStandardLevels(), new PropertyModel<>(model, TraceViewDto.F_FOCUS_LOAD), this, false);
    focusLoadChoice.setOutputMarkupId(true);
    mainForm.add(focusLoadChoice);
    DropDownChoicePanel<GenericTraceVisualizationType> projectionLoadChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_PROJECTION_LOAD, createStandardLevels(), new PropertyModel<>(model, TraceViewDto.F_PROJECTION_LOAD), this, false);
    projectionLoadChoice.setOutputMarkupId(true);
    mainForm.add(projectionLoadChoice);
    DropDownChoicePanel<GenericTraceVisualizationType> focusChangeChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_FOCUS_CHANGE, createStandardLevels(), new PropertyModel<>(model, TraceViewDto.F_FOCUS_CHANGE), this, false);
    focusChangeChoice.setOutputMarkupId(true);
    mainForm.add(focusChangeChoice);
    DropDownChoicePanel<GenericTraceVisualizationType> projectionChangeChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_PROJECTION_CHANGE, createStandardLevels(), new PropertyModel<>(model, TraceViewDto.F_PROJECTION_CHANGE), this, false);
    projectionChangeChoice.setOutputMarkupId(true);
    mainForm.add(projectionChangeChoice);
    DropDownChoicePanel<GenericTraceVisualizationType> otherChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_OTHERS, createOthersLevels(), new PropertyModel<>(model, TraceViewDto.F_OTHERS), this, false);
    otherChoice.setOutputMarkupId(true);
    mainForm.add(otherChoice);
    mainForm.add(new CheckBox(ID_SHOW_INVOCATION_ID, new PropertyModel<>(model, TraceViewDto.F_SHOW_INVOCATION_ID)));
    mainForm.add(new CheckBox(ID_SHOW_DURATION_BEFORE, new PropertyModel<>(model, TraceViewDto.F_SHOW_DURATION_BEFORE)));
    mainForm.add(new CheckBox(ID_SHOW_DURATION_AFTER, new PropertyModel<>(model, TraceViewDto.F_SHOW_DURATION_AFTER)));
    mainForm.add(new CheckBox(ID_SHOW_REPO_OP_COUNT, new PropertyModel<>(model, TraceViewDto.F_SHOW_REPO_OP_COUNT)));
    mainForm.add(new CheckBox(ID_SHOW_CONN_ID_OP_COUNT, new PropertyModel<>(model, TraceViewDto.F_SHOW_CONN_ID_OP_COUNT)));
    mainForm.add(new CheckBox(ID_SHOW_REPO_OP_TIME, new PropertyModel<>(model, TraceViewDto.F_SHOW_REPO_OP_TIME)));
    mainForm.add(new CheckBox(ID_SHOW_CONN_ID_OP_TIME, new PropertyModel<>(model, TraceViewDto.F_SHOW_CONN_ID_OP_TIME)));
    AjaxSubmitButton showButton = new AjaxSubmitButton(ID_SHOW, createStringResource("PageTraceView.button.show")) {

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getFeedbackPanel());
        }

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            visualize();
            target.add(PageTraceView.this);
        }
    };
    mainForm.add(showButton);
    Label resultLabel = new Label(ID_RESULT_LABEL, (IModel<String>) () -> {
        if (!model.getObject().isVisualized()) {
            return "";
        } else {
            return getString("PageTraceView.trace");
        }
    });
    mainForm.add(resultLabel);
    AceEditor resultText = new AceEditor(ID_RESULT_TEXT, new PropertyModel<>(model, TraceViewDto.F_VISUALIZED_TRACE));
    resultText.setReadonly(true);
    resultText.setResizeToMaxHeight(true);
    resultText.setMode(null);
    resultText.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return model.getObject().isVisualized();
        }
    });
    mainForm.add(resultText);
}
Also used : AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) PropertyModel(org.apache.wicket.model.PropertyModel) Label(org.apache.wicket.markup.html.basic.Label) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) AceEditor(com.evolveum.midpoint.web.component.AceEditor) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) CheckBox(org.apache.wicket.markup.html.form.CheckBox) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

Example 54 with MidpointForm

use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.

the class PageObjectTemplates method initLayout.

private void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<ObjectTemplateType> table = new MainObjectListPanel<ObjectTemplateType>(ID_TABLE, ObjectTemplateType.class) {

        @Override
        protected UserProfileStorage.TableId getTableId() {
            return UserProfileStorage.TableId.TABLE_OBJECT_TEMPLATES;
        }

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            List<InlineMenuItem> menu = new ArrayList<>();
            menu.add(createDeleteInlineMenu());
            return menu;
        }

        @Override
        protected List<IColumn<SelectableBean<ObjectTemplateType>, String>> createDefaultColumns() {
            return ColumnUtils.getDefaultObjectColumns();
        }

        @Override
        protected String getNothingSelectedMessage() {
            return getString("pageObjectTemplates.message.nothingSelected");
        }

        @Override
        protected String getConfirmMessageKeyForSingleObject() {
            return "pageObjectTemplates.message.confirmationMessageForMultipleObject";
        }

        @Override
        protected String getConfirmMessageKeyForMultiObject() {
            return "pageObjectTemplates.message.confirmationMessageForSingleObject";
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
}
Also used : UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) ObjectTemplateType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectTemplateType) ArrayList(java.util.ArrayList) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 55 with MidpointForm

use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.

the class AbstractShoppingCartTabPanel method initSearchPanel.

private void initSearchPanel(WebMarkupContainer shoppingCartContainer) {
    final Form searchForm = new MidpointForm(ID_SEARCH_FORM);
    searchForm.setOutputMarkupId(true);
    IModel<Search> searchModel = Model.of(getRoleCatalogStorage().getSearch() != null ? getRoleCatalogStorage().getSearch() : createSearch());
    SearchPanel search = new SearchPanel(ID_SEARCH, searchModel, false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void searchPerformed(AjaxRequestTarget target) {
            AbstractShoppingCartTabPanel.this.searchPerformed(target);
        }
    };
    getRoleCatalogStorage().setSearch(searchModel.getObject());
    searchForm.add(search);
    shoppingCartContainer.add(searchForm);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) SearchPanel(com.evolveum.midpoint.web.component.search.SearchPanel) Search(com.evolveum.midpoint.web.component.search.Search) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm)

Aggregations

MidpointForm (com.evolveum.midpoint.web.component.form.MidpointForm)75 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)41 Form (org.apache.wicket.markup.html.form.Form)39 AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)20 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)19 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)17 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)17 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)15 MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)14 ArrayList (java.util.ArrayList)14 Label (org.apache.wicket.markup.html.basic.Label)14 IModel (org.apache.wicket.model.IModel)14 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)11 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)9 ListItem (org.apache.wicket.markup.html.list.ListItem)8 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)7 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)7 List (java.util.List)7 OnChangeAjaxBehavior (org.apache.wicket.ajax.form.OnChangeAjaxBehavior)7 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)6