Package org.apache.wicket.markup.html.panel

Examples of org.apache.wicket.markup.html.panel.Fragment


        final WebMarkupContainer container = new WebMarkupContainer("container");
        container.setOutputMarkupId(true);
        add(container);

        final Fragment fragment = new Fragment("resultFrag", mode == UserModalPage.Mode.SELF
                ? "userRequestResultFrag"
                : "propagationResultFrag", this);
        fragment.setOutputMarkupId(true);
        container.add(fragment);

        if (mode == UserModalPage.Mode.ADMIN) {
            // add Syncope propagation status
            PropagationStatusTO syncope = new PropagationStatusTO();
            syncope.setResource("Syncope");
            syncope.setStatus(PropagationTaskExecStatus.SUCCESS);

            List<PropagationStatusTO> propagations = new ArrayList<PropagationStatusTO>();
            propagations.add(syncope);
            propagations.addAll(attributable.getPropagationStatusTOs());

            fragment.add(new Label("info",
                    ((attributable instanceof UserTO) && ((UserTO) attributable).getUsername() != null)
                    ? ((UserTO) attributable).getUsername()
                    : ((attributable instanceof RoleTO) && ((RoleTO) attributable).getName() != null)
                    ? ((RoleTO) attributable).getName()
                    : String.valueOf(attributable.getId())));

            final ListView<PropagationStatusTO> propRes = new ListView<PropagationStatusTO>("resources",
                    propagations) {

                private static final long serialVersionUID = -1020475259727720708L;

                @Override
                protected void populateItem(final ListItem<PropagationStatusTO> item) {
                    final PropagationStatusTO propTO = (PropagationStatusTO) item.getDefaultModelObject();

                    final ListView attributes = getConnObjectView(propTO);

                    final Fragment attrhead;
                    if (attributes.getModelObject() == null || attributes.getModelObject().isEmpty()) {
                        attrhead = new Fragment("attrhead", "emptyAttrHeadFrag", page);
                    } else {
                        attrhead = new Fragment("attrhead", "attrHeadFrag", page);
                    }

                    item.add(attrhead);
                    item.add(attributes);

                    attrhead.add(new Label("resource", propTO.getResource()));

                    attrhead.add(new Label("propagation", propTO.getStatus() == null
                            ? "UNDEFINED" : propTO.getStatus().toString()));

                    final Image image;
                    final String alt, title;
                    final ModalWindow failureWindow = new ModalWindow("failureWindow");
                    final AjaxLink<?> failureWindowLink = new AjaxLink<Void>("showFailureWindow") {

                        private static final long serialVersionUID = -7978723352517770644L;

                        @Override
                        public void onClick(AjaxRequestTarget target) {
                            failureWindow.show(target);
                        }
                    };

                    switch (propTO.getStatus()) {

                        case SUCCESS:
                        case SUBMITTED:
                        case CREATED:
                            image = new Image("icon", IMG_STATUSES + StatusUtils.Status.ACTIVE.toString()
                                    + Constants.PNG_EXT);
                            alt = "success icon";
                            title = "success";
                            failureWindow.setVisible(false);
                            failureWindowLink.setEnabled(false);
                            break;

                        default:
                            image = new Image("icon", IMG_STATUSES + StatusUtils.Status.SUSPENDED.toString()
                                    + Constants.PNG_EXT);
                            alt = "failure icon";
                            title = "failure";
                    }

                    image.add(new Behavior() {

                        private static final long serialVersionUID = 1469628524240283489L;

                        @Override
                        public void onComponentTag(final Component component, final ComponentTag tag) {
                            tag.put("alt", alt);
                            tag.put("title", title);
                        }
                    });
                    final FailureMessageModalPage executionFailureMessagePage;
                    if (propTO.getFailureReason() != null) {
                        executionFailureMessagePage = new FailureMessageModalPage(failureWindow.getContentId(), propTO.
                                getFailureReason());
                    } else {
                        executionFailureMessagePage = new FailureMessageModalPage(failureWindow.getContentId(),
                                StringUtils.EMPTY);
                    }

                    failureWindow.setPageCreator(new ModalWindow.PageCreator() {

                        private static final long serialVersionUID = -7834632442532690940L;

                        @Override
                        public Page createPage() {
                            return executionFailureMessagePage;
                        }
                    });
                    failureWindow.setCookieName("failureWindow");
                    failureWindow.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
                    //attrhead.add(image);
                    failureWindowLink.add(image);
                    attrhead.add(failureWindowLink);
                    attrhead.add(failureWindow);
                }
            };
            fragment.add(propRes);
        }
View Full Code Here


            @Override
            protected void populateItem(final ListItem item) {
                String name = item.getModelObject().toString();

                final Fragment beforeValue;
                final Fragment afterValue;
                if (ConnIdSpecialAttributeName.ENABLE.equals(name)) {
                    beforeValue = getStatusIcon("beforeValue", propTO.getResource(), before);
                    afterValue = getStatusIcon("afterValue", propTO.getResource(), after);
                } else {
                    beforeValue = getLabelValue("beforeValue", name, beforeAttrMap);
View Full Code Here

            public void onComponentTag(final Component component, final ComponentTag tag) {
                tag.put("title", value);
            }
        });

        final Fragment frag = new Fragment(id, "attrValueFrag", this);
        frag.add(label);

        return frag;
    }
View Full Code Here

                image = null;
                alt = null;
                title = null;
        }

        final Fragment frag;
        if (image == null) {
            frag = new Fragment(id, "emptyFrag", this);
        } else {
            image.add(new Behavior() {

                private static final long serialVersionUID = 1469628524240283489L;

                @Override
                public void onComponentTag(final Component component, final ComponentTag tag) {
                    tag.put("alt", alt);
                    tag.put("title", title);
                    tag.put("width", "12px");
                    tag.put("height", "12px");
                }
            });

            frag = new Fragment(id, "remoteStatusFrag", this);
            frag.add(image);
        }

        return frag;
    }
View Full Code Here

        this.bulkActionForm = null;
        this.group = null;
        dataTable = new AjaxFallbackDefaultDataTable<T, S>("dataTable", columns, dataProvider, rowsPerPage);

        Fragment fragment = new Fragment("tablePanel", "bulkNotAvailable", this);
        fragment.add(dataTable);

        add(fragment);
    }
View Full Code Here

                    target.add(page.getFeedbackPanel());
                }
            }
        });

        Fragment fragment = new Fragment("tablePanel", "bulkAvailable", this);
        add(fragment);

        bulkActionForm = new Form("groupForm");
        fragment.add(bulkActionForm);

        group = new CheckGroup<T>("checkgroup", new ArrayList<T>());
        bulkActionForm.add(group);

        columns.add(0, new CheckGroupColumn<T, S>(group));
        dataTable = new AjaxFallbackDefaultDataTable<T, S>("dataTable", columns, dataProvider, rowsPerPage);
        group.add(dataTable);

        fragment.add(new ClearIndicatingAjaxButton("bulkActionLink", bulkActionForm, pageRef) {

            private static final long serialVersionUID = 382302811235019988L;

            @Override
            protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
View Full Code Here

        parentSelectWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
        parentSelectWin.setCookieName("create-parentSelect-modal");
        this.add(parentSelectWin);

        if (templateMode) {
            parentFragment = new Fragment("parent", "parentFragment", this);

            parentModel = new ParentModel(roleTO);
            final AjaxTextFieldPanel parent = new AjaxTextFieldPanel("parent", "parent", parentModel);
            parent.setReadOnly(true);
            parent.setOutputMarkupId(true);
            parentFragment.add(parent);
            final IndicatingAjaxLink parentSelect = new IndicatingAjaxLink("parentSelect") {

                private static final long serialVersionUID = -7978723352517770644L;

                @Override
                public void onClick(final AjaxRequestTarget target) {
                    parentSelectWin.setPageCreator(new ModalWindow.PageCreator() {

                        private static final long serialVersionUID = -7834632442532690940L;

                        @Override
                        public Page createPage() {
                            return new RoleSelectModalPage(getPage().getPageReference(), parentSelectWin,
                                    ParentSelectPayload.class);
                        }
                    });
                    parentSelectWin.show(target);
                }
            };
            parentFragment.add(parentSelect);
            final IndicatingAjaxLink parentReset = new IndicatingAjaxLink("parentReset") {

                private static final long serialVersionUID = -7978723352517770644L;

                @Override
                public void onClick(final AjaxRequestTarget target) {
                    parentModel.setObject(null);
                    target.add(parent);
                }
            };
            parentFragment.add(parentReset);
        } else {
            parentFragment = new Fragment("parent", "emptyFragment", this);
        }
        parentFragment.setOutputMarkupId(true);
        this.add(parentFragment);

        final AjaxTextFieldPanel name =
View Full Code Here

        final WebMarkupContainer container = new WebMarkupContainer("container");
        container.setOutputMarkupId(true);
        add(container);

        final Fragment fragment = new Fragment("resultFrag", mode == UserModalPage.Mode.SELF
                ? "userRequestResultFrag"
                : "propagationResultFrag", this);
        fragment.setOutputMarkupId(true);
        container.add(fragment);

        if (mode == UserModalPage.Mode.ADMIN) {
            // add Syncope propagation status
            PropagationStatusTO syncope = new PropagationStatusTO();
            syncope.setResource("Syncope");
            syncope.setStatus(PropagationTaskExecStatus.SUCCESS);

            List<PropagationStatusTO> propagations = new ArrayList<PropagationStatusTO>();
            propagations.add(syncope);
            propagations.addAll(attributable.getPropagationStatusTOs());

            fragment.add(new Label("info",
                    ((attributable instanceof UserTO) && ((UserTO) attributable).getUsername() != null)
                    ? ((UserTO) attributable).getUsername()
                    : ((attributable instanceof RoleTO) && ((RoleTO) attributable).getName() != null)
                    ? ((RoleTO) attributable).getName()
                    : String.valueOf(attributable.getId())));

            final ListView<PropagationStatusTO> propRes = new ListView<PropagationStatusTO>("resources",
                    propagations) {

                private static final long serialVersionUID = -1020475259727720708L;

                @Override
                protected void populateItem(final ListItem<PropagationStatusTO> item) {
                    final PropagationStatusTO propTO = (PropagationStatusTO) item.getDefaultModelObject();

                    final ListView attributes = getConnObjectView(propTO);

                    final Fragment attrhead;
                    if (attributes.getModelObject() == null || attributes.getModelObject().isEmpty()) {
                        attrhead = new Fragment("attrhead", "emptyAttrHeadFrag", page);
                    } else {
                        attrhead = new Fragment("attrhead", "attrHeadFrag", page);
                    }

                    item.add(attrhead);
                    item.add(attributes);

                    attrhead.add(new Label("resource", propTO.getResource()));

                    attrhead.add(new Label("propagation", propTO.getStatus() == null
                            ? "UNDEFINED" : propTO.getStatus().toString()));

                    final Image image;
                    final String alt, title;
                    switch (propTO.getStatus()) {

                        case SUCCESS:
                        case SUBMITTED:
                        case CREATED:
                            image = new Image("icon", IMG_STATUSES + StatusUtils.Status.ACTIVE.toString()
                                    + Constants.PNG_EXT);
                            alt = "success icon";
                            title = "success";
                            break;

                        default:
                            image = new Image("icon", IMG_STATUSES + StatusUtils.Status.SUSPENDED.toString()
                                    + Constants.PNG_EXT);
                            alt = "failure icon";
                            title = "failure";
                    }

                    image.add(new Behavior() {

                        private static final long serialVersionUID = 1469628524240283489L;

                        @Override
                        public void onComponentTag(final Component component, final ComponentTag tag) {
                            tag.put("alt", alt);
                            tag.put("title", title);
                        }
                    });

                    attrhead.add(image);
                }
            };
            fragment.add(propRes);
        }
View Full Code Here

            @Override
            protected void populateItem(final ListItem item) {
                String name = item.getModelObject().toString();

                final Fragment beforeValue;
                final Fragment afterValue;
                if (ConnIdSpecialAttributeName.ENABLE.equals(name)) {
                    beforeValue = getStatusIcon("beforeValue", propTO.getResource(), before);
                    afterValue = getStatusIcon("afterValue", propTO.getResource(), after);
                } else {
                    beforeValue = getLabelValue("beforeValue", name, beforeAttrMap);
View Full Code Here

            public void onComponentTag(final Component component, final ComponentTag tag) {
                tag.put("title", value);
            }
        });

        final Fragment frag = new Fragment(id, "attrValueFrag", this);
        frag.add(label);

        return frag;
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.panel.Fragment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.