info.magnolia.cms.gui.dialog
Class DialogEditCode

java.lang.Object
  extended by info.magnolia.cms.gui.dialog.DialogControlImpl
      extended by info.magnolia.cms.gui.dialog.DialogBox
          extended by info.magnolia.cms.gui.dialog.DialogEditCode
All Implemented Interfaces:
DialogControl

public class DialogEditCode
extends DialogBox

Turns a textarea into a basic code editor using CodeMirror. If no language option is explicitly configured, it will try to guess the correct syntax highlighter by either looking at the resource extension or the mgnl:template metadata property. Defaults to a generic syntax parser which will highlight html, javascript and css.

Configuration options are:

KNOWN ISSUE: setting the control's width with the cols option currently does not work.

Version:
$Id$

Field Summary
static java.util.Map<java.lang.String,java.lang.String> availableParsers
          Valid values are js, javascript, processedJs, css, processedCss, html, freemarker, ftl, groovy, generic.
static java.lang.Long LINE_HEIGHT
          The editor line height in pixels.
 
Fields inherited from class info.magnolia.cms.gui.dialog.DialogBox
BOXTYPE_1COL, BOXTYPE_2COLS
 
Fields inherited from class info.magnolia.cms.gui.dialog.DialogControlImpl
DEFAULT_VALUE_PROPERTY, SESSION_ATTRIBUTENAME_DIALOGOBJECT, SESSION_ATTRIBUTENAME_DIALOGOBJECT_REMOVE, VALIDATION_PATTERN_PROPERTY, value
 
Constructor Summary
DialogEditCode()
           
 
Method Summary
 void drawHtml(java.io.Writer out)
          Actually draw the dialog content.
 
Methods inherited from class info.magnolia.cms.gui.dialog.DialogBox
drawHtmlPost, drawHtmlPre, getBoxType, getHtmlDescription, setBoxType
 
Methods inherited from class info.magnolia.cms.gui.dialog.DialogControlImpl
addOption, addSub, clearWebsiteNode, drawHtmlPostSubs, drawHtmlPreSubs, drawSubs, getConfigValue, getConfigValue, getDescription, getId, getLabel, getMessage, getMessage, getMessages, getName, getOptions, getParent, getRequest, getResponse, getStorageNode, getSub, getSubs, getTopParent, getValidationPattern, getValue, getValues, getWebsiteNode, init, isRequired, readValue, readValues, removeSessionAttribute, setConfig, setConfig, setConfig, setDescription, setLabel, setName, setOptions, setRequired, setSaveInfo, setSessionAttribute, setTopParent, setValidationMessage, setValue, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

availableParsers

public static final java.util.Map<java.lang.String,java.lang.String> availableParsers
Valid values are js, javascript, processedJs, css, processedCss, html, freemarker, ftl, groovy, generic.


LINE_HEIGHT

public static final java.lang.Long LINE_HEIGHT
The editor line height in pixels.

Constructor Detail

DialogEditCode

public DialogEditCode()
Method Detail

drawHtml

public void drawHtml(java.io.Writer out)
              throws java.io.IOException
Description copied from interface: DialogControl
Actually draw the dialog content.

Specified by:
drawHtml in interface DialogControl
Overrides:
drawHtml in class DialogControlImpl
Parameters:
out - Writer
Throws:
java.io.IOException - exceptions thrown when writing to the Writer can be safely rethrown by the dialog
See Also:
DialogControl.drawHtml(Writer)


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.