/** * Sets a html attribute to the enclosed link. * @param attribute * @param label * @return this for chaining. */ public ListViewItemPanel addLinkAttribute(final String attribute, final String label) { link.add(AttributeModifier.replace(attribute, label)); return this; }
public void addLinkAttribute(String attribute, String value) { link.add(new AttributeAppender(attribute, value)); } }
protected void addSingleButton(ISupplier<Boolean> visibleSupplier) { Optional<RequirementData> findFirst = requirements.getObject().stream().findFirst(); if(findFirst.isPresent()){ Link<String> newButton = buildLink("_botao", labelModel, findFirst.get()); newButton.add($b.visibleIf(visibleSupplier)); this.add(newButton); } }
protected void addSingleButton(ISupplier<Boolean> visibleSupplier) { Optional<RequirementData> findFirst = requirements.getObject().stream().findFirst(); if(findFirst.isPresent()){ Link<String> newButton = buildLink("_botao", labelModel, findFirst.get()); newButton.add($b.visibleIf(visibleSupplier)); this.add(newButton); } }
@Override protected Link newPagingNavigationLink(String id, IPageable pageable, int pageNumber) { Link link = super.newPagingNavigationLink(id, pageable, pageNumber); // we turn the id into the css class link.add(new SimpleAttributeModifier("class", id)); return link; }
@Override protected Link newPagingNavigationIncrementLink(String id, IPageable pageable, int increment) { Link link = super.newPagingNavigationIncrementLink(id, pageable, increment); // we turn the id into the css class link.add(new SimpleAttributeModifier("class", id)); return link; }
protected void addSingleButton(ISupplier<Boolean> visibleSupplier) { Optional<SingularRequirement> findFirst = getRequirementsStream().findFirst(); if (findFirst.isPresent()) { Link<Void> newButton = buildLink("_botao", labelModel, findFirst.get()); newButton.add($b.visibleIf(visibleSupplier)); this.add(newButton); } }
public PageTabLink(String id, PageTab tab) { super(id); Link<?> pageLink = newLink("link", tab.getMainPageClass()); add(pageLink); pageLink.add(new Label("label", tab.getTitleModel())); }
public LinkPanel(String id) { super(id); // add link with label Link<Page> link = newLink("link"); link.add(newLabel("label")); add(link); }
public LinkPanel(String id) { super(id); // add link with label Link<Page> link = newLink("link"); link.add(newLabel("label")); add(link); }
@Override protected void onInitialize() { super.onInitialize(); Link<?> link = newLink("link", tab.getMainPageClass()); link.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", tab.getIconClass()))); link.add(new Label("text", tab.getTitleModel())); link.add(new Label("count", tab.getCount()).setVisible(tab.getCount()!=0)); add(link); }
@Override public void populateItem(Item<ICellPopulator<User>> cellItem, String componentId, IModel<User> rowModel) { User user = rowModel.getObject(); Fragment fragment = new Fragment(componentId, "nameFrag", UserListPage.this); Link<Void> link = new BookmarkablePageLink<Void>("link", UserProfilePage.class, UserProfilePage.paramsOf(user)); link.add(new UserAvatar("avatar", UserIdent.of(UserFacade.of(user)))); link.add(new Label("name", user.getName())); fragment.add(link); cellItem.add(fragment); } });
@Override public void populateItem(Item<ICellPopulator<ProjectFacade>> cellItem, String componentId, IModel<ProjectFacade> rowModel) { Fragment fragment = new Fragment(componentId, "projectFrag", ProjectListPanel.this); Project project = OneDev.getInstance(ProjectManager.class).load(rowModel.getObject().getId()); Link<Void> link = new ProjectLink("link", project); link.add(new ProjectAvatar("avatar", project)); link.add(new Label("name", project.getName())); fragment.add(link); cellItem.add(fragment); }
@Override public void populateItem(Item<ICellPopulator<Configuration>> cellItem, String componentId, IModel<Configuration> rowModel) { Fragment fragment = new Fragment(componentId, "nameFrag", ConfigurationListPage.this); Configuration configuration = rowModel.getObject(); Link<Void> link = new BookmarkablePageLink<Void>("link", ConfigurationEditPage.class, ConfigurationEditPage.paramsOf(configuration)); link.add(new Label("label", configuration.getName())); fragment.add(link); cellItem.add(fragment); }
@Override public void populateItem(Item<ICellPopulator<Milestone>> cellItem, String componentId, IModel<Milestone> rowModel) { Milestone milestone = rowModel.getObject(); Fragment fragment = new Fragment(componentId, "nameFrag", MilestoneListPage.this); Link<Void> link = new BookmarkablePageLink<Void>("link", MilestoneDetailPage.class, MilestoneDetailPage.paramsOf(milestone, null)); link.add(new Label("label", milestone.getName())); fragment.add(link); cellItem.add(fragment); } });
@Override protected void onInitialize() { super.onInitialize(); Link<Void> link = new ViewStateAwarePageLink<Void>("link", tab.getMainPageClass()); link.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", tab.getIconClass()))); link.add(new Label("label", tab.getTitleModel())); add(link); }
@Override protected void onInitialize() { super.onInitialize(); CodeComment comment = getModelObject(); PageParameters params = ProjectBlobPage.paramsOf(comment); Link<Void> link = new BookmarkablePageLink<Void>("link", ProjectBlobPage.class, params); link.add(new Label("label", comment.getMarkPos().getPath())); add(link); }
@Override protected void onInitialize() { super.onInitialize(); ProjectPage page = (ProjectPage) getPage(); Link<Void> link = new ViewStateAwarePageLink<Void>("link", tab.getMainPageClass(), ProjectPage.paramsOf(page.getProject())); link.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", tab.getIconClass()))); link.add(new Label("label", tab.getTitleModel())); add(link); }
@Override protected void onInitialize() { super.onInitialize(); GroupPage page = (GroupPage) getPage(); Link<Void> link = new ViewStateAwarePageLink<Void>("link", tab.getMainPageClass(), GroupPage.paramsOf(page.getGroup())); link.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", tab.getIconClass()))); link.add(new Label("label", tab.getTitleModel())); add(link); }
@Override protected void onInitialize() { super.onInitialize(); UserPage page = (UserPage) getPage(); Link<Void> link = new ViewStateAwarePageLink<Void>("link", tab.getMainPageClass(), UserPage.paramsOf(page.getUser())); link.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", tab.getIconClass()))); link.add(new Label("label", tab.getTitleModel())); add(link); }