@JavaScript(value={"client/js/ace/ace.js","client/js/ace/ext-searchbox.js","client/js/diff_match_patch.js"}) @StyleSheet(value="client/css/ace-gwt.css") public class AceEditor extends com.vaadin.v7.ui.AbstractField<String> implements com.vaadin.v7.event.FieldEvents.BlurNotifier, com.vaadin.v7.event.FieldEvents.FocusNotifier, com.vaadin.v7.event.FieldEvents.TextChangeNotifier
Modifier and Type | Class and Description |
---|---|
static class |
AceEditor.DiffEvent |
static interface |
AceEditor.DiffListener |
static class |
AceEditor.SelectionChangeEvent |
static interface |
AceEditor.SelectionChangeListener |
static class |
AceEditor.TextChangeEventImpl |
com.vaadin.v7.ui.AbstractField.FocusShortcut, com.vaadin.v7.ui.AbstractField.ReadOnlyStatusChangeEvent
com.vaadin.v7.ui.Field.ValueChangeEvent
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
com.vaadin.server.Sizeable.Unit
com.vaadin.v7.data.Buffered.SourceException
com.vaadin.v7.data.Property.Editor, com.vaadin.v7.data.Property.ReadOnlyException, com.vaadin.v7.data.Property.ReadOnlyStatusChangeListener, com.vaadin.v7.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.v7.data.Property.Transactional<T>, com.vaadin.v7.data.Property.ValueChangeListener, com.vaadin.v7.data.Property.ValueChangeNotifier, com.vaadin.v7.data.Property.Viewer
Constructor and Description |
---|
AceEditor() |
Modifier and Type | Method and Description |
---|---|
void |
addBlurListener(com.vaadin.event.FieldEvents.BlurListener listener) |
void |
addDiffListener(AceEditor.DiffListener listener) |
void |
addFocusListener(com.vaadin.event.FieldEvents.FocusListener listener) |
void |
addListener(com.vaadin.event.FieldEvents.BlurListener listener)
Deprecated.
|
void |
addListener(com.vaadin.event.FieldEvents.FocusListener listener)
Deprecated.
|
void |
addListener(com.vaadin.v7.event.FieldEvents.TextChangeListener listener)
Deprecated.
|
String |
addMarker(AceMarker marker)
Adds an ace marker.
|
String |
addMarker(AceRange range,
String cssClass,
AceMarker.Type type,
boolean inFront,
AceMarker.OnTextChange onChange)
Adds an ace marker with a generated id.
|
void |
addMarkerAnnotation(AceAnnotation ann,
AceMarker marker) |
void |
addMarkerAnnotation(AceAnnotation ann,
String markerId) |
void |
addRowAnnotation(AceAnnotation ann,
int row) |
void |
addSelectionChangeListener(AceEditor.SelectionChangeListener listener) |
void |
addTextChangeListener(com.vaadin.v7.event.FieldEvents.TextChangeListener listener) |
void |
beforeClientResponse(boolean initial) |
void |
clearMarkerAnnotations() |
void |
clearMarkers() |
void |
clearRowAnnotations() |
protected void |
clientChanged(TransportDiff diff,
TransportDoc.TransportRange selection,
boolean focused) |
int |
getCursorPosition() |
AceDoc |
getDoc() |
TextRange |
getSelection() |
protected AceEditorState |
getState() |
protected AceEditorState |
getState(boolean markAsDirty) |
Class<? extends String> |
getType() |
boolean |
isHighlightActiveLine() |
boolean |
isShowGutter() |
boolean |
isShowPrintMargin() |
void |
removeBlurListener(com.vaadin.event.FieldEvents.BlurListener listener) |
void |
removeDiffListener(AceEditor.DiffListener listener) |
void |
removeFocusListener(com.vaadin.event.FieldEvents.FocusListener listener) |
void |
removeListener(com.vaadin.event.FieldEvents.BlurListener listener)
Deprecated.
|
void |
removeListener(com.vaadin.event.FieldEvents.FocusListener listener)
Deprecated.
|
void |
removeListener(com.vaadin.v7.event.FieldEvents.TextChangeListener listener)
Deprecated.
|
void |
removeMarker(AceMarker marker) |
void |
removeMarker(String markerId) |
void |
removeSelectionChangeListener(AceEditor.SelectionChangeListener listener) |
void |
removeTextChangeListener(com.vaadin.v7.event.FieldEvents.TextChangeListener listener) |
void |
scrollToPosition(int pos)
Scrolls the to the given position (characters from the start of the file).
|
void |
scrollToRow(int row)
Scrolls to the given row.
|
void |
setBasePath(String path) |
void |
setCursorPosition(int pos)
Sets the cursor position to be pos characters from the beginning of the
text.
|
void |
setCursorRowCol(int row,
int col)
Sets the cursor on the given row and column.
|
void |
setDoc(AceDoc doc) |
void |
setHighlightActiveLine(boolean highlightActiveLine) |
protected void |
setInternalValue(String newValue) |
void |
setMode(AceMode mode) |
void |
setMode(String mode) |
void |
setModePath(String path) |
void |
setSelection(int start,
int end)
Sets the selection to be between characters [start,end).
|
void |
setSelectionRowCol(int startRow,
int startCol,
int endRow,
int endCol)
Sets the selection to be between the given (startRow,startCol) and
(endRow, endCol).
|
void |
setShowGutter(boolean showGutter) |
void |
setShowPrintMargin(boolean showPrintMargin) |
void |
setTextChangeEventMode(com.vaadin.v7.ui.AbstractTextField.TextChangeEventMode inputEventMode)
Sets the mode how the TextField triggers
FieldEvents.TextChangeEvent s. |
void |
setTextChangeTimeout(int timeoutMs)
The text change timeout modifies how often text change events are
communicated to the application when
setTextChangeEventMode(com.vaadin.v7.ui.AbstractTextField.TextChangeEventMode) is
AbstractTextField.TextChangeEventMode.LAZY or AbstractTextField.TextChangeEventMode.TIMEOUT . |
void |
setTheme(AceTheme theme) |
void |
setTheme(String theme) |
void |
setThemePath(String path) |
void |
setUseWorker(boolean useWorker) |
void |
setWordWrap(boolean ww) |
void |
setWorkerPath(String path) |
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, attach, clear, commit, detach, discard, fireReadOnlyStatusChange, fireValueChange, focus, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getCustomAttributes, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getTabIndex, getValidators, getValue, isBuffered, isEmpty, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isRequired, isValid, isValidationVisible, readDesign, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInvalidAllowed, setInvalidCommitted, setLocale, setPropertyDataSource, setReadOnly, setRequired, setRequiredError, setTabIndex, setValidationVisible, setValue, setValue, setValue, shouldHideErrors, validate, validate, valueChange, writeDesign
getExplicitImmediateValue, isImmediate, setImmediate
addContextClickListener, addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setParent, setPrimaryStyleName, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addListener, addStyleName, addStyleNames, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
public void addDiffListener(AceEditor.DiffListener listener)
public void addFocusListener(com.vaadin.event.FieldEvents.FocusListener listener)
addFocusListener
in interface com.vaadin.v7.event.FieldEvents.FocusNotifier
public void addBlurListener(com.vaadin.event.FieldEvents.BlurListener listener)
addBlurListener
in interface com.vaadin.v7.event.FieldEvents.BlurNotifier
@Deprecated public void addListener(com.vaadin.event.FieldEvents.BlurListener listener)
@Deprecated public void addListener(com.vaadin.event.FieldEvents.FocusListener listener)
@Deprecated public void addListener(com.vaadin.v7.event.FieldEvents.TextChangeListener listener)
public String addMarker(AceMarker marker)
marker
- public String addMarker(AceRange range, String cssClass, AceMarker.Type type, boolean inFront, AceMarker.OnTextChange onChange)
range
- cssClass
- type
- inFront
- onChange
- public void addMarkerAnnotation(AceAnnotation ann, AceMarker marker)
public void addMarkerAnnotation(AceAnnotation ann, String markerId)
public void addRowAnnotation(AceAnnotation ann, int row)
public void addSelectionChangeListener(AceEditor.SelectionChangeListener listener)
public void addTextChangeListener(com.vaadin.v7.event.FieldEvents.TextChangeListener listener)
addTextChangeListener
in interface com.vaadin.v7.event.FieldEvents.TextChangeNotifier
public void beforeClientResponse(boolean initial)
beforeClientResponse
in interface com.vaadin.server.ClientConnector
beforeClientResponse
in class com.vaadin.v7.ui.AbstractField<String>
public void clearMarkerAnnotations()
public void clearMarkers()
public void clearRowAnnotations()
public int getCursorPosition()
public AceDoc getDoc()
public TextRange getSelection()
public void removeDiffListener(AceEditor.DiffListener listener)
public void removeFocusListener(com.vaadin.event.FieldEvents.FocusListener listener)
removeFocusListener
in interface com.vaadin.v7.event.FieldEvents.FocusNotifier
public void removeBlurListener(com.vaadin.event.FieldEvents.BlurListener listener)
removeBlurListener
in interface com.vaadin.v7.event.FieldEvents.BlurNotifier
@Deprecated public void removeListener(com.vaadin.event.FieldEvents.BlurListener listener)
@Deprecated public void removeListener(com.vaadin.event.FieldEvents.FocusListener listener)
@Deprecated public void removeListener(com.vaadin.v7.event.FieldEvents.TextChangeListener listener)
public void removeMarker(AceMarker marker)
public void removeMarker(String markerId)
public void removeSelectionChangeListener(AceEditor.SelectionChangeListener listener)
public void removeTextChangeListener(com.vaadin.v7.event.FieldEvents.TextChangeListener listener)
removeTextChangeListener
in interface com.vaadin.v7.event.FieldEvents.TextChangeNotifier
public void setBasePath(String path)
public void setCursorPosition(int pos)
pos
- public void setCursorRowCol(int row, int col)
row
- starting from 0col
- starting from 0public void setDoc(AceDoc doc)
public void setMode(AceMode mode)
public void setMode(String mode)
public void setModePath(String path)
public void setSelection(int start, int end)
start
- end
- public void setSelectionRowCol(int startRow, int startCol, int endRow, int endCol)
startRow
- starting from 0startCol
- starting from 0endRow
- starting from 0endCol
- starting from 0public void setTextChangeEventMode(com.vaadin.v7.ui.AbstractTextField.TextChangeEventMode inputEventMode)
FieldEvents.TextChangeEvent
s.inputEventMode
- the new modeAbstractTextField.TextChangeEventMode
public void setTextChangeTimeout(int timeoutMs)
setTextChangeEventMode(com.vaadin.v7.ui.AbstractTextField.TextChangeEventMode)
is
AbstractTextField.TextChangeEventMode.LAZY
or AbstractTextField.TextChangeEventMode.TIMEOUT
.timeoutMs
- the timeout in millisecondspublic void scrollToRow(int row)
public void scrollToPosition(int pos)
public void setTheme(AceTheme theme)
public void setTheme(String theme)
public void setThemePath(String path)
public void setUseWorker(boolean useWorker)
public void setWordWrap(boolean ww)
public void setShowGutter(boolean showGutter)
public boolean isShowGutter()
public void setShowPrintMargin(boolean showPrintMargin)
public boolean isShowPrintMargin()
public void setHighlightActiveLine(boolean highlightActiveLine)
public boolean isHighlightActiveLine()
public void setWorkerPath(String path)
protected void clientChanged(TransportDiff diff, TransportDoc.TransportRange selection, boolean focused)
protected AceEditorState getState()
getState
in class com.vaadin.v7.ui.AbstractField<String>
protected AceEditorState getState(boolean markAsDirty)
getState
in class com.vaadin.v7.ui.AbstractField<String>
Copyright © 2020 Magnolia International Ltd.. All rights reserved.