Package org.apache.wicket.markup.html.list

Examples of org.apache.wicket.markup.html.list.ListView


                {
                    modificationAllowed = false;                   
                }                   
            }
            refreshList();
            ListView commentListView = new ListView("comments",
                    new PropertyModel(this, "associations"))
            {

                public void populateItem(final ListItem listItem)
                {
View Full Code Here


                    "basePanel");
            ajaxPanel.setOutputMarkupId(true);
            ajaxPanel.add(new Label("constraintLabel",new ResourceModel("security.constraint.title")));
            ajaxPanel.add(new Label("constraintTypeLabel",new ResourceModel("security.type.title")));
           
            ajaxPanel.add(new ListView("metaData", new PropertyModel(this,
                    "document.securityConstraints"))
            {

                public void populateItem(final ListItem listItem)
                {
View Full Code Here

            final WebMarkupContainer ajaxPanel = new WebMarkupContainer(
                    "basePanel");
            ajaxPanel.setOutputMarkupId(true);
            ajaxPanel.add(new Label("textLabel",new ResourceModel("menu.text")));
            ajaxPanel.add(new Label("titleLabel",new ResourceModel("menu.title")));
            ajaxPanel.add(new ListView("separator", new PropertyModel(this,
                    "menuOptions"))
            {

                public void populateItem(final ListItem listItem)
                {
View Full Code Here

            ajaxPanel.add(new Label("nameLabel", new ResourceModel(
                    "metedataTab.name")));
            ajaxPanel.add(new Label("languageLabel", new ResourceModel(
                    "metedataTab.language")));

            final ListView metaDataListView = new ListView("metaData",
                    new PropertyModel(this, "document.metaData"))
            {

                private static final long serialVersionUID = 1L;

                public void populateItem(final ListItem listItem)
                {
                    final JetspeedDocumentMetaData metaData = (JetspeedDocumentMetaData) listItem
                            .getModelObject();
                    listItem.add(new Label("name", metaData.getName()));
                    listItem.add(new Label("language", metaData.getLanguage()));
                    listItem.add(new Label("value", metaData.getValue()));
                    AjaxLink editLink = new AjaxLink("edit", new Model("edit"))
                    {

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            metaDataModalWindow.setContent(new MetaDataPanel(
                                    metaDataModalWindow.getContentId(),
                                    metaData, ajaxPanel));
                            metaDataModalWindow.show(target);
                        }
                    };
                    editLink.add(new Label("editLabel", new ResourceModel(
                            "common.edit")));
                    listItem.add(editLink);

                    AjaxLink deleteLink = new AjaxLink("delete", new Model(
                            "delete"))
                    {

                        private static final long serialVersionUID = 1L;

                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                            metaDataAction(REMOVE_ACTION, metaData, null);
                            target.addComponent(ajaxPanel);
                        }
                    };

                    deleteLink.add(new Label("deleteLabel", new ResourceModel(
                            "common.delete")));
                    deleteLink.add(new JavascriptEventConfirmation("onclick",
                            new ResourceModel("action.delete.confirm")));
                    listItem.add(deleteLink);
                }
            };
            metaDataListView.setOutputMarkupId(true);
            ajaxPanel.setOutputMarkupId(true);
            ajaxPanel.add(metaDataListView);
            Form metaForm = new Form("metaForm");
            add(metaForm);
            add(new AjaxButton("new",new ResourceModel("common.new"),metaForm)
View Full Code Here

            add(metaDataModalWindow = new ModalWindow("modalwindow"));
            final WebMarkupContainer ajaxPanel = new WebMarkupContainer(
                    "basePanel");
            ajaxPanel.setOutputMarkupId(true);
            ajaxPanel.add(new Label("nameLabel",new ResourceModel("common.name")));
            ajaxPanel.add(new ListView("menuData", new PropertyModel(this,
                    "menuOptions"))
            {

                public void populateItem(final ListItem listItem)
                {
View Full Code Here

            final WebMarkupContainer ajaxPanel = new WebMarkupContainer(
                    "basePanel");
            ajaxPanel.setOutputMarkupId(true);
            ajaxPanel.add(new Label("nameLabel",new ResourceModel("common.name")));
            ajaxPanel.add(new Label("nestedLabel",new ResourceModel("menu.nest.label")));
            ajaxPanel.add(new ListView("menuData", new PropertyModel(this,
                    "menuOptions"))
            {

                public void populateItem(final ListItem listItem)
                {
View Full Code Here

            final ModalWindow metaDataModalWindow;
            add(metaDataModalWindow = new ModalWindow("modalwindow"));
            final WebMarkupContainer ajaxPanel = new WebMarkupContainer(
                    "basePanel");
            ajaxPanel.setOutputMarkupId(true);
            ajaxPanel.add(new ListView("menuData", new PropertyModel(this,
                    "menuOptions"))
            {

                public void populateItem(final ListItem listItem)
                {
View Full Code Here

                setResponsePage(new ItemSearchFormPage(itemSearch));
            }
        }.setVisible(!hideLinks));
       
        if (item.getRelatedItems() != null) {
            add(new ListView("relatedItems", new ArrayList(item.getRelatedItems())) {
                /* (non-Javadoc)
                 * @see org.apache.wicket.markup.html.list.ListView#populateItem(org.apache.wicket.markup.html.list.ListItem)
                 */
                protected void populateItem(ListItem listItem) {
                    final ItemItem itemItem = (ItemItem) listItem.getModelObject();
                    String message = null;
                   
                    if (itemItem.getType() == DUPLICATE_OF) {
                        message = localize("item_view.duplicateOf");
                    } else if (itemItem.getType() == DEPENDS_ON) {
                        message = localize("item_view.dependsOn");
                    } else if (itemItem.getType() == RELATED) {
                        message = localize("item_view.relatedTo");
                    }
                   
                    final String refId = itemItem.getRelatedItem().getRefId();
                    if (hideLinks) {
                        message = message + " " + refId;
                    }
                   
                    listItem.add(new Label("message", message));
                    Link link = new Link("link") {
                        public void onClick() {
                            setResponsePage(ItemViewPage.class, new PageParameters("0=" + refId));
                        }
                    };
                   
                    link.add(new Label("refId", refId));
                    link.setVisible(!hideLinks);
                    listItem.add(link);
                    listItem.add(new Link("remove") {
                        public void onClick() {
                            setResponsePage(new ItemRelateRemovePage(item.getId(), itemItem));
                        }
                    }.setVisible(!hideLinks));
                }
            });
        } else {
            add(new WebMarkupContainer("relatedItems").setVisible(false));
        }
       
        if (item.getRelatingItems() != null) {
            add(new ListView("relatingItems", new ArrayList(item.getRelatingItems())) {
                /* (non-Javadoc)
                 * @see org.apache.wicket.markup.html.list.ListView#populateItem(org.apache.wicket.markup.html.list.ListItem)
                 */
                protected void populateItem(ListItem listItem) {
                    final ItemItem itemItem = (ItemItem) listItem.getModelObject();
                   
                    /*
                     * This looks very similar to related items block above
                     * but the display strings could be different and in
                     * future handling of the inverse of the bidirectional
                     * link could be different as well.
                     */
                    String message = null;
                    if (itemItem.getType() == DUPLICATE_OF) {
                        message = localize("item_view.duplicateOfThis");
                    } else if (itemItem.getType() == DEPENDS_ON) {
                        message = localize("item_view.dependsOnThis");
                    } else if (itemItem.getType() == RELATED) {
                        message = localize("item_view.relatedToThis");
                    }
                   
                    final String refId = itemItem.getItem().getRefId();
                    if (hideLinks) {
                        message = refId + " " + message;
                    }
                   
                    listItem.add(new Label("message", message));
                    Link link = new Link("link") {
                        public void onClick() {
                            setResponsePage(ItemViewPage.class, new PageParameters("0=" + refId));
                        }
                    };
                   
                    link.add(new Label("refId", refId));
                    link.setVisible(!hideLinks);
                    listItem.add(link);
                    listItem.add(new Link("remove") {
                        public void onClick() {
                            setResponsePage(new ItemRelateRemovePage(item.getId(), itemItem));
                        }
                    }.setVisible(!hideLinks));
                }
            });
        } else {
            add(new WebMarkupContainer("relatingItems").setVisible(false));
        }
       
        add(new Label("status", new PropertyModel(item, "statusValue")));
        add(new Label("loggedBy", new PropertyModel(item, "loggedBy.name")));
        add(new Label("assignedTo", new PropertyModel(item, "assignedTo.name")));
        add(new Label("summary", new PropertyModel(item, "summary")));
        add(new Label("detail", ItemUtils.fixWhiteSpace(item.getDetail())).setEscapeModelStrings(false));
       
        final SimpleAttributeModifier sam = new SimpleAttributeModifier("class", "alt");
        final Map<Field.Name, Field> fields = item.getSpace().getMetadata().getFields();
        add(new ListView("fields", item.getSpace().getMetadata().getFieldOrder()) {
            /* (non-Javadoc)
             * @see org.apache.wicket.markup.html.list.ListView#populateItem(org.apache.wicket.markup.html.list.ListItem)
             */
            protected void populateItem(ListItem listItem) {
                if (listItem.getIndex() % 2 == 0) {
                    listItem.add(sam);
                }
               
                Field.Name fieldName = (Field.Name) listItem.getModelObject();
                Field field = fields.get(fieldName);
                listItem.add(new Label("label", field.getLabel()));
                listItem.add(new Label("value", item.getCustomValue(fieldName)));
            }
        });
       
        final List<Field> editable = item.getSpace().getMetadata().getEditableFields();
       
        add(new ListView("labels", editable) {
            /* (non-Javadoc)
             * @see org.apache.wicket.markup.html.list.ListView#populateItem(org.apache.wicket.markup.html.list.ListItem)
             */
            protected void populateItem(ListItem listItem) {
                Field field = (Field) listItem.getModelObject();
                listItem.add(new Label("label", field.getLabel()));
            }
        });
       
        if (item.getHistory() != null) {
            List<History> history = new ArrayList(item.getHistory());
            add(new ListView("history", history) {
                /* (non-Javadoc)
                 * @see org.apache.wicket.markup.html.list.ListView#populateItem(org.apache.wicket.markup.html.list.ListItem)
                 */
                protected void populateItem(ListItem listItem) {
                    if (listItem.getIndex() % 2 != 0) {
                        listItem.add(sam);
                    }
                   
                    final History h = (History) listItem.getModelObject();
                    listItem.add(new Label("loggedBy", new PropertyModel(h, "loggedBy.name")));
                    listItem.add(new Label("status", new PropertyModel(h, "statusValue")));
                    listItem.add(new Label("assignedTo", new PropertyModel(h, "assignedTo.name")));
                   
                    WebMarkupContainer comment = new WebMarkupContainer("comment");
                    comment.add(new AttachmentLinkPanel("attachment", h.getAttachment()));
                    comment.add(new Label("comment", ItemUtils.fixWhiteSpace(h.getComment())).setEscapeModelStrings(false));
                    listItem.add(comment);
                   
                    listItem.add(new Label("timeStamp", DateUtils.formatTimeStamp(h.getTimeStamp())));
                    listItem.add(new ListView("fields", editable) {
                        /* (non-Javadoc)
                         * @see org.apache.wicket.markup.html.list.ListView#populateItem(org.apache.wicket.markup.html.list.ListItem)
                         */
                        protected void populateItem(ListItem listItem) {
                            Field field = (Field) listItem.getModelObject();
View Full Code Here

            for (Map.Entry<String, Integer> entry : commitsPerCommitter.entrySet()) {
                dataset.addValue(entry.getValue(), "Commits", entry.getKey());
            }            
            List<String> users = new ArrayList(commitsPerCommitter.keySet());
            final SimpleAttributeModifier sam = new SimpleAttributeModifier("class", "alt");
            hide.add(new ListView("users", users) {
                protected void populateItem(ListItem listItem) {
                    if(listItem.getIndex() % 2 == 1) {
                        listItem.add(sam);
                    }                     
                    String user = (String) listItem.getModelObject();
View Full Code Here

   
    public RoleAllocatePanel(String id) {
        super(id);                      
        CheckGroup checkGroup = new CheckGroup("checkGroup", new PropertyModel(this, "selected"));
        add(checkGroup);
        checkGroup.add(new ListView("roleKeys", new PropertyModel(this, "choices")) {           
            protected void populateItem(ListItem listItem) {
                String roleKey = (String) listItem.getModelObject();
                listItem.add(new Check("checkBox", listItem.getModel()));
                listItem.add(new Label("roleKey", roleKey));
            }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.list.ListView

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.