/** * 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; }
@Override protected void onConfigure() { super.onConfigure(); setEnabled(activeStepIndex > 0); }
@Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); if (activeStepIndex <= 0) tag.append("class", "disabled", " "); }
add(new ListView("movie_list", movies) { @Override protected void populateItem(ListItem item) { final Movie movie = (Movie) item.getModelObject(); Link link = new Link("movie_link") { @Override public void onClick() { setResponsePage(new MoviePage(movie)); } }; item.add(link); link.add(new Label("year", Integer.toString(movie.getYear()))); link.add(new Label("year", Integer.toString(movie.getYear()))); } });
unsortLink.setVisible(false); sortLink.setModelObject(unsortLink); unsortLink.setModelObject(sortLink);
@Override protected void populateItem(ListItem item) { File file = (File) item.getModelObject(); boolean last = item.getIndex() == getList().size() - 1; // the link to the current path item Label name = new Label("pathItem", file.getName() + "/"); Link link = new IndicatingAjaxFallbackLink("pathItemLink", item .getModel()) { @Override public void onClick(AjaxRequestTarget target) { pathItemClicked((File) getModelObject(), target); } }; link.add(name); item.add(link); link.setEnabled(!last); }
link.setOutputMarkupId(true); link.setEnabled(service.enabled); link.add(new AttributeModifier("title", true, new StringResourceModel(info.getDescriptionKey(), (Component) null, null))); link.add(new Label("link.label", new StringResourceModel(info.getTitleKey(), (Component) null, null))); link.add(image); item.add(link);
public HRListEntryPanel(final String id, final HRFilter filter, final BigDecimal plannedDays, final BigDecimal actualDays, final Link< ? > link) { super(id); final BigDecimal planned = filter.isShowPlanning() == true ? plannedDays : null; final BigDecimal actual = filter.isShowBookedTimesheets() == true ? actualDays : null; final Label plannedDaysLabel = new Label("plannedDays", NumberFormatter.format(planned, 2)); add(plannedDaysLabel.setRenderBodyOnly(true)); if (NumberHelper.isNotZero(plannedDays) == false) { plannedDaysLabel.setVisible(false); } add(link); final Label actualDaysLabel = new Label("actualDays", "(" + NumberFormatter.format(actual, 2) + ")"); link.add(actualDaysLabel.setRenderBodyOnly(true)); if (NumberHelper.isNotZero(actualDays) == false) { link.setVisible(false); } } }
/** * Without click support (neither for selection nor for editing). * @param id component id * @param model model for contact * @param label The label to show (additional to the row_pointer.png). The id of the label should be LABEL_ID. */ public TreeIconsActionPanel(final String id, final IModel< ? > model, final Label label, final TreeTable< ? > treeTable) { super(id, model); this.treeTable = treeTable; final Link<Void> selectLink = new Link<Void>("select") { @Override public void onClick() { // Do nothing }; }; selectLink.setVisible(false); this.link = selectLink; add(selectLink); add(label); }
@Override protected void onInitialize() { super.onInitialize(); }
@Override public void populateItem(final ListItem<SerializableResource> item) { final SerializableResource resource = (SerializableResource) item.getModelObject(); item.add(new Label("path", resource.getPath())); item.add(new ExternalLink("edit_resource", resource.getUri())); item.add(new Link<SerializableResource>("view_resource") { @Override public void onClick() { PageParameters pageParameters = new PageParameters(); pageParameters.add("uri", resource.getUri()); setResponsePage(ViewResource.class, pageParameters); } }); Link<SerializableResource> runLink = new Link<SerializableResource>("run_resource") { @Override public void onClick() { PageParameters pageParameters = new PageParameters(); pageParameters.add("uri", resource.getUri()); setResponsePage(RunResource.class, pageParameters); } }; runLink.setEnabled(resource.hasAncestors()); item.add(runLink); } }).setVersioned(false);
@Override protected void populateItem(ListItem<File> item) { File file = item.getModelObject(); boolean last = item.getIndex() == getList().size() - 1; // the link to the current path item Label name = new Label("pathItem", file.getName() + "/"); Link<File> link = new IndicatingAjaxFallbackLink<File>( "pathItemLink", item.getModel()) { private static final long serialVersionUID = 4295991386838610752L; @Override public void onClick(AjaxRequestTarget target) { pathItemClicked((File) getModelObject(), target); } }; link.add(name); item.add(link); link.setEnabled(!last); } });
link.setOutputMarkupId(true); link.setEnabled(service.enabled); link.add( new AttributeModifier( "title", (Component) null, null))); link.add( new Label( "link.label", "alt", new ParamResourceModel(info.getTitleKey(), null))); link.add(image); item.add(link);
@Override public void onClick() { Vector obj = (Vector) model.getObject(); obj.clear(); obj.addAll(allStatusList); model.setObject(obj); moreComponent.setVisible(false); getModelObject().setVisible(true); setVisible(false); } };
@Override protected void onInitialize() { super.onInitialize(); add(new Label("label", new AbstractReadOnlyModel<String>() { @Override public String getObject() { PullRequest request = getPullRequest(); return "#" + request.getNumber() + " - " + request.getTitle(); } })); }
unsortLink.setVisible(false); sortLink.setModelObject(unsortLink); unsortLink.setModelObject(sortLink);
public void addLinkAttribute(String attribute, String value) { link.add(new AttributeAppender(attribute, value)); } }
showTimesheetsLink.setEnabled(linkEnabled); add(showTimesheetsLink); final WebMarkupContainer bar = new WebMarkupContainer("bar"); showTimesheetsLink.add(bar); bar.add(progressLabel);
@Override protected void onConfigure() { super.onConfigure(); setVisible(SecurityUtils.isAdministrator() && !orphanProjectsModel.getObject().isEmpty()); }
@Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("target", target.getObject()); }