List of usage examples for org.apache.wicket.markup.html.link ExternalLink ExternalLink
public ExternalLink(final String id, final IModel<String> href, final IModel<?> label)
From source file:at.ait.dme.yuma.suite.framework.pages.audio.AudioExamplePage.java
License:EUPL
public AudioExamplePage(final PageParameters parameters) { super("YUMA Audio Annotation - Examples", parameters); // TODO add links to sample material! List<AudioExampleLink> links = new ArrayList<AudioExampleLink>(); add(new ListView<AudioExampleLink>("links", links) { private static final long serialVersionUID = 2565049376850724577L; @Override/*from ww w .j a v a 2 s . c om*/ protected void populateItem(ListItem<AudioExampleLink> item) { AudioExampleLink link = item.getModelObject(); item.add(new ExternalLink("link", link.href, link.label)); } }); }
From source file:at.ait.dme.yuma.suite.framework.pages.image.ImageExamplePage.java
License:EUPL
public ImageExamplePage(final PageParameters parameters) { super("YUMA Image Annotation - Examples", parameters); List<ImageExampleLink> links = new ArrayList<ImageExampleLink>(); links.add(new ImageExampleLink("Perth", "../image?objectURI=http://www.destination360.com/australia-south-pacific/australia/images/s/australia-perth.jpg")); links.add(new ImageExampleLink("Sample from Swedish National Heritage Board", "../image?objectURI=" + YUMASuite.getBaseUrl(getWebRequestCycle().getWebRequest().getHttpServletRequest()) + "images/samples/snhb-sample.jpg")); add(new ListView<ImageExampleLink>("links", links) { private static final long serialVersionUID = 2565049376850724577L; @Override//from www .j av a2 s. com protected void populateItem(ListItem<ImageExampleLink> item) { ImageExampleLink link = item.getModelObject(); item.add(new ExternalLink("link", link.href, link.label)); } }); }
From source file:at.ait.dme.yuma.suite.framework.pages.map.MapExamplePage.java
License:EUPL
public MapExamplePage(final PageParameters parameters) { super("YUMA Map Annotation - Examples", parameters); List<MapExampleLink> links = new ArrayList<MapExampleLink>(); links.add(new MapExampleLink("Map of Upper Austria", "../map?objectURI=http://upload.wikimedia.org/wikipedia/commons/4/49/Hirschvogel_Map_Austria.jpg")); links.add(new MapExampleLink("Ortelius World Map 1570", "../map?objectURI=" + YUMASuite.getBaseUrl(getWebRequestCycle().getWebRequest().getHttpServletRequest()) + "images/samples/OrteliusWorldMap1570.jpg")); add(new ListView<MapExampleLink>("links", links) { private static final long serialVersionUID = 2565049376850724577L; @Override//from w w w. j a v a 2 s . com protected void populateItem(ListItem<MapExampleLink> item) { MapExampleLink link = item.getModelObject(); item.add(new ExternalLink("link", link.href, link.label)); } }); }
From source file:at.ait.dme.yuma.suite.framework.pages.video.VideoExamplePage.java
License:EUPL
public VideoExamplePage(final PageParameters parameters) { super("YUMA Video Annotation - Examples", parameters); // TODO add links to sample material! List<VideoExampleLink> links = new ArrayList<VideoExampleLink>(); add(new ListView<VideoExampleLink>("links", links) { private static final long serialVersionUID = 2565049376850724577L; @Override/*from ww w . ja v a 2 s. c o m*/ protected void populateItem(ListItem<VideoExampleLink> item) { VideoExampleLink link = item.getModelObject(); item.add(new ExternalLink("link", link.href, link.label)); } }); }
From source file:at.molindo.wicketutils.utils.WicketUtils.java
License:Apache License
public static AbstractLink getBookmarkableRefererLink(final String id, final IModel<String> labelModel) { final String referer = getReferer(); if (referer == null) { return null; }/*from w w w .jav a 2 s .c o m*/ try { if (isBookmarkableRequest(new URL(referer))) { return new ExternalLink(id, new Model<String>(referer), labelModel); } } catch (final MalformedURLException e) { log.warn("malformed referer url: " + referer + " (" + e.toString() + ")"); } return null; }
From source file:au.org.theark.report.web.component.viewReport.ReportOutputPanel.java
License:Open Source License
public void initialisePanel() { downloadReportLink = new ExternalLink("linkToReport", "", ""); downloadReportLink.setOutputMarkupPlaceholderTag(true); // allow link to be replaced even when invisible add(downloadReportLink);//from ww w . jav a 2 s .c o m otherIDLink = new ExternalLink("otherIDLink", "", ""); otherIDLink.setOutputMarkupPlaceholderTag(true); add(otherIDLink); this.setVisible(false); // start off invisible }
From source file:au.org.theark.report.web.component.viewReport.ReportOutputPanel.java
License:Open Source License
public void setReportResource(JRResource reportResource) { if (reportResource != null) { ResourceLink<Void> newLink = new ResourceLink<Void>("linkToReport", reportResource); newLink.setOutputMarkupPlaceholderTag(true); // allow link to be replaced even when invisible addOrReplace(newLink);//from www . j a v a 2s.c om downloadReportLink = newLink; } else { if (!downloadReportLink.getClass().equals(ExternalLink.class)) { ExternalLink newLink = new ExternalLink("linkToReport", "", ""); newLink.setOutputMarkupPlaceholderTag(true); // allow link to be replaced even when invisible addOrReplace(newLink); downloadReportLink = newLink; } } }
From source file:au.org.theark.report.web.component.viewReport.ReportOutputPanel.java
License:Open Source License
public void setOtherIDReportResource(JRResource resource) { if (resource != null) { ResourceLink<Void> newLink = new ResourceLink<Void>("otherIDLink", resource); newLink.setOutputMarkupPlaceholderTag(true); addOrReplace(newLink);//from www . ja v a 2 s . co m otherIDLink = newLink; } else { if (!otherIDLink.getClass().equals(ExternalLink.class)) { ExternalLink newLink = new ExternalLink("otherIDLink", "", ""); newLink.setOutputMarkupPlaceholderTag(true); // allow link to be replaced even when invisible addOrReplace(newLink); otherIDLink = newLink; } } }
From source file:ch.tkuhn.nanobrowser.AgentPage.java
License:Open Source License
public AgentPage(final PageParameters parameters) { agent = new AgentElement(parameters.get("uri").toString()); boolean isBot = agent.isBot(); update();// w ww.ja v a 2 s. co m add(new MenuBar("menubar")); WebMarkupContainer icon = new WebMarkupContainer("icon"); if (isBot) { icon.add(new AttributeModifier("src", new Model<String>("icons/bot.svg"))); } add(icon); add(new Label("title", agent.getName())); add(new ExternalLink("uri", agent.getURI(), agent.getTruncatedURI())); add(new HList("typelist", agent.getTypes(), "Types")); if (isBot) { add(new HList("commanderlist", agent.getCommanders(), "Commanders")); } else { add(new WebMarkupContainer("commanderlist")); } add(new VList("nanopublist", nanopubModel, "Nanopublications")); add(new Label("emptyopinions", opinionModel.getObject().isEmpty() ? "(nothing)" : "")); add(new ListView<Opinion>("opinions", opinionModel) { private static final long serialVersionUID = -4257147575068849793L; protected void populateItem(ListItem<Opinion> item) { item.add(new Label("opinion", Opinion.getVerbPhrase(item.getModelObject().getOpinionType(), true))); item.add(new SentenceItem("opinionsentence", item.getModelObject().getSentence())); item.add(new NanopubItem("opinionpub", item.getModelObject().getNanopub(), ThingElement.TINY_GUI_ITEM)); } }); WebMarkupContainer aa = new WebMarkupContainer("adminactions"); if (NanobrowserApplication.isInDevelopmentMode()) { Link<Object> thatsmeButton; aa.add(thatsmeButton = new Link<Object>("thatsme") { private static final long serialVersionUID = 8608371149183694875L; public void onClick() { NanobrowserSession.get().setUser(agent); update(); setResponsePage(AgentPage.class, getPageParameters()); } }); thatsmeButton.setVisible(!isBot); } else { aa.add(new AttributeModifier("class", new Model<String>("hidden"))); aa.add(new Label("thatsme", "")); } add(aa); }
From source file:ch.tkuhn.nanobrowser.NanopubPage.java
License:Open Source License
public NanopubPage(final PageParameters parameters) { pub = new NanopubElement(parameters.get("uri").toString()); add(new MenuBar("menubar")); WebMarkupContainer icon = new WebMarkupContainer("icon"); if (pub.isValid()) { icon.add(new AttributeModifier("src", new Model<String>("icons/nanopubv.svg"))); }/*w w w . j ava2 s .co m*/ add(icon); add(new Label("title", pub.getShortName())); add(new Link<Object>("trig") { private static final long serialVersionUID = 4680516569316406945L; @SuppressWarnings("deprecation") public void onClick() { throw new RedirectToUrlException("./trig?uri=" + URLEncoder.encode(pub.getURI())); } }); add(new Link<Object>("xml") { private static final long serialVersionUID = 4680516569316406945L; @SuppressWarnings("deprecation") public void onClick() { throw new RedirectToUrlException("./xml?uri=" + URLEncoder.encode(pub.getURI())); } }); add(new Link<Object>("nq") { private static final long serialVersionUID = 4680516569316406945L; @SuppressWarnings("deprecation") public void onClick() { throw new RedirectToUrlException("./nq?uri=" + URLEncoder.encode(pub.getURI())); } }); add(new ExternalLink("uri", pub.getURI(), pub.getTruncatedURI())); add(new HList("typelist", pub.getTypes(), "Types")); String dateString = pub.getCreateDateString(); if (dateString == null) { add(new Label("dateempty", "(unknown)")); add(new Label("date", "")); } else { add(new Label("dateempty", "")); add(new Label("date", dateString)); } add(new HList("authorlist", pub.getAuthors(), "Authors")); add(new HList("creatorlist", pub.getCreators(), "Creator")); List<SentenceElement> sentass = pub.getSentenceAssertions(); if (sentass.size() > 0) { add(new VList("sentencelist", sentass, "Assertion as sentence")); } else { add(new Label("sentencelist", "")); } List<Triple<?, ?>> ass = pub.getAssertionTriples(); if (ass.size() > 0) { String assUri = pub.getNanopub().getAssertionUri().stringValue(); String note = null; if (!pub.hasCompleteFormalAssertionQuery()) note = "(incomplete)"; add(new VList("asslist", TripleStoreAccess.sortTriples(ass), "Assertion as formula", assUri, note)); } else { add(new Label("asslist", "")); } List<Triple<?, ?>> prov = pub.getProvenanceTriples(); if (prov.size() > 0) { add(new VList("provlist", TripleStoreAccess.sortTriples(prov), "Provenance", pub.getURI())); } else { add(new Label("provlist", "")); } List<Opinion> opinions = pub.getOpinions(true); add(new Label("emptyopinions", opinions.isEmpty() ? "(nothing)" : "")); add(new ListView<Opinion>("opinions", opinions) { private static final long serialVersionUID = 6804591967140101102L; protected void populateItem(ListItem<Opinion> item) { item.add(new AgentItem("opinionagent", item.getModelObject().getAgent())); item.add(new Label("opinion", Opinion.getVerbPhrase(item.getModelObject().getOpinionType(), false) + ".")); item.add(new NanopubItem("opinionpub", item.getModelObject().getNanopub(), ThingElement.TINY_GUI_ITEM)); } }); WebMarkupContainer aa = new WebMarkupContainer("adminactions"); if (NanobrowserApplication.isInDevelopmentMode()) { aa.add(new Link<Object>("delete") { private static final long serialVersionUID = 8608371149183694875L; public void onClick() { pub.delete(); MainPage.resetLists(); setResponsePage(MainPage.class); } }); } else { aa.add(new AttributeModifier("class", new Model<String>("hidden"))); aa.add(new Label("delete", "")); } add(aa); }