|
|||||||||
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.gwtext.client.widgets.Component
com.gwtext.client.widgets.BoxComponent
com.gwtext.client.widgets.Container
com.gwtext.client.widgets.Panel
com.gwtext.client.widgets.HTMLPanel
com.gwtext.client.widgets.SyntaxHighlightPanel
public class SyntaxHighlightPanel
This class creates a Syntax Highlight panel for different languages, XML, and HTML for displaying. This class uses the syntaxhighlighter library found at: http://code.google.com/p/syntaxhighlighter/
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary | |
---|---|
static java.lang.String |
SYNTAX_CPP
|
static java.lang.String |
SYNTAX_CSHARP
|
static java.lang.String |
SYNTAX_CSS
|
static java.lang.String |
SYNTAX_DELPHI
|
static java.lang.String |
SYNTAX_HTML
|
static java.lang.String |
SYNTAX_JAVA
|
static java.lang.String |
SYNTAX_JAVASCRIPT
|
static java.lang.String |
SYNTAX_PASCAL
|
static java.lang.String |
SYNTAX_PHP
|
static java.lang.String |
SYNTAX_PYTHON
|
static java.lang.String |
SYNTAX_RUBY
|
static java.lang.String |
SYNTAX_SQL
|
static java.lang.String |
SYNTAX_VB
|
static java.lang.String |
SYNTAX_XML
|
Fields inherited from class com.gwtext.client.widgets.Component |
---|
config, id |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
SyntaxHighlightPanel()
Create a new SyntaxHighlightPanel. |
|
SyntaxHighlightPanel(java.lang.String code,
java.lang.String syntaxType)
Create a new SyntaxHighlightPanel. |
Method Summary | |
---|---|
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject config)
|
protected com.google.gwt.core.client.JavaScriptObject |
createJ(com.google.gwt.core.client.JavaScriptObject config)
|
void |
setCollapseAll(boolean collapseAll)
Method to collapse the code |
void |
setFirstLine(int firstLine)
Method to set what line to start showing |
void |
setHtml(java.lang.String code)
sets the code to the SyntaxHighlightPanel. |
void |
setShowColumns(boolean showColumns)
Method to show columns |
void |
setShowControls(boolean showControls)
Method to show controls |
void |
setShowGutter(boolean showGutter)
Method to show gutter |
protected java.lang.String |
setSyntaxHighlight()
This method is called internally to set the html to use the textarea with a specific name and classname for the library to use its specific css |
void |
updateHtml(java.lang.String html)
This method can be called after the component is rendered so that it can update the code |
void |
updateHtml(java.lang.String html,
java.lang.String syntaxType)
This method can be called after the component is rendered so that it can update the code |
Methods inherited from class com.gwtext.client.widgets.Container |
---|
add, add, add, add, addListener, bubble, cascade, clear, doLayout, doLayout, findBy, findByID, findByType, getActiveItem, getActiveItemID, getAutoDestroy, getBufferResize, getComponent, getComponent, getComponents, getHideBorders, getItems, getLayout, getMonitorResize, insert, iterator, remove, remove, remove, remove, removeAll, removeAll, setActiveItem, setActiveItemID, setAutoDestroy, setBufferResize, setDefaults, setHideBorders, setLayout, setMonitorResize |
Methods inherited from class com.gwtext.client.widgets.BoxComponent |
---|
addListener, doOnRender, doOnRender, getAutoHeight, getAutoWidth, getBox, getBox, getHeight, getPosition, getPosition, getSize, getWidth, setAutoHeight, setAutoWidth, setHeight, setHeight, setPagePosition, setPosition, setSize, setSize, setWidth, setWidth, syncSize, updateBox |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, setElement, setPixelSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SYNTAX_CPP
public static final java.lang.String SYNTAX_CSHARP
public static final java.lang.String SYNTAX_CSS
public static final java.lang.String SYNTAX_PASCAL
public static final java.lang.String SYNTAX_DELPHI
public static final java.lang.String SYNTAX_JAVA
public static final java.lang.String SYNTAX_JAVASCRIPT
public static final java.lang.String SYNTAX_PHP
public static final java.lang.String SYNTAX_PYTHON
public static final java.lang.String SYNTAX_RUBY
public static final java.lang.String SYNTAX_SQL
public static final java.lang.String SYNTAX_VB
public static final java.lang.String SYNTAX_XML
public static final java.lang.String SYNTAX_HTML
Constructor Detail |
---|
public SyntaxHighlightPanel()
public SyntaxHighlightPanel(java.lang.String code, java.lang.String syntaxType)
code
- the code to show in the panelsyntaxType
- is one of the available types:
Method Detail |
---|
public void setHtml(java.lang.String code)
setHtml
in class Panel
code
- is the code to display in the panelpublic void updateHtml(java.lang.String html, java.lang.String syntaxType)
html
- the code fragment to hightlightsyntaxType
- the syntax typepublic void updateHtml(java.lang.String html)
html
- the code fragment to hightlightprotected java.lang.String setSyntaxHighlight()
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
create
in class Panel
protected com.google.gwt.core.client.JavaScriptObject createJ(com.google.gwt.core.client.JavaScriptObject config)
public void setShowGutter(boolean showGutter)
showGutter
- true or false to show gutterpublic void setShowControls(boolean showControls)
showControls
- true or false to show controlspublic void setCollapseAll(boolean collapseAll)
collapseAll
- true or false to collapse or not the codepublic void setFirstLine(int firstLine)
firstLine
- integer of the line to show firstpublic void setShowColumns(boolean showColumns)
showColumns
- true or false to show columns or not
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |