ccc.client.gwt.widgets
Class CodeMirrorEditor

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by ccc.client.gwt.widgets.CodeMirrorEditor
All Implemented Interfaces:
com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener

public class CodeMirrorEditor
extends com.google.gwt.user.client.ui.Composite

Wrapper class for CodeMirror.

Author:
Civic Computing Ltd.

Nested Class Summary
static interface CodeMirrorEditor.EditorListener
          Listener for editor events.
static class CodeMirrorEditor.Type
          Type of the editor.
 
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
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
CodeMirrorEditor(java.lang.String id, CodeMirrorEditor.EditorListener bus, CodeMirrorEditor.Type type, boolean readOnly)
          Constructor.
 
Method Summary
 java.lang.String getEditorCode()
          Accessor for editor content.
 CodeMirrorEditor.Type getType()
          Accessor for editor type.
 com.google.gwt.core.client.JavaScriptObject initCodeMirror(CodeMirrorEditor obj, java.lang.String id, java.lang.String baseUrl, boolean readOnly)
          Initialises CodeMirror editor.
 boolean isReady()
          Returns true if editor is ready.
 void onInitialized()
          Sets ready status and send an event.
protected  void onLoad()
          
 com.extjs.gxt.ui.client.widget.form.RadioGroup parserSelector(UIConstants constants)
          Creates populated RadioGroup for parser selection.
 void setEditorCode(java.lang.String code)
          Mutator for editor content.
 void setEditorHeight(java.lang.String height)
          Set editor wrapper height.
 void setParser(java.lang.String parser)
          Set parser for the editor.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, 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, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CodeMirrorEditor

public CodeMirrorEditor(java.lang.String id,
                        CodeMirrorEditor.EditorListener bus,
                        CodeMirrorEditor.Type type,
                        boolean readOnly)
Constructor.

Parameters:
id - The ID of the editor.
bus - The event bus.
type - The of the editor.
readOnly - The editor read only value for the config.
Method Detail

getType

public CodeMirrorEditor.Type getType()
Accessor for editor type.

Returns:
The type.

parserSelector

public com.extjs.gxt.ui.client.widget.form.RadioGroup parserSelector(UIConstants constants)
Creates populated RadioGroup for parser selection.

Parameters:
constants - UIConstants for labels.
Returns:
RadioGroup of possible parsers options.

onLoad

protected void onLoad()

Overrides:
onLoad in class com.google.gwt.user.client.ui.Widget

onInitialized

public void onInitialized()
Sets ready status and send an event.


isReady

public boolean isReady()
Returns true if editor is ready.

Returns:
Editor status.

initCodeMirror

public com.google.gwt.core.client.JavaScriptObject initCodeMirror(CodeMirrorEditor obj,
                                                                  java.lang.String id,
                                                                  java.lang.String baseUrl,
                                                                  boolean readOnly)
Initialises CodeMirror editor.

Parameters:
obj - The CodeMirrorEditor instance
id - The ID of the editor.
baseUrl - The base URL for scripts and css.
readOnly - The editor read only value for the config.
Returns:
The editor instance.

getEditorCode

public java.lang.String getEditorCode()
Accessor for editor content.

Returns:
The content of the editor.

setEditorCode

public void setEditorCode(java.lang.String code)
Mutator for editor content.

Parameters:
code - The content to set.

setParser

public void setParser(java.lang.String parser)
Set parser for the editor.

Parameters:
parser - Parser name like CSSParser.

setEditorHeight

public void setEditorHeight(java.lang.String height)
Set editor wrapper height.

Parameters:
height - The new height of the editor wrapping.


Copyright © 2010. All Rights Reserved.