001    /*
002     *  Copyright 2012 GWT-Bootstrap
003     *
004     *  Licensed under the Apache License, Version 2.0 (the "License");
005     *  you may not use this file except in compliance with the License.
006     *  You may obtain a copy of the License at
007     *
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     *
010     *  Unless required by applicable law or agreed to in writing, software
011     *  distributed under the License is distributed on an "AS IS" BASIS,
012     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     *  See the License for the specific language governing permissions and
014     *  limitations under the License.
015     */
016    package com.github.gwtbootstrap.client.ui;
017    
018    import com.google.gwt.user.client.ui.HasText;
019    
020    //@formatter:off
021    /**
022     * Link, used in a navigation context.
023     * 
024     * <p>
025     * <h3>UiBinder Usage:</h3>
026     * 
027     * <pre>
028     * {@code
029     * <b:NavList>
030     *     <b:NavHeader>I'm the Header</b:NavHeader>
031     *     <b:NavLink icon="PLANE">I'm a link to nowhere.</b:NavLink>
032     * </b:NavList>
033     * }
034     * </pre>
035     * All arguments are optional
036     * </p>
037     * 
038     * @since 2.0.4.0
039     * 
040     * @author Dominik Mayer
041     * @author ohashi keisuke
042     * 
043     * @see <a href="http://twitter.github.com/bootstrap/components.html#navbar">Bootstrap documentation (Navbar)</a>
044     * @see <a href="http://twitter.github.com/bootstrap/components.html#navs">Bootstrap documentation (Navs)</a>
045     * @see NavList
046     * @see WellNavList
047     * @see Dropdown
048     * @see Navbar
049     * @see ResponsiveNavbar
050     */
051    //@formatter:on
052    public class NavLink extends NavWidget implements HasText {
053    
054            /**
055             * Creates an empty widget.
056             */
057            public NavLink() {
058                    super();
059            }
060    
061            /**
062             * Creates an empty widget of given text.
063             * 
064             * @param text
065             *            text of the widget
066             */
067            public NavLink(String text) {
068                    super();
069                    setText(text);
070            }
071    
072            /**
073             * Creates an empty widget of given text and href.
074             * 
075             * @param text
076             *            text of the widget
077             * @param href
078             *            URL the link should point to
079             */
080            public NavLink(String text, String href) {
081                    super();
082                    setText(text);
083                    setHref(href);
084            }
085    }