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 */ 016package com.github.gwtbootstrap.client.ui; 017 018import com.github.gwtbootstrap.client.ui.base.HtmlWidget; 019import com.google.gwt.user.client.ui.HasText; 020import com.google.gwt.user.client.ui.HasWidgets; 021 022 023//@formatter:off 024/** 025 * Simple html paragraph widget. 026 * 027 * @since 2.0.4.0 028 * 029 * @author ohashi keisuke 030 * @author Dominik Mayer 031 */ 032//@formatter:on 033public class Paragraph extends HtmlWidget { 034 035 /** 036 * Creates an empty paragraph. 037 */ 038 public Paragraph() { 039 super("p"); 040 } 041 042 /** 043 * Creates a widget with the html set.. 044 * @param html content html 045 */ 046 public Paragraph(String html) { 047 super("p", html); 048 } 049 050 /** 051 * get Inner Text 052 * @return innter Text 053 */ 054 public String getText() { 055 return getElement().getInnerText(); 056 } 057 058 /** 059 * set Inner Text 060 * @param text set Text 061 */ 062 public void setText(String text) { 063 getElement().setInnerText(text); 064 } 065}