|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.ComplexPanel
com.google.gwt.user.client.ui.HTMLPanel
com.github.gwtbootstrap.client.ui.CodeBlock
public class CodeBlock
Block of Code with syntax highlighting.
Line breaks have to be escaped with "\n".
All arguments are optional.<b:CodeBlock linenums="true">
public class Person { \n \n private final String name;\n private final int age;\n }</b:CodeBlock>
Code
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel |
---|
IndexedPanel.ForIsWidget |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets |
---|
HasWidgets.ForIsWidget |
Field Summary |
---|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
CodeBlock()
Creates an empty widget. |
|
CodeBlock(String content)
Creates a widget with the content set. |
Method Summary | |
---|---|
String |
getHTML()
|
String |
getText()
|
protected void |
onLoad()
|
void |
setHTML(String html)
Sets the widget's text. |
void |
setLang(String programmingLanguage)
Sets the programming language. |
void |
setLinenums(boolean linenums)
Sets whether line numbers are shown. |
void |
setScrollable(boolean scrollable)
Sets whether the widget should be restricted to a maximum height of 350 px with y-axis scrollbars enabled. |
void |
setText(String text)
|
Methods inherited from class com.google.gwt.user.client.ui.HTMLPanel |
---|
add, add, add, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, createUniqueId, getElementById, wrap |
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel |
---|
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
---|
add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, remove |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CodeBlock()
public CodeBlock(String content)
content
- the content of the widgetMethod Detail |
---|
public void setScrollable(boolean scrollable)
scrollable
- true
to show scrollbars. Default:
false
public void setLinenums(boolean linenums)
linenums
- true
to show line numbers. Default:
false
public String getHTML()
getHTML
in interface HasHTML
public void setHTML(String html)
Any HTML content is escaped and displayed as text.
setHTML
in interface HasHTML
html
- the text to be setpublic String getText()
getText
in interface HasText
public void setText(String text)
setText
in interface HasText
public void setLang(String programmingLanguage)
setLang
in interface HasProgrammingLanguage
programmingLanguage
- the programming languageprotected void onLoad()
onLoad
in class Widget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |