/**
* Copyright (C) cedarsoft GmbH.
*
* 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 com.cedarsoft.wicket.buttons;
import com.cedarsoft.wicket.WicketConstants;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.html.resources.StyleSheetReference;
import org.jetbrains.annotations.NonNls;
import javax.annotation.Nonnull;
/**
* <p/>
* Date: May 24, 2007<br>
* Time: 9:05:17 PM<br>
*/
//Todo add link provider
public class SexyButton extends Panel {
/**
* Creates a new sexy button
*
* @param id the id
* @param link the link (with ID "link")
* @param label the label of the button
*/
public SexyButton( @Nonnull @NonNls String id, @Nonnull String label, @Nonnull Link<?> link ) {
super( id );
if ( !link.getId().equals( "link" ) ) {
throw new IllegalArgumentException( "Link must have ID \"link\"" );
}
add( new StyleSheetReference( WicketConstants.ID_STYLE_SHEET, SexyButton.class, "SexyButton.css" ) );
add( link );
link.add( new Label( "label", label ) );
}
}