本文整理匯總了Java中org.apache.wicket.markup.html.list.ListItem.getModel方法的典型用法代碼示例。如果您正苦於以下問題:Java ListItem.getModel方法的具體用法?Java ListItem.getModel怎麽用?Java ListItem.getModel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.html.list.ListItem
的用法示例。
在下文中一共展示了ListItem.getModel方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: RoomClientPanel
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
public RoomClientPanel(String id, ListItem<Client> item, final RoomPanel room) {
super(id, item.getModel());
setRenderBodyOnly(true);
Client c = item.getModelObject();
final String uid = c.getUid();
item.setMarkupId(String.format("user%s", c.getUid()));
item.add(AttributeModifier.append("style", String.format("background-image: url(profile/%s);", c.getUserId())));
item.add(AttributeModifier.append("data-userid", c.getUserId()));
add(new RefreshIcon("refresh", uid, room));
final String name = getName(c);
add(new Label("name", name));
add(new UserSpeaksIcon("user-speaks", uid, room));
item.add(AttributeModifier.replace(ATTR_TITLE, name));
WebMarkupContainer actions = new WebMarkupContainer("actions");
actions.add(new KickIcon("kick", uid, room));
actions.add(new WebMarkupContainer("privateChat").setVisible(!room.getRoom().isHidden(RoomElement.Chat) && !getUserId().equals(c.getUserId())));
actions.setVisible(room.getClient().hasRight(Right.moderator));
if (c.getUid().equals(room.getClient().getUid())) {
actions.add(new SelfIconsPanel("icons", uid, room, false));
item.add(AttributeModifier.append(ATTR_CLASS, "current"));
} else {
actions.add(new ClientIconsPanel("icons", uid, room));
}
add(actions);
}
示例3: createMessageSetsView
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private ListView<LogMessageSet> createMessageSetsView()
{
return new ListView<LogMessageSet>("messageSets",
PropertyModel.of(this, "formModel.messageSets"))
{
private static final long serialVersionUID = 8957632000765128508L;
@Override
protected void populateItem(ListItem<LogMessageSet> aItem)
{
IModel<LogMessageSet> set = aItem.getModel();
aItem.add(new Label("name", PropertyModel.of(set, "name")));
aItem.add(createMessagesView(set));
}
};
}
示例4: createMessagesView
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private ListView<LogMessage> createMessagesView(IModel<LogMessageSet> aModel)
{
return new ListView<LogMessage>("messages", PropertyModel.of(aModel, "messages"))
{
private static final long serialVersionUID = 8957632000765128508L;
@Override
protected void populateItem(ListItem<LogMessage> aItem)
{
IModel<LogMessage> msg = aItem.getModel();
aItem.add(new Label("level", PropertyModel.of(msg, "level")));
aItem.add(new Label("source", PropertyModel.of(msg, "source.simpleName")));
aItem.add(new Label("message", PropertyModel.of(msg, "message")));
}
};
}
示例5: populateAssignmentDetailsPanel
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
protected void populateAssignmentDetailsPanel(ListItem<AssignmentEditorDto> item){
AssignmentEditorPanel editor = new AssignmentEditorPanel(ID_ROW, item.getModel(), pageBase){
@Override
protected boolean ignoreMandatoryAttributes(){
return AssignmentTablePanel.this.ignoreMandatoryAttributes();
}
};
item.add(editor);
editor.add(getClassModifier(item));
}
示例6: initLayout
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private void initLayout(final IModel<SceneItemDto> model) {
ListView<SceneItemLineDto> items = new ListView<SceneItemLineDto>(ID_ITEM_LINES,
new PropertyModel<List<SceneItemLineDto>>(model, SceneItemDto.F_LINES)) {
@Override
protected void populateItem(ListItem<SceneItemLineDto> item) {
SceneItemLinePanel panel = new SceneItemLinePanel(ID_ITEM_LINE, item.getModel());
item.add(panel);
}
};
items.setReuseItems(true);
add(items);
}
示例7: 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);
}
示例8: 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);
}
示例9: createResourcesList
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private PageableListView createResourcesList(String id, SolrFieldModel<String> resourceModel) {
// list of resources in this record
final IModel<List<String>> resourceListModel = new CollectionListModel<>(resourceModel);
// use a a pageable view so that the number of resources actually shown is limited
return new PageableListView<String>(id, resourceListModel, MAX_RESOURCES_TO_SHOW) {
@Override
protected void populateItem(final ListItem<String> item) {
// get resource string converted into a ResourceInfo model
final ResourceInfoModel resourceInfoModel = new ResourceInfoModel(resourceStringConverter, item.getModel());
final Label resourceName = new Label("resourceName", new PropertyModel(resourceInfoModel, "fileName"));
// once loaded, make Ajax request to resolve handles and update resource link
resourceName.add(new LazyResourceInfoUpdateBehavior(resolvingResourceStringConverter, resourceInfoModel) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
// update resource link
target.add(resourceName);
}
});
resourceName.setOutputMarkupId(true);
item.add(new RecordPageLink("resourceLink", SearchResultItemExpandedPanel.this.getModel(), searchContextModel, RecordPage.RESOURCES_SECTION)
.add(resourceName));
item.add(new ExternalLink("downloadLink", new HandleLinkModel(new PropertyModel(resourceInfoModel, "href"))));
item.add(new ResourceTypeGlyphicon("resourceTypeIcon", new PropertyModel<String>(resourceInfoModel, "resourceType")));
}
};
}
示例10: createLicenseItems
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private MarkupContainer createLicenseItems(final String id) {
//pattern to match non-alphanumeric characters (for replacement in CSS class)
final IModel<Pattern> nonAlphanumericPatternModel = Model.of(Pattern.compile("[^a-zA-Z0-9]"));
return new ListView<String>(id, new CollectionListModel<>(licensesModel)) {
@Override
protected void populateItem(final ListItem<String> item) {
//Model for the license URL: URLs are taken from the license
//URL property file. The fallback will guarantee a null value,
//even if no property has been defined for the license id at hand
final IModel<String> linkPageModel = new NullFallbackModel(
new StringResourceModel("license.url.${}", this, item.getModel()), //see licenseUrls.properties
new Model<String>());
//Model for the user friendly name of the license
final ConvertedFieldValueModel licenseNameModel = new ConvertedFieldValueModel(item.getModel(), FacetConstants.FIELD_LICENSE);
//create link to licence page
item.add(new ExternalLink("licensePage", linkPageModel) {
{
add(new Label("licenseName", licenseNameModel));
}
@Override
public boolean isEnabled() {
return linkPageModel.getObject() != null;
}
});
//add tooltip for consistency with other legal information (availability)
item.add(new AttributeModifier("title", licenseNameModel));
//since value is URI, replace all non-alphanumeric characters with underscore for the CSS class
item.add(new AttributeAppender("class",
new StringReplaceModel(item.getModel(), nonAlphanumericPatternModel, Model.of("_")), " "));
}
};
}
示例11: createAvailabilityItems
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private MarkupContainer createAvailabilityItems(final String id) {
//model will be used to fetch availability descriptions
final IModel<Map<String, FieldValueDescriptor>> descriptorsModel
= new MapModel<>(ImmutableMap.copyOf(FieldValueDescriptor.toMap(vloConfig.getAvailabilityValues())));
//define the order for availability values
final Ordering<String> availabilityOrder = new PreferredExplicitOrdering(
//extract the 'primary' availability values from the configuration
FieldValueDescriptor.valuesList(vloConfig.getAvailabilityValues()));
return new ListView<String>(id, new CollectionListModel<>(availabilityModel, availabilityOrder)) {
@Override
protected void populateItem(ListItem<String> item) {
//human friendly version of availability value
final IModel<String> titleModel = new ConvertedFieldValueModel(item.getModel(), FacetConstants.FIELD_AVAILABILITY);
//descriptor model for the availability value - with fallback to 'plain' (converted) value
final IModel<FieldValueDescriptor> descriptorModel = new MapValueModel<>(descriptorsModel, item.getModel());
final IModel<String> descriptionModel = new PropertyModel<>(descriptorModel, "description");
final IModel<String> descriptionFallbackModel = new NullFallbackModel(descriptionModel, titleModel);
item.add(new Label("availabilityDescription", descriptionFallbackModel));
item.add(new AttributeAppender("title", titleModel));
item.add(new AttributeAppender("class", item.getModel(), " "));
}
};
}
示例12: populateItem
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
@Override
protected void populateItem(ListItem<PopulateApplicationInformation> listItem) {
Check<PopulateApplicationInformation> appCheckBox = new Check<>("appCheckBox", listItem.getModel());
/* checkboxes must have distinct names so that automatic UI tests can find them
if you change that line, please change the tests that use the populate page
*/
appCheckBox.add(new AttributeModifier("id", new Model<String>(((PopulateApplicationInformation)listItem.getModelObject()).getAppName())));
// appCheckBox.add(new AttributeAppender("name", new Model<String>(((PopulateApplicationInformation)listItem.getModelObject()).getAppLabel())," "));
listItem.add(appCheckBox);
listItem.add(new Label("appName", new PropertyModel(listItem.getModel(), "appName")));
listItem.add(new TextField("nbOfReleases", new PropertyModel(listItem.getModel(), "nbOfReleases")).add(new AttributeModifier("class","small")));
listItem.add(new TextField("nbOfEnvironments", new PropertyModel(listItem.getModel(), "nbOfEnvironments")).add(new AttributeModifier("class","small")));
}
示例13: drawTreeElement
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
/**
* @param markupId
* @param item
* @return Returns a WebMarkContainer with the item details of an element of the tree
*/
private WebMarkupContainer drawTreeElement(String markupId, ListItem<QMTreeNode> item){
QMTreeNode node = item.getModelObject();
WebMarkupContainer container = new WebMarkupContainer(markupId);
container.add(new Label("name", new PropertyModel<String>(node, "name")));
container.add(new Icon("icon", node.getIconType()));
Check<QMTreeNode> check = new Check<>("nodeCheck", item.getModel(),
dataGroup);
container.add(check);
// Adds tags and Checks for elements of the QM
if (node instanceof QMBaseIndicator) {
// Marks as Checked if the item has tags coincidences
for (MetaData tag : projectTags) {
for (QModelTagData tagModel : ((QMBaseIndicator) node)
.getQModelTagData()) {
if (tagModel.getName().equals(tag.getName())) {
check.add(new AttributeModifier("checked", "checked"));
}
}
}
// Adds the tags of every element
WebMarkupContainer tags = new WebMarkupContainer("tags");
tags.add(newLabelInWMC("tag", new PropertyModel<QModelTagData>(
node, "qModelTagData"), tags));
tags.add(new AttributeModifier("style", "margin-left:50px"));
container.add(tags);
}
return container;
}
示例14: createContainerPanel
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
protected PrismContainerPanel createContainerPanel(ListItem<ContainerWrapper> item, Form form){
PrismContainerPanel panel = new PrismContainerPanel(ID_CONTAINER, item.getModel(), true, form, pageBase);
panel.setOutputMarkupPlaceholderTag(true);
item.add(panel);
return panel;
}
示例15: initLayout
import org.apache.wicket.markup.html.list.ListItem; //導入方法依賴的package包/類
private void initLayout(final IModel<PrismObject<ResourceType>> model, final PageBase parentPage) {
setOutputMarkupId(true);
IModel<List<ConnectorOperationalStatus>> statsModel = new AbstractReadOnlyModel<List<ConnectorOperationalStatus>>() {
private static final long serialVersionUID = 1L;
@Override
public List<ConnectorOperationalStatus> getObject() {
PrismObject<ResourceType> resource = model.getObject();
Task task = parentPage.createSimpleTask(OPERATION_GET_CONNECTOR_OPERATIONAL_STATUS);
OperationResult result = task.getResult();
List<ConnectorOperationalStatus> status = null;
try {
status = parentPage.getModelInteractionService().getConnectorOperationalStatus(resource.getOid(), task, result);
} catch (SchemaException | ObjectNotFoundException | CommunicationException
| ConfigurationException | ExpressionEvaluationException e) {
LOGGER.error("Error getting connector status for {}: {}", resource, e.getMessage(), e);
parentPage.showResult(result);
}
return status;
}
};
ListView<ConnectorOperationalStatus> listview = new ListView<ConnectorOperationalStatus>(ID_CONNECTOR_LIST, statsModel) {
private static final long serialVersionUID = 1L;
protected void populateItem(ListItem<ConnectorOperationalStatus> item) {
item.add(new Label("label", item.getModel()));
IModel<ConnectorOperationalStatus> statModel = item.getModel();
item.add(createLabel(statModel, ID_CONNECTOR_NAME, ConnectorOperationalStatus.F_CONNECTOR_NAME));
item.add(createLabel(statModel, ID_CONNECOTR_CLASS, ConnectorOperationalStatus.F_CONNECTOR_CLASS_NAME));
item.add(createLabel(statModel, ID_POOL_CONFIG_MIN_SIZE, ConnectorOperationalStatus.F_POOL_CONFIG_MIN_SIZE));
item.add(createLabel(statModel, ID_POOL_CONFIG_MAX_SIZE, ConnectorOperationalStatus.F_POOL_CONFIG_MAX_SIZE));
item.add(createLabel(statModel, ID_POOL_CONFIG_MIN_IDLE, ConnectorOperationalStatus.F_POOL_CONFIG_MIN_IDLE));
item.add(createLabel(statModel, ID_POOL_CONFIG_MAX_IDLE, ConnectorOperationalStatus.F_POOL_CONFIG_MAX_IDLE));
item.add(createLabel(statModel, ID_POOL_CONFIG_WAIT_TIMEOUT, ConnectorOperationalStatus.F_POOL_CONFIG_WAIT_TIMEOUT));
item.add(createLabel(statModel, ID_POOL_CONFIG_MIN_EVICTABLE_IDLE_TIME, ConnectorOperationalStatus.F_POOL_CONFIG_MIN_EVICTABLE_IDLE_TIME));
item.add(createLabel(statModel, ID_POOL_STATUS_NUM_IDLE, ConnectorOperationalStatus.F_POOL_STATUS_NUM_IDLE));
item.add(createLabel(statModel, ID_POOL_STATUS_NUM_ACTIVE, ConnectorOperationalStatus.F_POOL_STATUS_NUM_ACTIVE));
}
};
add(listview);
}