當前位置: 首頁>>代碼示例>>Java>>正文


Java ListView類代碼示例

本文整理匯總了Java中org.apache.wicket.markup.html.list.ListView的典型用法代碼示例。如果您正苦於以下問題:Java ListView類的具體用法?Java ListView怎麽用?Java ListView使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ListView類屬於org.apache.wicket.markup.html.list包,在下文中一共展示了ListView類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: DocumentationIndexPage

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
public DocumentationIndexPage() {
	Harvester harvester = new Harvester();
	
	@SuppressWarnings({ "unchecked", "rawtypes" })
	ListView listview = new ListView("listview", harvester.getWorkspaces()) {
	    /**
		 * 
		 */
		private static final long serialVersionUID = 2974513833506276491L;

		protected void populateItem(ListItem item) {
	    	WorkspaceDoc wi = (WorkspaceDoc) item.getModelObject();
			BookmarkablePageLink link = new BookmarkablePageLink("link", WorkspacePage.class);
			link.setParameter("workspaceName", wi.getName());
			link.add(new Label("workspaceName", wi.getName()));
	        item.add(link);
	    }
	};
	add(listview);

	ExtensionInfo info = new ExtensionInfo();
	add(new Label("documentorVersion", info.getVersion()));
	add(new Label("documentorGitVersion", info.getGitVersion()));
	add(new Label("readme", info.getReadme()));
}
 
開發者ID:geops,項目名稱:geoserver-documentor,代碼行數:26,代碼來源:DocumentationIndexPage.java

示例2: onInitialize

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
@Override
protected void onInitialize() {
	super.onInitialize();
	
	add(new ListView<PropertyContext<Serializable>>("properties", propertyContexts) {

		@Override
		protected void populateItem(ListItem<PropertyContext<Serializable>> item) {
			PropertyContext<Serializable> propertyContext = item.getModelObject();
			Method propertyGetter = propertyContext.getPropertyGetter();
			Label nameLabel = new Label("name", EditableUtils.getName(propertyGetter));
			item.add(nameLabel);
			OmitName omitName = propertyGetter.getAnnotation(OmitName.class);

			if (omitName != null && omitName.value() != OmitName.Place.EDITOR) {
				nameLabel.setVisible(false);
				item.add(AttributeAppender.append("class", "name-omitted"));
			}

			Serializable bean = (Serializable) ReflectionBeanViewer.this.getDefaultModelObject();
			Serializable propertyValue = (Serializable) propertyContext.getPropertyValue(bean);
			item.add(propertyContext.renderForView("value", Model.of(propertyValue)));
		}

	});
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:27,代碼來源:ReflectionBeanViewer.java

示例3: LocationViewPage

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
public LocationViewPage(PageParameters params) {
    Logger log = getLogger();
    try {
        AAAWebUtil.checkAAA(this, OPERATION_NAME);
        this.current = LocationUtil.getLocation(params);
        this.model = new LocationNodeModel(this.current);
        this.model.renew();
        log.debug("current location: " + current.getName());
        log.debug("param=" + params);
        ListView<BreadCrumbLink> breadcrumbList = LocationUtil.createBreadCrumbList(current);
        add(breadcrumbList);
        createHeader();
        populateLocation();
        populateNode();
        createAddLocationLink();
        createEditLocationLink();
        createDeleteLocationLink();
        createAddNodeLink();
        log.debug("end");
    } catch (Exception e) {
        throw ExceptionUtils.throwAsRuntime(e);
    }
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:24,代碼來源:LocationViewPage.java

示例4: populateNode

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
private void populateNode() throws ExternalServiceException, IOException, RemoteException {
    ListView<NodeDto> list = new ListView<NodeDto>("nodeList", this.model) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<NodeDto> item) {
            NodeDto node = item.getModelObject();
            BookmarkablePageLink<Void> link = NodePageUtil.createNodeLink("nodeLink", node);
            item.add(link);
        }
    };
    add(list);
    WebMarkupContainer container = new WebMarkupContainer("nodeBlock");
    add(container);
    container.setVisible(this.model.isVisible());
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:17,代碼來源:LocationViewPage.java

示例5: loadNavbar

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
/**
 * generates the navbar and mark the active page
 *
 * @param activePage page to be marked active (null for no active page)
 */
private void loadNavbar(final PageType activePage) {
    // add an entry for each page type
    add(new ListView<PageType>("navbar_left_elements", Arrays.asList(PageType.values())) {
        @Override
        protected void populateItem(final ListItem<PageType> item) {
            final PageType type = item.getModelObject();
            // create a link for the page type
            BookmarkablePageLink<String> link = new BookmarkablePageLink<>("navbar_left_element_link", type.getPageClass());
            link.add(new Label("navbar_left_element_text", type.getLinkText()));
            // if the type is same as active page, mark it as active
            if (type.equals(activePage)) link.add(new AttributeAppender("class", "active", " "));
            item.add(link);
        }
    });

    // create the summoner search region drop down menu
    // get all valid entries
    List<String> endpoints = Arrays.asList(RiotEndpoint.PLAYABLE_ENDPOINTS)
            .stream().map(RiotEndpoint::name).collect(Collectors.toList());
    // add the options to the drop down menu
    DropDownChoice<String> dropDownChoice = new DropDownChoice<>("navbar_form_regions_select",
            new PropertyModel<>(this, "selectedRegion"), endpoints, new StringChoiceRenderer());
    dropDownChoice.add(new AttributeModifier("name", "region"));
    add(dropDownChoice);
}
 
開發者ID:LogicalOverflow,項目名稱:MasterStats,代碼行數:31,代碼來源:BasePage.java

示例6: initLayout

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
private void initLayout() {
    setOutputMarkupId(true);
    ListView<PrismObject<R>> list = new ListView<PrismObject<R>>(ID_LIST, availableRoles) {
        @Override
        protected void populateItem(ListItem<PrismObject<R>> item) {
            item.add(createRoleLink(ID_ITEM, item.getModel()));
        }
    };
    list.setOutputMarkupId(true);
    add(list);

    AjaxLink<String> buttonReset = new AjaxLink<String>(ID_BUTTON_RESET) {
        @Override
        public void onClick(AjaxRequestTarget target) {
            reset();
            target.add(SimpleRoleSelector.this);
        }
    };
    buttonReset.setBody(createStringResource("SimpleRoleSelector.reset"));
    add(buttonReset);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:22,代碼來源:SimpleRoleSelector.java

示例7: addPrivilegesPanel

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
private void addPrivilegesPanel(WebMarkupContainer body){
    privilegesNames = getPrivilegesNamesList();
    ListView<String> privilegesListComponent = new ListView<String>(ID_PRIVILEGES_LIST, privilegesNames){
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<String> item) {
            Label privilageNameLabel = new Label(ID_PRIVILEGE, item.getModel());
            item.add(privilageNameLabel);
        }
    };
    privilegesListComponent.setOutputMarkupId(true);
    privilegesListComponent.add(new VisibleEnableBehaviour(){
        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible(){
            if (!UserDtoStatus.ADD.equals(getModelObject().getStatus())){
                return true;
            }
           return false;
        }
    });
    body.addOrReplace(privilegesListComponent);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:26,代碼來源:DelegationEditorPanel.java

示例8: initLayout

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
private void initLayout() {
	ListView<ApprovalProcessExecutionInformationDto> list = new ListView<ApprovalProcessExecutionInformationDto>(ID_PROCESSES, getModel()) {
		@Override
		protected void populateItem(ListItem<ApprovalProcessExecutionInformationDto> item) {
			item.add(new Label(ID_NAME, LoadableModel.create(() -> {
				String targetName = item.getModelObject().getTargetName();
				if (targetName != null) {
					return ApprovalProcessesPreviewPanel.this.getString("ApprovalProcessesPreviewPanel.processRelatedTo", targetName);
				} else {
					return getString("ApprovalProcessesPreviewPanel.process");
				}
			}, false)));
			item.add(new ApprovalProcessExecutionInformationPanel(ID_PREVIEW, item.getModel()));
		}
	};
	add(list);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:18,代碼來源:ApprovalProcessesPreviewPanel.java

示例9: addOrReplaceContainers

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
private void addOrReplaceContainers(IModel<ObjectWrapper<O>> model, final Form form, boolean isToBeReplaced){
    ListView<ContainerWrapper> containers = new ListView<ContainerWrapper>(ID_CONTAINERS,
            createContainerModel(model)) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<ContainerWrapper> item) {
            PrismContainerPanel containerPanel = createContainerPanel(item, form);
            createMetadataPanel(model, item, containerPanel);
        }
    };
    containers.setReuseItems(true);

    if (isToBeReplaced) {
        replace(containers);
    } else {
        add(containers);
    }
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:20,代碼來源:PrismObjectPanel.java

示例10: addOrReplaceProperties

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
private void addOrReplaceProperties(IModel<ContainerWrapper> model, final Form form, boolean isToBeReplaced){
     ListView<ItemWrapper> properties = new ListView<ItemWrapper>("properties",
             new PropertyModel(model, "properties")) {
private static final long serialVersionUID = 1L;

@Override
         protected void populateItem(final ListItem<ItemWrapper> item) {
             item.add(new PrismPropertyPanel("property", item.getModel(), form, pageBase));
             item.add(new VisibleEnableBehaviour() {
             	private static final long serialVersionUID = 1L;
             	
             	@Override
             	public boolean isVisible() {
             		return item.getModel().getObject().isVisible();
             	}
             });
             item.add(AttributeModifier.append("class", createStyleClassModel(item.getModel())));
         }
     };
     properties.setReuseItems(true);
     if (isToBeReplaced) {
         replace(properties);
     } else {
         add(properties);
     }
 }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:27,代碼來源:PrismContainerPanel.java

示例11: initLayout

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
private void initLayout() {
	Label titleLabel = new Label(ID_TITLE, new PropertyModel<>(getModel(), InformationType.F_TITLE.getLocalPart()));
	titleLabel.add(new VisibleBehaviour(() -> getModelObject().getTitle() != null));
	add(titleLabel);

	ListView<InformationPartType> list = new ListView<InformationPartType>(ID_PARTS,
			new PropertyModel<>(getModel(), InformationType.F_PART.getLocalPart())) {
		@Override
		protected void populateItem(ListItem<InformationPartType> item) {
			InformationPartType part = item.getModelObject();
			Label label = new Label(ID_PART, part.getText());
			if (Boolean.TRUE.equals(part.isHasMarkup())) {
				label.setEscapeModelStrings(false);
			}
			item.add(label);
		}
	};
	add(list);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:20,代碼來源:InformationPanel.java

示例12: initCounters

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
private void initCounters() {
   	
   	ListView<InternalCounters> countersTable = new ListView<InternalCounters>(ID_COUNTERS_TABLE, Arrays.asList(InternalCounters.values())) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void populateItem(ListItem<InternalCounters> item) {
			InternalCounters counter = item.getModelObject();
			Label label = new Label(ID_COUNTER_LABEL, createStringResource("InternalCounters."+counter.getKey()));
			item.add(label);
	    	
	    	Label valueLabel = new Label(ID_COUNTER_VALUE, new AbstractReadOnlyModel<String>() {
				private static final long serialVersionUID = 1L;

				@Override
				public String getObject() {
					long val = InternalMonitor.getCount(counter);
					return Long.toString(val);
				}
			});
	    	item.add(valueLabel);
		}
   		
   	};
   	add(countersTable);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:27,代碼來源:PageInternals.java

示例13: createMenu

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
protected Component createMenu(String id) {
    final WebMarkupContainer menu = new WebMarkupContainer(id);
    menu.add(new ListView<DropdownMenuItem>("menuItem", getModel()) {
        @Override
        protected void populateItem(ListItem<DropdownMenuItem> item) {
            final DropdownMenuItem itemObject = item.getModelObject();
            //link that forms the menu item's action
            item.add(itemObject.getLink("link")
                    //link label defined by the menu item object
                    .add(new Label("label", itemObject.getLabel()))
                    //icon with icon class defined by the menu item object
                    .add(new WebMarkupContainer("icon")
                            .add(new AttributeModifier("class", itemObject.getIconClass())))
            );
        }
    });
    return menu;
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:19,代碼來源:BootstrapDropdown.java

示例14: addButtons

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
private void addButtons() {
    add(new ListView<RequirementButtonExtension>("buttons", extensions) {
        @Override
        protected void populateItem(ListItem<RequirementButtonExtension> item) {
            final RequirementButtonExtension itemModel = item.getModelObject();
            SingularSaveButton button = new SingularSaveButton("button", formModel, itemModel.shouldValidateForm()) {
                @Override
                protected void onValidationSuccess(AjaxRequestTarget target, Form<?> form, IModel<? extends SInstance> instanceModel) {
                    itemModel.onAction(new RequirementButtonExtension
                            .ActionContext(target, form, petInstanceModel.getObject(), instanceModel.getObject()));
                }
            };
            RequirementButtonExtension.ButtonView buttonView = itemModel.getButtonView();
            WebMarkupContainer                    icon       = new WebMarkupContainer("icon");
            if (buttonView.getIcon() != null) {
                icon.add($b.classAppender(buttonView.getIcon().getCssClass()));
            }
            else {
                icon.setVisible(false);
            }
            button.add(icon);
            button.add(new Label("label", buttonView.getLabel()).setRenderBodyOnly(true));
            item.add(button);
        }
    }.setRenderBodyOnly(true));
}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:27,代碼來源:ExtensionButtonsPanel.java

示例15: CategoryResponsePanel

import org.apache.wicket.markup.html.list.ListView; //導入依賴的package包/類
public CategoryResponsePanel(String id, IModel<? extends CategoryModel> categoryModel) {
    super(id);

    CategoryModel category = categoryModel.getObject();
    this.add(new Label("type", getType()));
    this.add(new Label("term", category.getTerm()));
    this.add(new Label("schema", category.getSchema()));
    this.add(new WebMarkupContainer("titleRow") {
        @Override
        public boolean isVisible() {
            return null != category.getTitle();
        }
    }.add(new Label("title", category.getTitle())));

    this.add(new ListView<AttributeModel>("attributeContainer", new ListModel<>(new ArrayList<>(category.getAttributes()))) {
        @Override
        protected void populateItem(ListItem<AttributeModel> listItem) {
            AttributeModel attribute = listItem.getModelObject();
            listItem.add(new Label("name", attribute.getName()));
            listItem.add(new Label("value", attribute.getValue().toString()));
            listItem.add(new Label("description", attribute.getDescription()));
        }
    });
}
 
開發者ID:citlab,項目名稱:Intercloud,代碼行數:25,代碼來源:CategoryResponsePanel.java


注:本文中的org.apache.wicket.markup.html.list.ListView類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。