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

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


   * @param expectedList
   *            expected list in the model of {@link ListView}
   */
  public void assertListView(String path, List expectedList)
  {
    ListView listView = (ListView)getComponentFromLastRenderedPage(path);
    WicketTesterHelper.assertEquals(expectedList, listView.getList());
  }
View Full Code Here


        Object wrappedCatalog = Context.javaToJS(getCatalog(), scope);
        ScriptableObject.putProperty(scope, "catalog", wrappedCatalog);
        Context.exit();

        final WebMarkupContainer container = new WebMarkupContainer("results-wrapper");
        final ListView resultsDisplay =
            new ListView("results", new PropertyModel(this, "results")) {
                protected void populateItem(ListItem item) {
                    item.add(new Label("javascript", new PropertyModel(item.getModel(), "input")));
                    item.add(new Label("result", new PropertyModel(item.getModel(), "response")));
                }
            };
View Full Code Here

            add(placeHolder);
        }
       
        // when hacking this service listing code please refer to
        // http://jira.codehaus.org/browse/GEOS-2114
        ListView view = new ListView("services", getServices()) {
            @Override
            protected void populateItem(ListItem item) {
                ServiceInfo service = (ServiceInfo) item.getModelObject();
                final String serviceId = service.getId();
                item.add( new Label("service", service.getId().toUpperCase()) );
                item.add( new ListView( "versions", service.getVersions()) {
                    @Override
                    protected void populateItem(ListItem item) {
                        Version version = (Version) item.getModelObject();
                        ExternalLink link = new ExternalLink("link", "../ows?service=" + serviceId
                                + "&version=" + version.toString() + "&request=GetCapabilities");
View Full Code Here

public class DemoPage extends GeoServerBasePage{
    @SuppressWarnings("serial")
    public DemoPage(){
        List<DemoLinkInfo> links = getGeoServerApplication().getBeansOfType(DemoLinkInfo.class);
        add(new ListView("demoList", links){
            public void populateItem(ListItem item){
                final DemoLinkInfo info = (DemoLinkInfo)item.getModelObject();
                item.add(new BookmarkablePageLink("theLink", info.getComponentClass())
                .add(new Label("theTitle", new StringResourceModel(info.getTitleKey(), (Component)null, null))));
                item.add(new Label("theDescription", new StringResourceModel(info.getDescriptionKey(), (Component)null, null)));
View Full Code Here

                cnt.add(selectOneCheckbox(item));
                cnt.setVisible(selectable);
                item.add(cnt);

                // create one component per viewable property
                item.add(new ListView("itemProperties", dataProvider.getVisibleProperties()) {

                    @Override
                    protected void populateItem(ListItem item) {
                        Property<T> property = (Property<T>) item.getModelObject();

                        Component component = getComponentForProperty("component", itemModel,
                                property);
                       
                        if(component == null) {
                            // show a plain label if the the subclass did not create any component
                            component = new Label("component", property.getModel(itemModel));
                        } else if (!"component".equals(component.getId())) {
                            // add some checks for the id, the error message
                            // that wicket returns in case of mismatch is not
                            // that helpful
                            throw new IllegalArgumentException("getComponentForProperty asked "
                                    + "to build a component " + "with id = 'component' "
                                    + "for property '" + property.getName() + "', but got '"
                                    + component.getId() + "' instead");
                        }
                        item.add(component);
                    }

                });
            }

        };
        listContainer.add(dataView);

        // add select all checkbox
        WebMarkupContainer cnt = new WebMarkupContainer("selectAllContainer");
        cnt.add(selectAll = selectAllCheckbox());
        cnt.setVisible(selectable);
        listContainer.add(cnt);
       
        // add the sorting links
        listContainer.add(new ListView("sortableLinks", dataProvider.getVisibleProperties()) {

            @Override
            protected void populateItem(ListItem item) {
                Property<T> property = (Property<T>) item.getModelObject();
View Full Code Here

        links.remove(null);

        List<Category> categories = new ArrayList(links.keySet());
        Collections.sort(categories);

        add(new ListView("category", categories){
            public void populateItem(ListItem item){
                Category category = (Category)item.getModelObject();
                item.add(new Label("category.header", new StringResourceModel(category.getNameKey(), (Component) null, null)));
                item.add(new ListView("category.links", links.get(category)){
                    public void populateItem(ListItem item){
                        MenuPageInfo info = (MenuPageInfo)item.getModelObject();
                        BookmarkablePageLink link = new BookmarkablePageLink("link", info.getComponentClass());
                        link.add(new AttributeModifier("title", true, new StringResourceModel(info.getDescriptionKey(), (Component) null, null)));
                        link.add(new Label("link.label", new StringResourceModel(info.getTitleKey(), (Component) null, null)));
                        Image image;
                        if(info.getIcon() != null) {
                            image = new Image("link.icon", new ResourceReference(info.getComponentClass(), info.getIcon()));
                        } else {
                            image = new Image("link.icon", new ResourceReference(GeoServerBasePage.class, "img/icons/silk/wrench.png"));
                        }
                        image.add(new AttributeModifier("alt", true, new ParamResourceModel(info.getTitleKey(), null)));
                        link.add(image);
                        item.add(link);
                    }
                });
            }
        });

        add(new ListView("standalone", standalone){
                    public void populateItem(ListItem item){
                        MenuPageInfo info = (MenuPageInfo)item.getModelObject();
                        BookmarkablePageLink link = new BookmarkablePageLink("link", info.getComponentClass());
                        link.add(new AttributeModifier("title", true, new StringResourceModel(info.getDescriptionKey(), (Component) null, null)));
                        link.add(new Label("link.label", new StringResourceModel(info.getTitleKey(), (Component) null, null)));
View Full Code Here

    public FileBreadcrumbs(String id, IModel rootFile, IModel currentFile) {
        super(id, currentFile);

        this.rootFile = rootFile;
        add(new ListView("path", new BreadcrumbModel(rootFile, currentFile)) {

            @Override
            protected void populateItem(ListItem item) {
                File file = (File) item.getModelObject();
                boolean last = item.getIndex() == getList().size() - 1;
View Full Code Here

    private abstract class ListLayerEditTabPanel extends LayerEditTabPanel {

        public ListLayerEditTabPanel(String id, IModel model) {
            super(id, model);
           
            ListView list = createList("theList");
           
            // do this or die on validation (the form element contents will
            // reset, the edit will be lost)
            list.setReuseItems(true);
            add(list);
        }
View Full Code Here

        }

        protected ListView createList(String id) {
            List dataPanels = filterResourcePanels(((GeoServerApplication) getGeoServerApplication())
                    .getBeansOfType(ResourceConfigurationPanelInfo.class));
            ListView dataPanelList = new ListView(id, dataPanels) {
                @Override
                protected void populateItem(ListItem item) {
                    ResourceConfigurationPanelInfo panelInfo = (ResourceConfigurationPanelInfo) item
                            .getModelObject();
                    try {
View Full Code Here

        @Override
        public ListView createList(String id) {
            List pubPanels = filterLayerPanels(((GeoServerApplication) getGeoServerApplication())
                    .getBeansOfType(LayerConfigurationPanelInfo.class));
            ListView pubPanelList = new ListView(id, pubPanels) {
                @Override
                protected void populateItem(ListItem item) {
                    LayerConfigurationPanelInfo panelInfo = (LayerConfigurationPanelInfo) item
                    .getModelObject();
                    try {
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.