/*
 * Copyright 2012 s_wolff.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.aegee.runanddine.util.forms;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;

/**
 * This class is an modified headline where the complete additional text is
 * rendered as link.
 *
 * @author s_wolff
 */
public class FurtherReadingHeadline extends Panel {

    private static final String ID_HEAD = "head";
    public static final String ID_LINK = "link";
    private static final String ID_LINK_TEXT = "linkText";

    /**
     * 
     * @param id the component markup id
     * @param headlineText the headline that shall be displayed
     * @param linkText the link text that shall be displayed
     * @param link the link
     */
    public FurtherReadingHeadline(String id, String headlineText, String linkText, Link link) {
        super(id);

        super.add(new Label(ID_HEAD, headlineText));
        link.add(new Label(ID_LINK_TEXT, "&rarrhk; " + linkText).setEscapeModelStrings(false));
        super.add(link);
    }
}
