diff options
Diffstat (limited to 'src/main/java/com/gitblit/wicket/panels/LinkPanel.java')
-rw-r--r-- | src/main/java/com/gitblit/wicket/panels/LinkPanel.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/LinkPanel.java b/src/main/java/com/gitblit/wicket/panels/LinkPanel.java index 06159ac3..aa09be09 100644 --- a/src/main/java/com/gitblit/wicket/panels/LinkPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/LinkPanel.java @@ -15,6 +15,9 @@ */
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;
@@ -26,8 +29,13 @@ import org.apache.wicket.markup.html.link.Link; 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 {
@@ -108,6 +116,20 @@ public class LinkPanel extends Panel { 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"));
|