| | |
| | | */
|
| | | 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.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 {
|
| | |
| | | link.add(new Label("label", labelModel));
|
| | | 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));
|
| | | }
|
| | |
|
| | | }
|