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


Java ListItem.getModelObject方法代码示例

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


在下文中一共展示了ListItem.getModelObject方法的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: 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

示例3: initLayout

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

示例4: initCounters

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

示例5: populateItem

import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
@Override
protected void populateItem(final ListItem<StreamClient> item) {
	StreamClient client = item.getModelObject();
	item.add(new Label("clientId", "" + client.getId()))
		.add(new Label("clientLogin", "" + client.getLogin()))
		.add(new ConfirmableAjaxBorder("clientDelete", getString("80"), getString("833")) {
			private static final long serialVersionUID = 1L;

			@Override
			protected void onSubmit(AjaxRequestTarget target) {
				StreamClient c = item.getModelObject();
				getBean(UserManager.class).kickById(c.getUid());
				updateClients(target);
			}
		});
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:17,代码来源:RoomForm.java

示例6: createDocumentList

import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void createDocumentList(List<DocumentListData> docList) {
    ListView listview = new ListView("listView", docList) {
        @Override
        protected void populateItem(ListItem item) {
            DocumentListData doc = (DocumentListData) item.getModelObject();
            
            PageParameters pp = new PageParameters();
            pp.add("id", doc.getId());
            
            BookmarkablePageLink<Void> docLink = new BookmarkablePageLink("docLink", DocumentTabs.class, pp);
            item.add(docLink.add(new Label("id", doc.getId())));
            item.add(new Label("title", doc.getTitle()));
            item.add(new Label("author", doc.getAuthor()));
        }
    };
    add(listview);
}
 
开发者ID:martin-kanis,项目名称:relax-dms,代码行数:18,代码来源:DocumentList.java

示例7: makeAssignmentsToCreateListView

import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
/**
 * Helper to create a listview for what needs to be shown for new assignments
 * @param markupId wicket markup id
 * @param itemList list of Assignments populated by the item creation steps
 */
private ListView<Assignment> makeAssignmentsToCreateListView(final String markupId, final List<Assignment> itemList) {
	final ListView<Assignment> rval = new ListView<Assignment>(markupId, itemList) {
		@Override
		protected void populateItem(final ListItem<Assignment> item) {
			final Assignment assignment = item.getModelObject();

			String extraCredit = assignment.isExtraCredit() ? yes : no;
			String dueDate = FormatHelper.formatDate(assignment.getDueDate(), "");
			String releaseToStudents = assignment.isReleased() ? yes : no;
			String includeInCourseGrades = assignment.isCounted() ? yes : no;

			item.add(new Label("title", assignment.getName()));
			item.add(new Label("points", assignment.getPoints()));
			item.add(new Label("extraCredit", extraCredit));
			item.add(new Label("dueDate", dueDate));
			item.add(new Label("releaseToStudents", releaseToStudents));
			item.add(new Label("includeInCourseGrades", includeInCourseGrades));
		}
	};

	return rval;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:28,代码来源:GradeImportConfirmationStep.java

示例8: populateItem

import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
@Override
protected void populateItem(ListItem<Person> item) {
  Person person = item.getModelObject();
  item.add(new Label("firstname", person.getFirstName()));
  item.add(new Label("lastname", person.getLastName()));
  item.add(new Label("jobtitle", person.getJobTitle()));
}
 
开发者ID:sparsick,项目名称:ansible-docker-talk,代码行数:8,代码来源:PersonListView.java

示例9: populateItem

import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
@Override
protected void populateItem(ListItem<ChampionMasteryItem> item) {
    ChampionMasteryItem mastery = item.getModelObject();
    ChampionStatisticItem championStatistic = null;
    // create boolean to storing whether or not element should be shown
    // set to false if mastery or championStatistic is null
    boolean visible = true;
    // check if mastery is null

    if (mastery != null) {
        championStatistic = PageDataProvider.getChampionStatisticById(mastery.getChampionId());
    } else {
        // if mastery is null create a new one and fill it with default data
        mastery = new ChampionMasteryItem();
        mastery.setChampionPoints(42);
        mastery.setChampionLevel(1);
        visible = false;
    }
    if (championStatistic == null) {
        // if champion statistic is null use default champion for statistic
        championStatistic = PageDataProvider.championStatisticMap.get("bard");
        visible = false;
    }

    // create link to champion page
    PageParameters linkParameters = new PageParameters();
    linkParameters.set(0, championStatistic.getKeyName());
    BookmarkablePageLink<String> link = new BookmarkablePageLink<>("champion_link",
            SingleChampionPage.class, linkParameters);
    item.add(link);

    // add champion portrait, name and mastery score as well as champion level
    link.add(new ExternalImage("champion_portrait", championStatistic.getPortraitUrl()));
    link.add(new Label("champion_name", championStatistic.getChampionName()));
    link.add(new Label("champion_stats", String.format("%s - Level %d", NumberFormatter.formatLong(
            mastery.getChampionPoints()), mastery.getChampionLevel())));

    // hide link if necessary
    link.setVisible(visible);
}
 
开发者ID:LogicalOverflow,项目名称:MasterStats,代码行数:41,代码来源:SingleSummonerPage.java

示例10: createDependencyLabelModel

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

        @Override
        public String getObject() {
            StringBuilder sb = new StringBuilder();
            ResourceObjectTypeDependencyType dep = item.getModelObject();
            sb.append("#").append(item.getIndex()+1).append(" - ");

            if(dep.getResourceRef() != null){
                sb.append(resourceMap.get(dep.getResourceRef().getOid())).append(":");
            }

            if(dep.getKind() != null){
                sb.append(dep.getKind().toString()).append(":");
            }

            if(dep.getIntent() != null){
                sb.append(dep.getIntent()).append(":");
            }

            sb.append(dep.getOrder()).append(":");
            if(dep.getStrictness() != null){
                sb.append(dep.getStrictness().toString());
            }

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

示例11: initMenuItem

import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void initMenuItem(ListItem<InlineMenuItem> menuItem) {
    final InlineMenuItem item = menuItem.getModelObject();

    menuItem.add(AttributeModifier.append("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            if (item.isMenuHeader()) {
                return "dropdown-header";
            } else if (item.isDivider()) {
                return "divider";
            }

            return getBoolean(item.getEnabled(), true) ? null : "disabled";
        }
    }));

        menuItem.add(new VisibleEnableBehaviour() {

            @Override
            public boolean isEnabled() {
                return getBoolean(item.getEnabled(), true);
            }

            @Override
            public boolean isVisible() {
                return getBoolean(item.getVisible(), true);
            }
        });

    WebMarkupContainer menuItemBody;
    if (item.isMenuHeader() || item.isDivider()) {
        menuItemBody = new MenuDividerPanel(ID_MENU_ITEM_BODY, menuItem.getModel());
    } else {
        menuItemBody = new MenuLinkPanel(ID_MENU_ITEM_BODY, menuItem.getModel());
    }
    menuItemBody.setRenderBodyOnly(true);
    menuItem.add(menuItemBody);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:40,代码来源:InlineMenu.java

示例12: initLayout

import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void initLayout() {
     setOutputMarkupId(true);

     WebMarkupContainer messagesPanel = new WebMarkupContainer(ID_MESSAGES_PANEL);
     messagesPanel.setOutputMarkupId(true);
     add(messagesPanel);
     
     ListView<ConnectorStruct> connectorView = new ListView<ConnectorStruct>(ID_CONNECTOR_MESSAGES_PANEL, connectorResourceResults) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<ConnectorStruct> item) {
	Label connectorNameLabel = new Label(ID_CONNECTOR_NAME, item.getModelObject().connectorName);
	item.add(connectorNameLabel);
      	RepeatingView connectorResultView = new RepeatingView(ID_CONNECTOR_MESSAGES);
      	List<OpResult> resultsDto = item.getModelObject().connectorResultsDto;
      	if (resultsDto != null) {
              initResultsPanel(connectorResultView, resultsDto, parentPage);
          }
      	item.add(connectorResultView);
}
     	
     };
     messagesPanel.add(connectorView);

     RepeatingView resultView = new RepeatingView(ID_RESOURCE_MESSAGES);
     if (modelResourceResults.getObject() != null) {
         initResultsPanel(resultView, modelResourceResults.getObject(), parentPage);
     }
     resultView.setOutputMarkupId(true);
     messagesPanel.add(resultView);
 }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:32,代码来源:TestConnectionMessagesPanel.java

示例13: initMenuItem

import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void initMenuItem(ListItem<InlineMenuItem> menuItem) {
    final InlineMenuItem item = menuItem.getModelObject();

    WebMarkupContainer menuItemBody = new MenuLinkPanel(ID_MENU_ITEM_BODY, menuItem.getModel());
    menuItemBody.setRenderBodyOnly(true);
    menuItem.add(menuItemBody);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:8,代码来源:DropdownButtonPanel.java

示例14: addCharts

import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
/**
 * adds all attribute charts from database to page
 */
@SuppressWarnings({"unchecked"})
private void addCharts() {
	this.listview = new ListView("listview", this.getOptions()) {
		@Override
		protected void populateItem(final ListItem item) {
			// prepare and add chart
			final ChartConfiguration currentOptions = (ChartConfiguration) item.getModelObject();
			item.add(AttributeChartPage.this.addChart(currentOptions));
			// prepare and add removeButton
			final AjaxButton removeButton = new AjaxButton("removeChartButton") {
				private static final long serialVersionUID = 1L;

				@Override
				public void onSubmit(final AjaxRequestTarget target, final Form form) {
					currentOptions.remove();
					AttributeChartPage.this.getOptions().detach();
					target.add(AttributeChartPage.this.listview.getParent());
				}
			};
			final Form<Void> removeform = new Form<Void>("form");
			removeform.add(removeButton);
			item.add(removeform);
		}

	};
	this.listview.setOutputMarkupId(true);

	this.add(this.listview);
}
 
开发者ID:bptlab,项目名称:Unicorn,代码行数:33,代码来源:AttributeChartPage.java

示例15: addViews

import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked"})
private void addViews() {
	this.listview = new ListView("listview", this.views) {
		@Override
		protected void populateItem(final ListItem item) {
			// prepare and add view
			final EventView viewOptions = (EventView) item.getModelObject();
			final WebMarkupContainer view = new WebMarkupContainer("view");
			try {
				// build view
				final EventViewOptions options = new EventViewOptions(viewOptions);
				view.add(new Chart("view", options));
				view.add(new Label("sub", options.getExplanationString()));
			} catch (final Exception e) {
				e.printStackTrace();
				// if chart could not be build, display error message
				view.add(new Label("view", "This View could not be built."));
				view.add(new Label("sub", "Sorry for the inconvenience"));
			}
			item.add(view);
			// prepare and add removeButton
			final AjaxButton removeButton = new AjaxButton("removeViewButton") {
				private static final long serialVersionUID = 1L;

				@Override
				public void onSubmit(final AjaxRequestTarget target, final Form form) {
					viewOptions.remove();
					EventViewPage.this.views.detach();
					target.add(EventViewPage.this.listview.getParent());
				}
			};
			final Form<Void> removeform = new Form<Void>("removeform");
			removeform.add(removeButton);
			item.add(removeform);
		}
	};
	this.listview.setOutputMarkupId(true);

	this.add(this.listview);
}
 
开发者ID:bptlab,项目名称:Unicorn,代码行数:41,代码来源:EventViewPage.java


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