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


Java RepeatingView类代码示例

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


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

示例1: getPropertyEditorsAtRow

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private List<PropertyEditor<Serializable>> getPropertyEditorsAtRow(int index) {
	WebMarkupContainer table = (WebMarkupContainer) get("listEditor");
	RepeatingView rows = (RepeatingView) table.get("elements");

	int currentIndex = 0;
	Iterator<Component> it = rows.iterator();
	Component row = it.next();
	while (currentIndex++ < index) {
		row = it.next();
	}
	
	List<PropertyEditor<Serializable>> propertyEditors = new ArrayList<>();
	RepeatingView columns = (RepeatingView) row.get("properties");
	for (Component column: columns) {
		propertyEditors.add((PropertyEditor<Serializable>) column.get("propertyEditor"));
	}
	
	return propertyEditors;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:21,代码来源:ConcreteListPropertyEditor.java

示例2: convertInputToValue

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
@Override
protected List<Serializable> convertInputToValue() throws ConversionException {
	if (get("listEditor").isVisible()) {
		List<Serializable> newList = newList();
		
		RepeatingView rows = (RepeatingView) get("listEditor").get("elements");
		for (Component row: rows) {
			Serializable element = newElement();
			newList.add(element);
			
			RepeatingView columns = (RepeatingView) row.get("properties");
			for (Component column: columns) {
				@SuppressWarnings("unchecked")
				PropertyEditor<Serializable> propertyEditor = (PropertyEditor<Serializable>) column.get("propertyEditor");

				propertyEditor.getPropertyDescriptor().setPropertyValue(element, propertyEditor.getConvertedInput());
			}
		}
		return newList;
	} else {
		return null;
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:24,代码来源:ConcreteListPropertyEditor.java

示例3: createPropertyColumn

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
private static <T> PropertyColumn<T, String> createPropertyColumn(String name, String sortableProperty,
		final String expression, final boolean multivalue) {

	return new PropertyColumn<T, String>(createStringResource(name), sortableProperty, expression) {
		private static final long serialVersionUID = 1L;

		@Override
		public void populateItem(Item item, String componentId, IModel rowModel) {
			if (multivalue) {
				IModel<List> values = new PropertyModel<List>(rowModel, expression);
				RepeatingView repeater = new RepeatingView(componentId);
				for (final Object task : values.getObject()) {
					repeater.add(new Label(repeater.newChildId(), task.toString()));
				}
				item.add(repeater);
				return;
			}

			super.populateItem(item, componentId, rowModel);
		}
	};

}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:24,代码来源:ColumnUtils.java

示例4: populateItem

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
@Override
protected final void populateItem(final Item<T> item) {
	RepeatingView cells = new RepeatingView(CELL_REPEATER_ID);
	item.add(cells);

	int populatorsNumber = populators.size();
	for (int i = 0; i < populatorsNumber; i++) {
		ICellPopulator<T> populator = populators.get(i);
		IModel<ICellPopulator<T>> populatorModel = new Model<>(populator);
		Item<ICellPopulator<T>> cellItem = newCellItem(cells.newChildId(), i, populatorModel);
		cells.add(cellItem);

		populator.populateItem(cellItem, CELL_ITEM_ID, item.getModel());

		if (cellItem.get("cell") == null) {
			throw new WicketRuntimeException(
					populator.getClass().getName()
					+ ".populateItem() failed to add a component with id [" + CELL_ITEM_ID + "] to the provided"
					+ " [cellItem] object. Make sure you call add() on cellItem and make sure you gave the added"
					+ " component passed in 'componentId' id."
					+ " (*cellItem*.add(new MyComponent(*componentId*, rowModel) )");
		}
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:25,代码来源:SequenceGridView.java

示例5: createMainMenu

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
private void createMainMenu(final Builder builder) {
    BookmarkablePageLink<Void> homePageLink = new BookmarkablePageLink<>("homePageLink", builder.homePage);
    homePageLink.add(new Label("label", builder.applicationName));
    add(homePageLink);
    
    RepeatingView menuItems = new RepeatingView("menuItems");
    
    builder.linksMap.keySet().stream().forEach((item) -> {
        boolean shouldBeActive = item.equals(builder.activeMenuItem);

        List<BookmarkablePageLink<?>> pageLinks = builder.linksMap.get(item);

        if (pageLinks.size() == 1) {
            BookmarkablePageLink<?> pageLink = pageLinks.get(0);
            MenuLinkItem menuLinkItem = new MenuLinkItem(menuItems.newChildId(), pageLink, shouldBeActive);
            menuItems.add(menuLinkItem);
        } else {
            menuItems.add(new MenuDropdownItem(menuItems.newChildId(), item, pageLinks,
                    shouldBeActive));
        }
    });
    
    add(menuItems);
}
 
开发者ID:martin-kanis,项目名称:relax-dms,代码行数:25,代码来源:Menu.java

示例6: MenuDropdownItem

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
public MenuDropdownItem(String id, MenuItemEnum currentMenuItem,
Collection<BookmarkablePageLink<?>> linksInMenuItem, boolean shouldBeActive) {
     super(id);

     WebMarkupContainer itemContainer = new WebMarkupContainer("itemContainer");
     if (shouldBeActive) {
         itemContainer.add(new AttributeAppender("class", " active "));
     }
     itemContainer.add(new Label("label", currentMenuItem.getLabel()));

     RepeatingView repeatingView = new RepeatingView("itemLinks");

     linksInMenuItem.stream().map((link) -> new MenuLinkItem(repeatingView.newChildId(), link, false)).forEach((menuLinkItem) -> {
         repeatingView.add(menuLinkItem);
     });

     itemContainer.add(repeatingView);
     add(itemContainer);
 }
 
开发者ID:martin-kanis,项目名称:relax-dms,代码行数:20,代码来源:MenuDropdownItem.java

示例7: addCrumbs

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
public void addCrumbs(PageParameters pageParameters) {
    RepeatingView items = new RepeatingView("item");
    add(items);

    items.add(new BreadCrumbItem(items.newChildId(), "All Builds", new PageParameters(), true));

    PageParameters responseParams = new PageParameters();
    for (String constant : PATH_CONSTANTS) {
        String constantValue = pageParameters.get(constant).toString();
        if (constantValue != null) {
            responseParams.set(constant, constantValue);

            final String format = getString(constant + ".format");
            final String value = String.format(format, constantValue);
            items.add(new BreadCrumbItem(items.newChildId(), value, new PageParameters(responseParams), false));
        }
    }
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:19,代码来源:BuildBreadCrumbsPanel.java

示例8: createScopesContainer

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
private MarkupContainer createScopesContainer() {
    WebMarkupContainer scopesContainer = new WebMarkupContainer("scopesContainer");
    scopesContainer.setOutputMarkupId(true);
    if (scopes.isEmpty()) {
        scopesContainer.setVisible(false);
        return scopesContainer;
    }

    RepeatingView scopesView = new RepeatingView("scopeCheckbox");
    scopesContainer.add(scopesView);

    for (String scope : scopes) {
        StyledCheckbox checkbox =
                new StyledCheckbox(scopesView.newChildId(), new SelectedItemModel<>(selectedScopes, scope)) {
                    @Override
                    public boolean isEnabled() {
                        return dependencies && super.isEnabled();
                    }
                };
        checkbox.setLabel(Model.of(scope));
        scopesView.add(checkbox);
    }
    return scopesContainer;
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:25,代码来源:BuildSearchResultsPanel.java

示例9: BreadCrumbsPanel

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
public BreadCrumbsPanel(String id, String path) {
    super(id);
    add(new CssClass("bread-crumbs"));

    RepeatingView items = new RepeatingView("item");
    add(items);

    String[] folders = path.split("[:/]");
    StringBuilder url = new StringBuilder(RequestUtils.getWicketServletContextUrl());
    url.append("/");
    // add the /simple request
    url.append(ArtifactoryRequest.SIMPLE_BROWSING_PATH).append("/");
    // add repo root
    String repo = folders[0];
    url.append(repo);
    url.append("/");
    items.add(new BreadCrumbItem(items.newChildId(), repo, url, ":"));

    for (int i = 1; i < folders.length; i++) {
        String folder = folders[i];
        url.append(folder);
        url.append("/");
        items.add(new BreadCrumbItem(items.newChildId(), folder, url, "/"));
    }
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:26,代码来源:BreadCrumbsPanel.java

示例10: SubMenuPanel

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
public SubMenuPanel(String id, List<MenuNode> menuNodes, Class<? extends Page> currentPage) {
    super(id);
    setOutputMarkupId(true);
    add(ResourcePackage.forJavaScript(SubMenuPanel.class));

    RepeatingView items = new RepeatingView("menuItem");
    add(items);

    for (MenuNode menuNode : menuNodes) {
        MenuItem menuItem = new MenuItem(items.newChildId(), menuNode, currentPage);
        items.add(menuItem);

        if (!menuNode.isLeaf()) {
            SubMenuPanel subMenuPanel = new SubMenuPanel(items.newChildId(), menuNode.getChildren(), currentPage);
            items.add(subMenuPanel);

            boolean opened = menuItem.getStatus().isOpened();
            String cssClass = opened ? "sub-menu-opened" : "sub-menu-closed";
            subMenuPanel.add(new CssClass(cssClass));
        }
    }

    if (menuNodes.isEmpty()) {
        setVisible(false);
    }
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:27,代码来源:SubMenuPanel.java

示例11: TablePanel

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
public TablePanel(String id) {

        super(id);
        setOutputMarkupId(true);

        WebMarkupContainer table = new WebMarkupContainer("table");
        add(table);

        table.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
            @Override
            public String getObject() {
                return clickable ? "lightTable-clickable" : null;
            }
        }, " "));

        table.add(headerRowRepeater = new RepeatingView("headerRow"));
        table.add(rowRepeater = new RepeatingView("row"));
    }
 
开发者ID:jkrasnay,项目名称:panelized,代码行数:19,代码来源:TablePanel.java

示例12: DialogPanel

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param id ID of the panel;
 */
public DialogPanel(String id) {

    super(id);

    setOutputMarkupId(true);

    childRepeater = new RepeatingView("child");
    add(childRepeater);

    add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
        @Override
        public String getObject() {
            String result = "pnl-Dialog pnl-Dialog--" + size.name().toLowerCase() + " pnl-Dialog--height-" + height.name().toLowerCase();
            String cssClass = getCssClass();
            if (cssClass != null) {
                result += " " + cssClass;
            }
            return result;
        }
    }, " "));

}
 
开发者ID:jkrasnay,项目名称:panelized,代码行数:28,代码来源:DialogPanel.java

示例13: ContainerPanel

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
public ContainerPanel(String id, IModel<?> model) {

        super(id, model);

        setOutputMarkupId(true);

        add(panelRepeater = new RepeatingView("panel") {
            @Override
            protected void renderChild(Component child) {
                child.setRenderBodyOnly(!renderDivs);
                super.renderChild(child);
            }
        });

        add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
            @Override
            public String getObject() {
                return getCssClass();
            }
        }, " "));

    }
 
开发者ID:jkrasnay,项目名称:panelized,代码行数:23,代码来源:ContainerPanel.java

示例14: onConfigure

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
@Override
protected void onConfigure() {
	RepeatingView view = new RepeatingView("control");
	if(null != getModelObject()) {
		for(final String property : getPropertiesByOrder(getModelObject().getClass())){
			WebMarkupContainer control = new WebMarkupContainer(view.newChildId());
			view.addOrReplace(control);

			StringResourceModel stringResourceModel = new StringResourceModel("controls."+property+".label", this, getModel());
			stringResourceModel.setDefaultValue("Unknown");
			control.addOrReplace(new Label("label", stringResourceModel));
			control.addOrReplace(new LabelProperty("input", new PropertyModel<Object>(getModel(), property), renderers) {
				private static final long serialVersionUID = 8561120757563362569L;

				@Override
				protected String getResourceString(String key, String defaultValue) {
					return getLocalizer().getStringIgnoreSettings("controls."+property+"."+key, CrudifierView.this, null, defaultValue);
				}
			});
		}
	}
	addOrReplace(view);
}
 
开发者ID:premium-minds,项目名称:wicket-crudifier,代码行数:24,代码来源:CrudifierView.java

示例15: createTreeRow

import org.apache.wicket.markup.repeater.RepeatingView; //导入依赖的package包/类
private WebMarkupContainer createTreeRow(final T node)
{
  final WebMarkupContainer row = new WebMarkupContainer(rowRepeater.newChildId(), new Model<TreeTableNode>(node));
  row.setOutputMarkupId(true);
  row.add(AttributeModifier.replace("class", "even"));
  if (clickRows == true) {
    WicketUtils.addRowClick(row);
  }
  rowRepeater.add(row);
  final RepeatingView colBodyRepeater = new RepeatingView("cols");
  row.add(colBodyRepeater);
  final String cssStyle = getCssStyle(node);

  // Column: browse icons
  final TreeIconsActionPanel< ? extends TreeTableNode> treeIconsActionPanel = createTreeIconsActionPanel(node);
  addColumn(row, treeIconsActionPanel, cssStyle);
  treeIconsActionPanel.init(this, node);
  treeIconsActionPanel.add(AttributeModifier.append("style", new Model<String>("white-space: nowrap;")));

  addColumns(colBodyRepeater, cssStyle, node);
  return row;
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:23,代码来源:DefaultTreeTablePanel.java


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