当前位置: 首页>>代码示例>>Java>>正文


Java ListItem类代码示例

本文整理汇总了Java中org.apache.wicket.markup.html.list.ListItem的典型用法代码示例。如果您正苦于以下问题:Java ListItem类的具体用法?Java ListItem怎么用?Java ListItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ListItem类属于org.apache.wicket.markup.html.list包,在下文中一共展示了ListItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DocumentationIndexPage

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的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.ListItem; //导入依赖的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: getSourceAware

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的package包/类
@Nullable
private SourceAware getSourceAware(String path) {
	return diffsView.visitChildren(new IVisitor<Component, SourceAware>() {

		@SuppressWarnings("unchecked")
		@Override
		public void component(Component object, IVisit<SourceAware> visit) {
			if (object instanceof ListItem) {
				ListItem<BlobChange> item = (ListItem<BlobChange>) object;
				if (item.getModelObject().getPaths().contains(path)) {
					visit.stop((SourceAware) item.get(DIFF_ID));
				} else {
					visit.dontGoDeeper();
				}
			} 
		}

	});
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:20,代码来源:RevisionDiffPanel.java

示例4: populateNode

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的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.ListItem; //导入依赖的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: initButtons

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的package包/类
protected void initButtons(ListItem<T> item, WebMarkupContainer parent) {
        WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP); {
	        buttonGroup.setOutputMarkupId(true);
	
	        AjaxLink remove = new AjaxLink(ID_REMOVE) {
	
	            @Override
	            public void onClick(AjaxRequestTarget target) {
	                removeValuePerformed(target, item.getModelObject());
	            }
	        };
	        
	        remove.add(new VisibleEnableBehaviour() {
	
	            @Override
	            public boolean isVisible() {
	                return isRemoveButtonVisible();
	            }
	        });
	        buttonGroup.add(remove);
        }

        parent.add(buttonGroup);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:25,代码来源:MultiValueChoosePanel.java

示例7: removeValuePerformed

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的package包/类
protected void removeValuePerformed(AjaxRequestTarget target, ListItem<T> item){
    List<T> objects = getModelObject();
    Iterator<T> iterator = objects.iterator();
    while (iterator.hasNext()) {
        T object = iterator.next();
        if (object == null){
            continue;
        }
        if (object.equals(item.getModelObject())) {
            iterator.remove();
            break;
        }
    }

    target.add(this);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:17,代码来源:MultiValueTextPanel.java

示例8: removePerformed

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的package包/类
private void removePerformed(AjaxRequestTarget target, ListItem<ObjectPolicyConfigurationTypeDto> item){
    List<ObjectPolicyConfigurationTypeDto> list = getModelObject();
    Iterator<ObjectPolicyConfigurationTypeDto> iterator = list.iterator();

    while (iterator.hasNext()){
        ObjectPolicyConfigurationTypeDto object = iterator.next();

        if(object.equals(item.getModelObject())){
            iterator.remove();
            break;
        }
    }

    if(list.size() == 0){
        list.add(new ObjectPolicyConfigurationTypeDto());
    }

    target.add(this);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:ObjectPolicyConfigurationEditor.java

示例9: getClassModifier

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的package包/类
protected AttributeModifier getClassModifier(ListItem<AssignmentEditorDto> item){
	return AttributeModifier.append("class", new AbstractReadOnlyModel<String>() {
		private static final long serialVersionUID = 1L;

		@Override
		public String getObject() {
			AssignmentEditorDto dto = item.getModel().getObject();
			ObjectReferenceType targetRef = dto.getTargetRef();
			if (targetRef != null && targetRef.getType() != null) {
				return WebComponentUtil.getBoxThinCssClasses(targetRef.getType());
			} else {
				return GuiStyleConstants.CLASS_OBJECT_RESOURCE_BOX_THIN_CSS_CLASSES;
			}
		}
	});
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:17,代码来源:AssignmentTablePanel.java

示例10: initLayout

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的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

示例11: addPrivilegesPanel

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的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

示例12: initLayout

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的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

示例13: addOrReplaceContainers

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的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

示例14: addOrReplaceProperties

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的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

示例15: createCollapseItemId

import org.apache.wicket.markup.html.list.ListItem; //导入依赖的package包/类
private IModel<String> createCollapseItemId(final ListItem<ResourceObjectTypeDependencyType> item, final boolean appendSelector){
    return new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            StringBuilder sb = new StringBuilder();

            if(appendSelector){
                sb.append("#");
            }

            sb.append("collapse").append(item.getId());

            return sb.toString();
        }
    };
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:18,代码来源:ResourceDependencyEditor.java


注:本文中的org.apache.wicket.markup.html.list.ListItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。