Class SyntaxHighlighter

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, Ordered, ScriptEventSupport, LifecycleElement, Widget, org.springframework.core.Ordered

public class SyntaxHighlighter extends WidgetBase
Widget that renders text syntax highlighted

The widget renders a div with a header. In the div the source code text will be added in pre tags with the specified plugin class that is needed for the plugin to alter the text.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • SyntaxHighlighter

      public SyntaxHighlighter()
  • Method Details

    • getHeader

      public Header getHeader()
    • setHeader

      public void setHeader(Header header)
    • getSourceCode

      public String getSourceCode()
      The text to render with syntax highlighting
      Returns:
      String
    • setSourceCode

      public void setSourceCode(String sourceCode)
      Setter for the source code text
      Parameters:
      sourceCode -
    • getPluginCssClass

      public String getPluginCssClass()
      The class that will be set on the pre tags

      The class is used by the prettify plugin to identify text to highlight and to specify type of highlighting.

      Returns:
      String
    • setPluginCssClass

      public void setPluginCssClass(String pluginCssClass)
      Setter for the plugin css class
      Parameters:
      pluginCssClass -
    • isAllowCopy

      public boolean isAllowCopy()
      Indicates if the ZeroClipboard copy functionality must be added

      When copy is allowed a copy button will be shown when the mouse hovers over the syntax highlighter. This button will be hidden the otherwise to avoid obstructing some of the displayed code.

      Returns:
      boolean
    • setAllowCopy

      public void setAllowCopy(boolean allowCopy)
      Setter for the allow copy flag
      Parameters:
      allowCopy -
    • isShowCopyConfirmation

      public boolean isShowCopyConfirmation()
      Indicates if a confirmation dialog must be shown after copy action
      Returns:
      boolean
    • setShowCopyConfirmation

      public void setShowCopyConfirmation(boolean showCopyConfirmation)
      Setter for the show copy confirmation dialog flag
      Parameters:
      showCopyConfirmation -