## Class TTextHighlighter

Description

TTextHighlighter class.

TTextHighlighter does syntax highlighting its body content, including static text and rendering results of child controls. You can set Language to specify what kind of syntax the body content is. Currently, TTextHighlighter supports the following languages: 'php','prado','css','html','javascript' and 'xml', where 'prado' refers to PRADO template syntax. By setting ShowLineNumbers to true, the highlighted result may be shown with line numbers.

- since: 3.0
- version: $Id: TTextHighlighter.php 1398 2006-09-08 19:31:03Z xue $
- author: Wei Zhuo<weizhuo[at]gmail[dot]com>

Located in /Web/UI/WebControls/TTextHighlighter.php (line 35)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TWebControl
                |
                --TTextProcessor
                   |
                   --TTextHighlighter

Direct descendents

Class | Description
--- | ---
TMarkdown | TMarkdown class

Method Summary
boolean getEnableCopyCode ()
string getHeaderTemplate ()
string getLanguage ()
boolean getShowLineNumbers ()
string getTagName ()
void onPreRender (THtmlWriter $writer)
string processText (string $text)
void registerHighlightScripts ()
void setEnableCopyCode (boolean $value)
void setLanguage (string $value)
void setShowLineNumbers (boolean $value)
Methods
getEnableCopyCode (line 83)

- return: true will show "Copy Code" link. Defaults to false.
- access: public

boolean getEnableCopyCode ()
getHeaderTemplate (line 146)

- return: header template with "Copy code" link.
- access: protected

string getHeaderTemplate ()
getLanguage (line 48)

- return: language whose syntax is to be used for highlighting. Defaults to 'php'.
- access: public

string getLanguage ()
getShowLineNumbers (line 67)

- return: whether to show line numbers in the highlighted result.
- access: public

boolean getShowLineNumbers ()
getTagName (line 40)

- return: tag name of the panel
- access: protected

string getTagName ()

Redefinition of:

TWebControl::getTagName()
  Returns the tag name used for this control.

onPreRender (line 101)

Registers css style for the highlighted result.

This method overrides parent implementation.

- access: public

void onPreRender (THtmlWriter $writer)

- THtmlWriter $writer: writer

Redefinition of:

TControl::onPreRender()
  This method is invoked when the control enters 'OnPreRender' stage.

processText (line 131)

Processes a text string.

This method is required by the parent class.

- return: the processed text result
- access: public

string processText (string $text)

- string $text: text string to be processed

Redefinition of:

TTextProcessor::processText()
  Processes a text string.

Redefined in descendants as:

- TMarkdown::processText() : Processes a text string.

registerHighlightScripts (line 111)

Register CSS stylesheet file and javascript file.

- access: protected
- throws: TConfigurationException if highlight.css file cannot be found

void registerHighlightScripts ()
setEnableCopyCode (line 91)

- access: public

void setEnableCopyCode (boolean $value)

- boolean $value: true to show the "Copy Code" link.

setLanguage (line 59)

- access: public

void setLanguage (string $value)

- string $value: language whose syntax is to be used for highlighting. Valid values are those file names (without suffix) that are contained in '3rdParty/geshi/geshi' (e.g. 'php','prado','css','html','javascript', 'xml'.)

setShowLineNumbers (line 75)

- access: public

void setShowLineNumbers (boolean $value)

- boolean $value: whether to show line numbers in the highlighted result.

#### Inherited Methods

Inherited From TTextProcessor

> TTextProcessor::addParsedObject()
> TTextProcessor::getText()
> TTextProcessor::processText()
> TTextProcessor::renderContents()
> TTextProcessor::setText()

Inherited From TWebControl

> TWebControl::addAttributesToRender()
> TWebControl::copyBaseAttributes()
> TWebControl::createStyle()
> TWebControl::getAccessKey()
> TWebControl::getBackColor()
> TWebControl::getBorderColor()
> TWebControl::getBorderStyle()
> TWebControl::getBorderWidth()
> TWebControl::getCssClass()
> TWebControl::getFont()
> TWebControl::getForeColor()
> TWebControl::getHasStyle()
> TWebControl::getHeight()
> TWebControl::getStyle()
> TWebControl::getTabIndex()
> TWebControl::getTagName()
> TWebControl::getToolTip()
> TWebControl::getWidth()
> TWebControl::render()
> TWebControl::renderBeginTag()
> TWebControl::renderContents()
> TWebControl::renderEndTag()
> TWebControl::setAccessKey()
> TWebControl::setBackColor()
> TWebControl::setBorderColor()
> TWebControl::setBorderStyle()
> TWebControl::setBorderWidth()
> TWebControl::setCssClass()
> TWebControl::setForeColor()
> TWebControl::setHeight()
> TWebControl::setStyle()
> TWebControl::setTabIndex()
> TWebControl::setToolTip()
> TWebControl::setWidth()

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::addToPostDataLoader()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::bubbleEvent()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::createChildControls()
> TControl::createControlCollection()
> TControl::dataBind()
> TControl::dataBindChildren()
> TControl::dataBindProperties()
> TControl::ensureChildControls()
> TControl::findControl()
> TControl::findControlsByID()
> TControl::findControlsByType()
> TControl::focus()
> TControl::getAdapter()
> TControl::getAllowChildControls()
> TControl::getAttribute()
> TControl::getAttributes()
> TControl::getChildControlsCreated()
> TControl::getClientID()
> TControl::getControls()
> TControl::getControlStage()
> TControl::getControlState()
> TControl::getCustomData()
> TControl::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasChildInitialized()
> TControl::getHasControls()
> TControl::getHasInitialized()
> TControl::getHasLoaded()
> TControl::getHasLoadedPostData()
> TControl::getHasPreRendered()
> TControl::getID()
> TControl::getNamingContainer()
> TControl::getPage()
> TControl::getParent()
> TControl::getRegisteredObject()
> TControl::getSkinID()
> TControl::getSourceTemplateControl()
> TControl::getTemplateControl()
> TControl::getUniqueID()
> TControl::getViewState()
> TControl::getVisible()
> TControl::hasAttribute()
> TControl::initRecursive()
> TControl::isDescendentOf()
> TControl::isObjectRegistered()
> TControl::loadRecursive()
> TControl::loadState()
> TControl::loadStateRecursive()
> TControl::onDataBinding()
> TControl::onInit()
> TControl::onLoad()
> TControl::onPreRender()
> TControl::onUnload()
> TControl::preRenderRecursive()
> TControl::raiseBubbleEvent()
> TControl::registerObject()
> TControl::removeAttribute()
> TControl::removedControl()
> TControl::render()
> TControl::renderChildren()
> TControl::renderControl()
> TControl::saveState()
> TControl::saveStateRecursive()
> TControl::setAdapter()
> TControl::setAttribute()
> TControl::setChildControlsCreated()
> TControl::setControlStage()
> TControl::setControlState()
> TControl::setCustomData()
> TControl::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> TControl::traverseChildControls()
> TControl::unbindProperty()
> TControl::unloadRecursive()
> TControl::unregisterObject()
> TControl::__get()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Class Constants

#### Inherited Constants

Inherited from TControl

> TControl::AUTOMATIC_ID_PREFIX
> TControl::CLIENT_ID_SEPARATOR
> TControl::CS_CHILD_INITIALIZED
> TControl::CS_CONSTRUCTED
> TControl::CS_INITIALIZED
> TControl::CS_LOADED
> TControl::CS_PRERENDERED
> TControl::CS_STATE_LOADED
> TControl::ID_FORMAT
> TControl::ID_SEPARATOR
> TControl::IS_CHILD_CREATED
> TControl::IS_CREATING_CHILD
> TControl::IS_DISABLE_THEMING
> TControl::IS_DISABLE_VIEWSTATE
> TControl::IS_ID_SET
> TControl::IS_SKIN_APPLIED
> TControl::IS_STYLESHEET_APPLIED
> TControl::RF_ADAPTER
> TControl::RF_AUTO_BINDINGS
> TControl::RF_CHILD_STATE
> TControl::RF_CONTROLS
> TControl::RF_CONTROLSTATE
> TControl::RF_DATA_BINDINGS
> TControl::RF_EVENTS
> TControl::RF_NAMED_CONTROLS
> TControl::RF_NAMED_CONTROLS_ID
> TControl::RF_NAMED_OBJECTS
> TControl::RF_SKIN_ID

Documentation generated on Sun, 14 Jan 2007 21:44:46 -0500 by phpDocumentor 1.3.0RC4