@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); }
@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); } });
showTimesheetsLink.setEnabled(linkEnabled); add(showTimesheetsLink); final WebMarkupContainer bar = new WebMarkupContainer("bar");
@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);
editLink.setEnabled(layer != null); editLink.setEnabled(layer != null);
link.setEnabled(service.enabled);
link.setEnabled(service.enabled);