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

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


                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


    public TreeActionLinkPanel(final String id, final long idRole, final IModel inputModel, final ModalWindow window,
            final PageReference pageRef) {

        super(id);

        fragment = new Fragment("menuPanel", idRole == 0
                ? "fakerootFrag"
                : "roleFrag", this);

        fragment.setOutputMarkupId(true);
View Full Code Here

                this.selectedNode = null;
                builder.selectedNodeId = null;
            }
        }

        fragment = new Fragment("roleSummaryPanel", builder.selectedNodeId == null ? "fakerootFrag"
                : (builder.selectedNodeId == 0 ? "rootPanel" : "roleViewPanel"), this);

        if (builder.selectedNodeId != null) {
            if (builder.selectedNodeId == 0) {
                actionLink = new TreeActionLinkPanel("actionLink", builder.selectedNodeId, new Model(),
View Full Code Here

                } else {
                    minus.setVisible(true);
                    minus.setEnabled(true);
                }

                final Fragment fragment;
                if (item.getIndex() == model.getObject().size() - 1) {
                    final AjaxLink plus = new IndicatingAjaxLink("add") {

                        private static final long serialVersionUID = -7978723352517770644L;

                        @Override
                        public void onClick(final AjaxRequestTarget target) {
                            //Add current component
                            model.getObject().add(null);
                            target.add(container);
                        }
                    };

                    fragment = new Fragment("panelPlus", "fragmentPlus", container);

                    fragment.add(plus);
                } else {
                    fragment = new Fragment("panelPlus", "emptyFragment", container);
                }
                item.add(fragment);
            }
        };
View Full Code Here

        this.window = window;
        this.userTO = userTO;
        this.mode = mode;
        this.resetPassword = resetPassword;

        fragment = new Fragment("userModalFrag", "userModalEditFrag", this);
        fragment.setOutputMarkupId(true);
        add(fragment);
    }
View Full Code Here

        editProfileModalWin.setInitialHeight(SELF_REG_WIN_HEIGHT);
        editProfileModalWin.setInitialWidth(SELF_REG_WIN_WIDTH);
        editProfileModalWin.setCookieName("self-reg-modal");
        add(editProfileModalWin);

        Fragment selfRegFrag;
        if (isSelfRegistrationAllowed()) {
            selfRegFrag = new Fragment("selfRegistration", "selfRegAllowed", this);

            final AjaxLink<Void> selfRegLink = new ClearIndicatingAjaxLink<Void>("link", getPageReference()) {

                private static final long serialVersionUID = -7978723352517770644L;

                @Override
                protected void onClickInternal(final AjaxRequestTarget target) {
                    editProfileModalWin.setPageCreator(new ModalWindow.PageCreator() {

                        private static final long serialVersionUID = -7834632442532690940L;

                        @Override
                        public Page createPage() {
                            return new UserRequestModalPage(Login.this.getPageReference(), editProfileModalWin,
                                    new UserTO(), UserModalPage.Mode.SELF);
                        }
                    });

                    editProfileModalWin.show(target);
                }
            };
            selfRegLink.add(new Label("linkTitle", getString("selfRegistration")));

            Panel panel = new LinkPanel("selfRegistration", new ResourceModel("selfRegistration"));
            panel.add(selfRegLink);
            selfRegFrag.add(panel);
        } else {
            selfRegFrag = new Fragment("selfRegistration", "selfRegNotAllowed", this);
        }
        add(selfRegFrag);
    }
View Full Code Here

            }
        };
        dgroup.add(details);

        if (names.getObject() == null || names.getObject().isEmpty()) {
            final Fragment fragment = new Fragment("schemas", "emptyFragment", form);
            form.add(fragment);

            selectedSchemas.clear();
        } else {
            final Fragment fragment = new Fragment("schemas", "sfragment", form);
            form.add(fragment);

            final CheckGroup sgroup = new CheckGroup("sCheckGroup", new PropertyModel(this, "selectedSchemas"));
            fragment.add(sgroup);

            final ListView<String> schemas = new ListView<String>("schemas", names) {

                private static final long serialVersionUID = 9101744072914090143L;

                @Override
                protected void populateItem(ListItem<String> item) {
                    item.add(new Check("scheck", item.getModel()));
                    item.add(new Label("sname", new ResourceModel(item.getModelObject(), item.getModelObject())));
                }
            };
            sgroup.add(schemas);
        }

        if (dsnames.getObject() == null || dsnames.getObject().isEmpty()) {
            final Fragment fragment = new Fragment("dschemas", "emptyFragment", form);
            form.add(fragment);

            selectedDerSchemas.clear();
        } else {
            final Fragment fragment = new Fragment("dschemas", "dsfragment", form);
            form.add(fragment);

            final CheckGroup dsgroup = new CheckGroup("dsCheckGroup", new PropertyModel(this, "selectedDerSchemas"));
            fragment.add(dsgroup);

            final ListView<String> derSchemas = new ListView<String>("derSchemas", dsnames) {

                private static final long serialVersionUID = 9101744072914090143L;

                @Override
                protected void populateItem(ListItem<String> item) {
                    item.add(new Check("dscheck", item.getModel()));
                    item.add(new Label("dsname", new ResourceModel(item.getModelObject(), item.getModelObject())));
                }
            };
            dsgroup.add(derSchemas);
        }

        if (vsnames.getObject() == null || vsnames.getObject().isEmpty()) {
            final Fragment fragment = new Fragment("vschemas", "emptyFragment", form);
            form.add(fragment);

            selectedVirSchemas.clear();
        } else {
            final Fragment fragment = new Fragment("vschemas", "vsfragment", form);
            form.add(fragment);

            final CheckGroup vsgroup = new CheckGroup("vsCheckGroup", new PropertyModel(this, "selectedVirSchemas"));
            fragment.add(vsgroup);

            final ListView<String> virSchemas = new ListView<String>("virSchemas", vsnames) {

                private static final long serialVersionUID = 9101744072914090143L;
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;
                    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

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.