Search in sources :

Example 66 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class SchemaListPanel method initDetailsPanel.

private void initDetailsPanel(WebMarkupContainer parent) {
    WebMarkupContainer detailsContainer = new WebMarkupContainer(ID_DETAILS_PANEL);
    detailsContainer.setOutputMarkupId(true);
    detailsContainer.setOutputMarkupPlaceholderTag(true);
    parent.add(detailsContainer);
    Label displayName = new Label(ID_DETAILS_DISPLAY_NAME, new PropertyModel<String>(detailsModel, ObjectClassDetailsDto.F_DISPLAY_NAME));
    detailsContainer.add(displayName);
    Label description = new Label(ID_DETAILS_DESCRIPTION, new PropertyModel<String>(detailsModel, ObjectClassDetailsDto.F_DESCRIPTION));
    detailsContainer.add(description);
    Label kind = new Label(ID_DETAILS_KIND, new PropertyModel<String>(detailsModel, ObjectClassDetailsDto.F_KIND));
    detailsContainer.add(kind);
    Label intent = new Label(ID_DETAILS_INTENT, new PropertyModel<String>(detailsModel, ObjectClassDetailsDto.F_INTENT));
    detailsContainer.add(intent);
    Label nativeObjectClass = new Label(ID_DETAILS_NATIVE_OBJECT_CLASS, new PropertyModel<String>(detailsModel, ObjectClassDetailsDto.F_NATIVE_OBJECT_CLASS));
    detailsContainer.add(nativeObjectClass);
    CheckBox isDefault = new CheckBox(ID_DETAILS_DEFAULT, new PropertyModel<Boolean>(detailsModel, ObjectClassDetailsDto.F_IS_DEFAULT));
    isDefault.setEnabled(false);
    detailsContainer.add(isDefault);
    Label kindTooltip = new Label(ID_T_KIND);
    kindTooltip.add(new InfoTooltipBehavior());
    detailsContainer.add(kindTooltip);
    Label intentTooltip = new Label(ID_T_INTENT);
    intentTooltip.add(new InfoTooltipBehavior());
    detailsContainer.add(intentTooltip);
    Label nativeObjClassTooltip = new Label(ID_T_NATIVE_OBJECT_CLASS);
    nativeObjClassTooltip.add(new InfoTooltipBehavior());
    detailsContainer.add(nativeObjClassTooltip);
    Label defaultTooltip = new Label(ID_T_DEFAULT);
    defaultTooltip.add(new InfoTooltipBehavior());
    detailsContainer.add(defaultTooltip);
}
Also used : InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) CheckBox(org.apache.wicket.markup.html.form.CheckBox) Label(org.apache.wicket.markup.html.basic.Label) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 67 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class SchemaListPanel method initLayout.

protected void initLayout() {
    final ObjectClassDataProvider dataProvider = new ObjectClassDataProvider(allClasses);
    TextField objectClass = new TextField<>(ID_OBJECT_CLASS, new Model<>());
    objectClass.setOutputMarkupId(true);
    objectClass.add(new AjaxFormComponentUpdatingBehavior("keyup") {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            updateSearchPerformed(target, dataProvider);
        }
    });
    add(objectClass);
    AjaxButton clearSearch = new AjaxButton(ID_CLEAR_SEARCH) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            clearSearchPerformed(target, dataProvider);
        }
    };
    add(clearSearch);
    WebMarkupContainer tableBody = new WebMarkupContainer(ID_TABLE_BODY);
    tableBody.setOutputMarkupId(true);
    add(tableBody);
    DataView<ObjectClassDto> objectClassDataView = new DataView<ObjectClassDto>(ID_OBJECT_CLASS_LIST, dataProvider, UserProfileStorage.DEFAULT_PAGING_SIZE) {

        @Override
        protected void populateItem(final Item<ObjectClassDto> item) {
            AjaxLink link = new AjaxLink(ID_CLASS_LINK) {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    objectClassClickPerformed(target, item.getModelObject());
                }
            };
            item.add(link);
            Label label = new Label(ID_LABEL, new PropertyModel<>(item.getModel(), ObjectClassDto.F_DISPLAY_NAME));
            link.add(label);
            item.add(AttributeModifier.replace("class", new AbstractReadOnlyModel<Object>() {

                @Override
                public Object getObject() {
                    return item.getModelObject().isSelected() ? "success" : null;
                }
            }));
        }
    };
    tableBody.add(objectClassDataView);
    NavigatorPanel objectClassNavigator = new NavigatorPanel(ID_NAVIGATOR, objectClassDataView, true);
    objectClassNavigator.setOutputMarkupId(true);
    objectClassNavigator.setOutputMarkupPlaceholderTag(true);
    add(objectClassNavigator);
    WebMarkupContainer objectClassInfoContainer = new WebMarkupContainer(ID_OBJECT_CLASS_INFO_CONTAINER);
    objectClassInfoContainer.setOutputMarkupId(true);
    add(objectClassInfoContainer);
    WebMarkupContainer objectClassInfoColumn = new WebMarkupContainer(ID_OBJECT_CLASS_INFO_COLUMN);
    objectClassInfoColumn.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return getSelectedObjectClass() != null;
        }
    });
    objectClassInfoContainer.add(objectClassInfoColumn);
    initDetailsPanel(objectClassInfoColumn);
    ListDataProvider<AttributeDto> attributeProvider = new ListDataProvider<>(this, attributeModel, true);
    attributeProvider.setSort(AttributeDto.F_DISPLAY_ORDER, SortOrder.ASCENDING);
    BoxedTablePanel<AttributeDto> attributeTable = new BoxedTablePanel<>(ID_ATTRIBUTE_TABLE, attributeProvider, initColumns());
    attributeTable.setOutputMarkupId(true);
    attributeTable.setItemsPerPage(UserProfileStorage.DEFAULT_PAGING_SIZE);
    attributeTable.setShowPaging(true);
    objectClassInfoColumn.add(attributeTable);
}
Also used : AjaxFormComponentUpdatingBehavior(org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) ListDataProvider(com.evolveum.midpoint.web.component.util.ListDataProvider) Label(org.apache.wicket.markup.html.basic.Label) ObjectClassDataProvider(com.evolveum.midpoint.web.component.wizard.resource.dto.ObjectClassDataProvider) ObjectClassDto(com.evolveum.midpoint.web.component.wizard.resource.dto.ObjectClassDto) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AttributeDto(com.evolveum.midpoint.web.component.wizard.resource.dto.AttributeDto) DataView(org.apache.wicket.markup.repeater.data.DataView) Item(org.apache.wicket.markup.repeater.Item) NavigatorPanel(com.evolveum.midpoint.web.component.data.paging.NavigatorPanel) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) TextField(org.apache.wicket.markup.html.form.TextField) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel)

Example 68 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class WizardIssuesPanel method initLayout.

private void initLayout() {
    WebMarkupContainer panel = new WebMarkupContainer(ID_PANEL);
    panel.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return getModelObject().hasIssues();
        }
    });
    panel.add(AttributeAppender.append("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            WizardIssuesDto issuesDto = WizardIssuesPanel.this.getModelObject();
            WizardIssuesDto.Severity severity = issuesDto.getSeverity();
            return severity != null ? "box-" + severity.getColorStyle() : null;
        }
    }));
    add(panel);
    Label title = new Label(ID_TITLE, new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            WizardIssuesDto issuesDto = WizardIssuesPanel.this.getModelObject();
            WizardIssuesDto.Severity severity = issuesDto.getSeverity();
            if (severity == null) {
                return "";
            } else if (severity == WizardIssuesDto.Severity.INFO) {
                return getString("Wizard.Notes");
            } else {
                return getString("Wizard.Issues");
            }
        }
    });
    panel.add(title);
    WebMarkupContainer table = new WebMarkupContainer(ID_TABLE);
    panel.add(table);
    ListView<WizardIssuesDto.Issue> issues = new ListView<WizardIssuesDto.Issue>(ID_ROW, new PropertyModel<List<WizardIssuesDto.Issue>>(getModel(), WizardIssuesDto.F_ISSUES)) {

        @Override
        protected void populateItem(ListItem<WizardIssuesDto.Issue> item) {
            WizardIssuesDto.Issue issue = item.getModelObject();
            Label severityLabel = new Label(ID_SEVERITY, "");
            severityLabel.add(AttributeAppender.replace("class", issue.getSeverityClass()));
            item.add(severityLabel);
            item.add(new Label(ID_TEXT, issue.getText()));
        }
    };
    table.add(issues);
}
Also used : AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) Label(org.apache.wicket.markup.html.basic.Label) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) WizardIssuesDto(com.evolveum.midpoint.web.component.wizard.resource.dto.WizardIssuesDto) ListView(org.apache.wicket.markup.html.list.ListView) List(java.util.List) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) ListItem(org.apache.wicket.markup.html.list.ListItem)

Example 69 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class SchemaHandlingStep method credentialsEditPerformed.

private void credentialsEditPerformed(AjaxRequestTarget target) {
    WebMarkupContainer newContainer = new ResourceCredentialsEditor(ID_THIRD_ROW_CONTAINER, new PropertyModel<ResourceCredentialsDefinitionType>(schemaHandlingDtoModel, getExpression(ResourceObjectTypeDefinitionType.F_CREDENTIALS)), parentPage);
    getThirdRowContainer().replaceWith(newContainer);
    resetSelections(target);
    target.add(getThirdRowContainer(), get(ID_OBJECT_TYPE_EDITOR), parentPage.getFeedbackPanel());
}
Also used : WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 70 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class SchemaHandlingStep method activationEditPerformed.

private void activationEditPerformed(AjaxRequestTarget target) {
    WebMarkupContainer newContainer = new ResourceActivationEditor(ID_THIRD_ROW_CONTAINER, new PropertyModel<ResourceActivationDefinitionType>(schemaHandlingDtoModel, getExpression(ResourceObjectTypeDefinitionType.F_ACTIVATION)), parentPage.getReadOnlyModel());
    getThirdRowContainer().replaceWith(newContainer);
    resetSelections(target);
    target.add(getThirdRowContainer(), get(ID_OBJECT_TYPE_EDITOR), parentPage.getFeedbackPanel());
}
Also used : WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)227 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)106 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)101 Label (org.apache.wicket.markup.html.basic.Label)98 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)59 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)44 List (java.util.List)43 ListItem (org.apache.wicket.markup.html.list.ListItem)43 ArrayList (java.util.ArrayList)41 ListView (org.apache.wicket.markup.html.list.ListView)39 PropertyModel (org.apache.wicket.model.PropertyModel)34 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)26 TextField (org.apache.wicket.markup.html.form.TextField)25 IModel (org.apache.wicket.model.IModel)22 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)21 AttributeModifier (org.apache.wicket.AttributeModifier)21 Form (org.apache.wicket.markup.html.form.Form)21 Model (org.apache.wicket.model.Model)18 AjaxFormComponentUpdatingBehavior (org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior)17 InfoTooltipBehavior (com.evolveum.midpoint.web.util.InfoTooltipBehavior)16