Paul Martin
2016-03-23 caa660d97f95e4da66c9f7722267145ffe8e6d48
src/main/java/com/gitblit/wicket/panels/LinkPanel.java
@@ -15,6 +15,10 @@
 */
package com.gitblit.wicket.panels;
import java.io.OutputStream;
import java.util.concurrent.Callable;
import org.apache.wicket.Component;
import org.apache.wicket.PageParameters;
import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.markup.html.WebPage;
@@ -25,8 +29,13 @@
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.target.resource.ResourceStreamRequestTarget;
import org.apache.wicket.util.resource.AbstractResourceStreamWriter;
import org.apache.wicket.util.resource.IResourceStream;
import com.gitblit.models.UserModel;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.WicketUtils;
public class LinkPanel extends Panel {
@@ -107,4 +116,28 @@
      add(link);
   }
   public LinkPanel(String wicketId, String linkCssClass, String label, Link<?> link) {
      super(wicketId);
      this.labelModel = new Model<String>(label);
      if (linkCssClass != null) {
         link.add(new SimpleAttributeModifier("class", linkCssClass));
      }
      link.add(new Label("icon").setVisible(false));
      link.add(new Label("label", labelModel));
      add(link);
   }
   public void setNoFollow() {
      Component c = get("link");
      c.add(new SimpleAttributeModifier("rel", "nofollow"));
   }
   public void setTooltip(String tooltip) {
      Component c = get("link");
      c.add(new SimpleAttributeModifier("title", tooltip));
   }
}