Search in sources :

Example 46 with MidpointForm

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

the class InternalsDebugUtilPanel method onInitialize.

protected void onInitialize() {
    super.onInitialize();
    setOutputMarkupId(true);
    Form form = new MidpointForm(ID_FORM);
    form.setOutputMarkupId(true);
    add(form);
    CheckFormGroup detailed = new CheckFormGroup(ID_DETAILED_DEBUG_DUMP, new PropertyModel<>(getModel(), InternalsConfigDto.F_DETAILED_DEBUG_DUMP), createStringResource("PageInternals.detailedDebugDump"), LABEL_SIZE, INPUT_SIZE);
    form.add(detailed);
    AjaxSubmitButton update = new AjaxSubmitButton(ID_SAVE_DEBUG_UTIL, createStringResource("PageBase.button.update")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            updateDebugPerformed(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getPageBase().getFeedbackPanel());
        }
    };
    form.add(update);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) CheckFormGroup(com.evolveum.midpoint.web.component.form.CheckFormGroup)

Example 47 with MidpointForm

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

the class InternalsConfigPanel method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    setOutputMarkupId(true);
    Form form = new MidpointForm<>(ID_FORM);
    form.setOutputMarkupId(true);
    add(form);
    form.add(createCheckbox(ID_CONSISTENCY_CHECKS, InternalsConfigDto.F_CONSISTENCY_CHECKS));
    form.add(createCheckbox(ID_ENCRYPTION_CHECKS, InternalsConfigDto.F_ENCRYPTION_CHECKS));
    form.add(createCheckbox(ID_READ_ENCRYPTION_CHECKS, InternalsConfigDto.F_READ_ENCRYPTION_CHECKS));
    form.add(createCheckbox(ID_MODEL_PROFILING, InternalsConfigDto.F_MODEL_PROFILING));
    form.add(createCheckbox(ID_TOLERATE_UNDECLARED_PREFIXES, InternalsConfigDto.F_TOLERATE_UNDECLARED_PREFIXES));
    AjaxSubmitButton update = new AjaxSubmitButton(ID_UPDATE_INTERNALS_CONFIG, createStringResource("PageBase.button.update")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            updateInternalConfig(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getPageBase().getFeedbackPanel());
        }
    };
    form.add(update);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm)

Example 48 with MidpointForm

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

the class ProgressPanel method initLayout.

private void initLayout() {
    MidpointForm progressForm = new MidpointForm<>(ID_PROGRESS_FORM, true);
    add(progressForm);
    WebMarkupContainer contentsPanel = new WebMarkupContainer(ID_CONTENTS_PANEL);
    contentsPanel.setOutputMarkupId(true);
    progressForm.add(contentsPanel);
    ListView<ProgressReportActivityDto> statusItemsListView = new ListView<>(ID_ACTIVITIES, (IModel<List<ProgressReportActivityDto>>) () -> {
        ProgressReporter reporter = reporterModel.getProcessData();
        ProgressDto progressDto = reporter.getProgress();
        return progressDto.getProgressReportActivities();
    }) {

        @Override
        protected void populateItem(ListItem<ProgressReportActivityDto> item) {
            populateStatusItem(item);
        }
    };
    contentsPanel.add(statusItemsListView);
    StatisticsDtoModel statisticsModel = new StatisticsDtoModel();
    statisticsPanel = new StatisticsPanel(ID_STATISTICS, statisticsModel);
    contentsPanel.add(statisticsPanel);
    ListView<String> logItemsListView = new ListView<>(ID_LOG_ITEMS, (IModel<List<String>>) () -> {
        ProgressReporter reporter = reporterModel.getProcessData();
        ProgressDto progressDto = reporter.getProgress();
        return progressDto.getLogItems();
    }) {

        @Override
        protected void populateItem(ListItem item) {
            item.add(new Label(ID_LOG_ITEM, item.getModel()));
        }
    };
    contentsPanel.add(logItemsListView);
    Label executionTime = new Label(ID_EXECUTION_TIME, (IModel<String>) () -> {
        ProgressReporter reporter = reporterModel.getProcessData();
        if (reporter.getOperationDurationTime() > 0) {
            return getString("ProgressPanel.ExecutionTimeWhenFinished", reporter.getOperationDurationTime());
        } else if (reporter.getOperationStartTime() > 0) {
            return getString("ProgressPanel.ExecutionTimeWhenRunning", (System.currentTimeMillis() - reporter.getOperationStartTime()) / 1000);
        } else {
            return null;
        }
    });
    contentsPanel.add(executionTime);
    initButtons(progressForm);
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) ListView(org.apache.wicket.markup.html.list.ListView) List(java.util.List) ListItem(org.apache.wicket.markup.html.list.ListItem)

Example 49 with MidpointForm

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

the class PageFocusPreviewChanges method initLayout.

private void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    mainForm.setMultiPart(true);
    add(mainForm);
    List<ITab> tabs = createTabs();
    TabbedPanel<ITab> previewChangesTabbedPanel = WebComponentUtil.createTabPanel(ID_TABBED_PANEL, this, tabs, null);
    previewChangesTabbedPanel.setOutputMarkupId(true);
    mainForm.add(previewChangesTabbedPanel);
    initButtons(mainForm);
}
Also used : Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab)

Example 50 with MidpointForm

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

the class PageDebugList method initLayout.

private void initLayout() {
    Form<?> main = new MidpointForm<>(ID_MAIN_FORM);
    add(main);
    RepositoryObjectDataProvider<? extends ObjectType> provider = new RepositoryObjectDataProvider<>(this, (IModel) searchModel) {

        private static final long serialVersionUID = 1L;

        @Override
        protected PageStorage getPageStorage() {
            return getSessionStorage().getConfiguration();
        }
    };
    create(provider);
    PageDebugDownloadBehaviour ajaxDownloadBehavior = new PageDebugDownloadBehaviour();
    main.add(ajaxDownloadBehavior);
}
Also used : RepositoryObjectDataProvider(com.evolveum.midpoint.web.component.data.RepositoryObjectDataProvider) PageDebugDownloadBehaviour(com.evolveum.midpoint.web.page.admin.configuration.component.PageDebugDownloadBehaviour) 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