Git Product home page Git Product logo

vaadin-aceeditor's Introduction

Vaadin AceEditor

Ace code editor wrapped inside a TextArea-like Vaadin component.

Available as an add-on in Vaadin Directory.

NOTE

Unfortunately I (@ahn) currently don't have time to maintain this project. I can accept pull requests and put a new version to Vaadin Directory once in a while but not do much beyond that. If you'd like to be a more active maintainer, feel free to contact me.

From version 0.8.15 onwards this add-on requires Vaadin 8. Versions 0.7.0 - 0.8.14 are for Vaadin 7, and versions before that are for Vaadin 6. The "quick and brutal" port to Vaadin 8 by willtemperley.

  • Currently using version 1.1.9 of Ace.

This add-on is still in an experimental phase, interfaces etc. are subject to change.

Getting started

  1. Start a Vaadin 8 project.
  2. Get the AceEditor addon from Vaadin directory. Maven is recommended.
  3. Compile widgetset.
  4. See below for instructions on how to use the AceEditor component.

How to use

These instructions are for Vaadin 7 version of AceEditor.

Basics

AceEditor editor = new AceEditor();
editor.setValue("Hello world!");
layout.addComponent(editor);
// ...
String s = editor.getValue();

Mode & theme

Mode defines the programming language used in the editor. Theme is the appearance of the editor.

editor.setMode(AceMode.python);
editor.setTheme(AceTheme.eclipse);

// Use worker (if available for the current mode)
editor.setUseWorker(true);

NOTE: to be able to use workers, you must host the worker files on the same server (same-origin policy restriction.) See below.

Ace file paths

By default, Vaadin AceEditor gets the mode, theme and worker files from the ace-builds repository via rawgit.com. For example: mode-javascript.js. Currently using version 1.1.9 of Ace. The 1.2.x doesn't work (yet).

It's probably safer to host the mode&theme files yourself so that you can be sure that they're compatible with the main Ace file used by this editor.

To host the files on your own server, here's how:

First, get the ace dir from the Vaadin Directory download package. It contains the src-min-noconflict Ace files compatible with this addon. Copy the ace dir to location webapp/static/ace in your Vaadin application. The structure should look something like this:

webapp/
  META-INF/
  static/
    ace/
      mode-abap.js
      ...
  VAADIN/
  WEB-INF/

And have this in your web.xml:

<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/static/*</url-pattern>
</servlet-mapping>

Then, tell the editor to use the files in the location:

editor.setThemePath("/static/ace");
editor.setModePath("/static/ace");
editor.setWorkerPath("/static/ace");    
// or "/myapp/static/ace" depending on server configuration.

Now, Ace should read the theme/mode/worker files from your local server.

Other settings

editor.setWordWrap(false);
editor.setReadOnly(false);
editor.setShowInvisibles(false);
// TODO: more

Listeners

TextChangeListener
ed.addTextChangeListener(new TextChangeListener() {
    @Override
    public void textChange(TextChangeEvent event) {
        Notification.show("Text: " + event.getText());
    }
});
SelectionChangeListener
ed.addSelectionChangeListener(new SelectionChangeListener() {
    @Override
    public void selectionChanged(SelectionChangeEvent e) {
        int cursor = e.getSelection().getCursorPosition();
        Notification.show("Cursor at: " + cursor);
    }
});

Markers

Ace supports custom markers within the code. The marker appearance is defined by a css class.

String cssClass = "mymarker1";
TextRange range = editor.getSelection();    
AceMarker.Type type = AceMarker.Type.text; // text or line
boolean inFront = false; // whether in front or behind the text
AceMarker.OnTextChange onChange = AceMarker.OnTextChange.ADJUST;
String markerId = editor.addMarker(range, cssClass, type, inFront, onChange);
// ...
editor.removeMarker(markerId);

The cssClass must be defined in some css file, for example mymarkers.css:

.ace_marker-layer .mymarker1 {
    background: red;
	border-bottom: 2px solid black;
	position: absolute;
}

...and then use the file:

@StyleSheet("mymarkers.css")
public class MyUI extends UI {

The OnTextChange defines how the marker behaves when the editor text changes.

  • DEFAULT: stay in the original position. That's what Ace does by default.
  • ADJUST: adjust the marker position when text changes. For example, if a line is added before the marker, the marker is moved one line down, thus keeping its "logical" position within the text.
  • REMOVE: remove the marker on text change.

Annotations

Ace supports annotations, i.e little notes on the side of the editor.

Vaadin AceEditor has two types of Annotations: row annotations and marker annotations. Only one type of annotations is possible to be used on an AceEditor at a time.

Row annotations are standard Ace annotations that are added to a certain row and Ace handles their position from there on. (Their possibly changed positions can't be retrieved later from Ace, which is the cause for this two kinds of annotations mess in Vaadin AceEditor.)

Marker annotations are attached to a marker. If the marker changes position the annotation follows.

String msg = "Warning!!!";
AceAnnotation.Type type = AceAnnotation.Type.warning;
AceAnnotation ann = new AceAnnotation(msg, type);
if (rowAnnotations) {
    editor.addRowAnnotation(ann, 2);
}
else {
    String markerId = editor.addMarker(/*...*/);
    editor.addMarkerAnnotation(ann, markerId);
}
// ...
editor.clearRowAnnotations();
editor.clearMarkerAnnotations();

Suggestions

This addon also includes a SuggestionExtension for implementing a "suggester" that gives user a list of text suggestions after she presses Ctrl+Space in AceEditor. An example MySuggester implementation here. See the "suggestion demo" here.

new SuggestionExtension(new MySuggester()).extend(editor);

Compiling this project

To package and install the Vaadin AceEditor addon to your local Maven repository, run

cd aceeditor
mvn install

To run a demo application in http://localhost:8080

cd aceeditor-demo
mvn vaadin:compile jetty:run

To create an addon package that can be uploaded to Vaadin Directory

cd aceeditor
mvn clean package assembly:single

Build Status

Notes on implementation

Server-client communication

This addon uses diffs to communicate between the server-side and the client-side of the AceEditor component. That is, when a user types something, the whole text is not sent to the server, just some kind of diff from the old value to the new one. Similarly, diffs are sent if the value changes on the server. The addon utitlizes the diff-match-patch library along with the differential synchronization algorithm for communication.

Pros of this diff approach:

  • Less data to be sent between client and server.
  • The content of the editor can be changed concurrently on the server and on the client. This makes it possible to implement things like the "auto-correction demo" in the aceeditor demo (code of the server-side "auto-corrector" here). In the demo the value can be modified at the same time on the client and on the server without losing either modifications. Also, Google Docs style collaborative editor can be implemented on top of this.

Cons:

  • Requires more cpu, for computing the diffs etc. (There's a room for optimization in the current implementation.)
  • Complicates things...

Links

Related Projects

vaadin-aceeditor's People

Contributors

ahn avatar cmurch avatar davidef avatar jkubrynski avatar jreznot avatar kaismh avatar luenemam avatar neodobby avatar rob68 avatar willtemperley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vaadin-aceeditor's Issues

Editor autoresize -- how to enable it?

Hello

It's probably something stupid I'm overlooking, but I'm missing how to make the editor resize automatically when new text is entered or deleted, avoiding scrollbars. For now, I did a workaround by adding a listener (for ValueChangeEvent) and setting the height by hand, but it's ugly as hell -- it gets a very noticeable hiccup every time I add a new line.

I've tried the usual setHeightUndefined, setHeight(null), toyed a bit with the javascript. I just can't figure out what's needed. It even looks that this may be the usual behavior on javascript-only, since the AceEditor demos seem to do autoresize without any additional settings.

Any hint??
Marcond

Ace Demo does not prettify any source code

Hello,
I'm facing an issue that makes Ace Editor unable to prettify any kind of content (xml, json,...).
I was thinking that I'm doing thinks wrong so I tried to run the Ace Demo... Got the same issue: the source code is neither colored nor indented I tried to run the Ace Demo and got the same issue: the source code is neither colored nor indented (See bellow).
Any workaround? Is it a known issue?
Thanks for your help.
ace

setCursorPosition with setValue work incorrectly

(Moved from #7 discussion)

@marcelhallmann:
"""
Add a textfield and a button to the page and an listener to the button. Within the listener read the value from the textfield and call aceeditor.setCursorPosition().

To reproduce the behavior start the webapp and go to the page, but do not click in the aceeditor!
Type in 15.
When you click now onto the button, the second line will be selected, which is not correct, it should be the thrid line.
But, when you click into the aceeditor it works correctly (reload the page).

Here you see screenshots:
without clicking into the aceeditor
without_click

and with clicking into it
with_click
"""

Changing value directly takes more time than clearing the text first

I have an editor instance with the value "abc".
There are two buttons. Button 1 will set the value to "xyz", button 2 clears the value.
Just clicking button 1 takes more time (loading indicator is shown) than quickly clicking button 2 and than button 1. Any hints why that could be?

Problem with applying suggestions on selected text

When I select text and then select a suggestion, different things happen depending on the selection direction:

  • If I select from left to right (cursor is on the right side of selected text), the selected text is replaced by the suggestion. "Some|selected|text" -> "Somesuggestiontext"
  • If I select from right to left (cursor on the left side), the selected text is doubled after the suggestion and still selected. "Some|selected|text" -> "Somesuggestion|selectedselected|text"

NotSerializableException

Getting errors in tomcat logs about the AceClientRange not being serializable.

java.io.NotSerializableException: org.vaadin.aceeditor.client.AceClientRange

setCursorRowCol fires 2 events

Hello,

thanks for your great job. I found a bug. When the method setCursorRowCol is called, two SelectionChangedEvent are fired which cause my app to bug :)

Thanks

Adrien

Add Markers or annotations creates a new AceDoc and the undo buffer is lost

If you add any markers or annotations a new AceDoc is created, since it is new, there will be no undo.

Ex:
public AceDoc withRowAnnotations(Set ranns) {
return new AceDoc(text, markers, ranns, markerAnnotations);
}
Do we really need to create a new AceDoc? Since, keeping the undo and possibly other data is important

Problem with keybindings

Keybindings don't works as expected if you define an action handler for the UI:

public class SimpleUI extends UI
{
  @Override
  protected void init(VaadinRequest request)
  {
    AceEditor ace = new AceEditor();
    ace.setMode(AceMode.java);
    ace.setTheme(AceTheme.tomorrow_night_bright);
    ace.setValue("public void functional(String pValue)\n{\n}");

    HorizontalLayout hlayout = new HorizontalLayout(ace);

    setContent(hlayout);

    addActionHandler(new Handler()
    {
      public void handleAction(Action action, Object sender, Object target)
      {
        //Global default button handling
      }

      public Action[] getActions(Object target, Object sender)
      {
        return new Action[] {new ShortcutAction("ENTER", ShortcutAction.KeyCode.ENTER, null)};
      }
    });
  }
}

ACE editor doesn't insert a newline with this example.

Ace theme+mode+worker file locations?

Hi,

thank you for updating the aceeditor for vaadin7.
Maybe I found a bug:
When I have text in the AceEditor and set the cursor on a line, the whole line is not highlighted (as it has been in old vaadin6 version).

Bug? Or did i forget to set a needed option?

Is there a way to disable error messages in editor

I apologize for posting this here but I didn't know where else to post it.

Is there a way to remove the red error markers on the left side of the editor? I ask because my files are a combination of html and a special templating engine. So although the code is valid the editor is showing errors. Is there a way to disable the red x's showing errors?

Caret positioning manipulation

Current our work with AceEditor when insert text programatically is following:

private void insertTextInCursorPosition(final String textPart) {
    int position = editor.getCursorPosition();
    StringBuilder text = new StringBuilder(editor.getDoc().getText());
    text.insert(position, textPart);
    editor.setDoc(new AceDoc(text.toString()));
    editor.setCursorPosition(position + textPart.length());
}

we have problem that on next invocations of this method text is inserted in wrong position.

Scenario of these steps works well on standard Vaadin TextField component which has same ancestor with AceEditor and almost same API (at least in terms of caret positioning, value set etc)

Height = 0 in Vaadin 8.1.0rc1

For some reason, the editor does not seem to set a proper height (inside a VerticalLayout). Doing setHeight changes nothing, the editor is still 2px high, I cannot seem to resize it by any means.

AceEditor does not resize in child window

Hi, I have put AceEditor in a child window in this way:

    File f = new File("c:\temp\textfile.txt");
    Window w = new Window(f.getName());
    w.setWidth("800px");
    w.setHeight("480px");
    AceEditor ae = new AceEditor();
    ae.setSizeFull();
    VerticalLayout vl = new VerticalLayout();
    vl.setSizeFull();
    vl.setMargin(true);
    vl.addComponent(ae);
    w.setContent(vl);
    TextFileProperty tfp = new TextFileProperty(f);
    ae.setPropertyDataSource(tfp);
    ae.setWriteThrough(false);
    getWindow().addWindow(w);

When I resize the child window, the editable area of AceEditor stays the same.
If I put AceEditor in the main window, the resizing operation work as expected.

Thanks.

Stefano

Still getting the version range error when using the official maven artifact

Could you upload the fixed version of the addon?

Error:
Unable to get dependency information: Error in metadata for artifact 'org.vaadin:aceeditor:jar': Unable to parse version '[6.7.0,7.0.0.alpha1)' for dependency 'com.vaadin:vaadin:jar': Range defies version ordering: [6.7.0,7.0.0.alpha1)
org.vaadin:aceeditor:jar:0.3.0

PropertyDataSource not working correctly due to internal caching

Version 0.8.13

When you add the editor inside the constructor together with a Property and link this with the setPropertyDataSource, and later on in the Enter method you change the value of the property then the old value is still shown. This seems due to the setInternalValue inside the AceEditor class. A workaround is to call the attach() method on the editor after the value has changed inside the enter method. This calls (under the right circumstances) the setInternalValue again, and now the correct value is shown.

Sample Code, the editor opens with the word 'Placeholder'.:

public class Test extends VerticalLayout implements View {
String pValue;

public Test() {
    pValue = "Placeholder";
    AceEditor editor = new AceEditor();
    editor.setPropertyDataSource(new Property<String>() {

        @Override
        public String getValue() {
            return pValue;
        }

        @Override
        public void setValue(String newValue) throws com.vaadin.data.Property.ReadOnlyException {
            pValue = newValue;
        }

        @Override
        public Class<? extends String> getType() {
            return String.class;
        }

        @Override
        public boolean isReadOnly() {
            return false;
        }

        @Override
        public void setReadOnly(boolean newStatus) {
        }

    });
    addComponent(editor);
}

    @Override
    public void enter(ViewChangeEvent event) {
        pValue = "Enter!";
    }
}

Show Invicibles

could you make show Invicible option availible in next release

setEnabled(false) does not work

I have used this WrapperWidget for enabled support:

public class AceEditorWrapperWidget extends AceEditorWidget {
    private boolean enabled = true;
    private boolean readOnly = false;

    @Override
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);

        this.enabled = enabled;

        super.setReadOnly(!this.enabled || readOnly);
    }

    @Override
    public void setReadOnly(boolean readOnly) {
        this.readOnly = readOnly;

        super.setReadOnly(!this.enabled || readOnly);
    }
}

Soft Tabs and tab size

Would it be possible to support soft tabs and tabSize setting?

As we mainly use files with 2 space indentation it is very cumbersome to edit those files with ace editor with default values (using tabs instead of spaces with 1 tab = 4 spaces).

AceEditor not show hint

Vaadin 6.7.2, AceEditor 0.3.1
AceEditor not show hint.

AceEditor testField = new AceEditor();
testField.setDescription("HINT");

Markers are at wrong position after redraw.

When AceMarkerEditor is redrawn, such as on page refresh, Markers in the editor are on wrong positions if the text has changed.

That's because markers' positions are not updated on the server side currently. The text is. Thus, on a redraw the editor uses updated text but original, non-updated markers.

syntax highlighting and HTTPS

We use aceeditor vaadin plugin with syntax highlighting.

Over https syntax highlighting doesn't work. E.g. the browser blocks the following js script load over http (see browser error console)

Blocked loading mixed active content "http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/mode-sql.js" ...

The URL is hard coded and final in the class AceEditor.class (DEFAULT_ACE_PATH)

I think you could easily make this protocol-independant. By just removing the 'http' the link will work for both http and https (-> DEFAULT_ACE_PATH = "//d1n0x3qji82z53.cloudfront.net/src-min-noconflict";)

See this link for explanations:
http://blog.httpwatch.com/2010/02/10/using-protocol-relative-urls-to-switch-between-http-and-https/

Kind Regards
Florian

vaadin 7.5 and aceeditor addon 0.8.13 compatibility

I am using the maven archetype. Vaadin version is 7.5. I have added the dependency in my project like this:

org.vaadin.addons
aceeditor
0.8.13

During maven install, all other widgetsets like e.g vaadin-charts are found in classpath. But aceeditor widgetset is never found. i.e. in my console log, [INFO] Widgetsets found from class path: does not list aceeditor widgetset. Hence, my generated widgets.gwt.xml does not contain a definition for aceeditor and I cannot use aceeditor in my project.

Note: I do have the aceeditor-0.8.13.jar maven plugin present in my maven dependencies. I can reference AceEditor class in my IDE

What could be the problem here..

Memory Leak

ServerSideDocDiff is using ThreadLocal but isn't releasing the resouce when it's done. This causes a memory leak and errors in Tomcat log files about the leak.

NotSerializableException

Hello,

I am getting a NotSerializableException for AceDoc in my application, when I try to save changes to a document I opened with AceEditor before:

java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.vaadin.aceeditor.client.AceDoc
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1354)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at java.util.HashMap.readObject(HashMap.java:1183)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at java.util.HashMap.readObject(HashMap.java:1183)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at java.util.ArrayList.readObject(ArrayList.java:771)
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at java.util.HashMap.readObject(HashMap.java:1183)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at java.util.HashMap.readObject(HashMap.java:1184)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:500)
at com.vaadin.server.VaadinSession.readObject(VaadinSession.java:1340)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1597)
at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1062)
at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284)
at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)
at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:491)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3954)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:426)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1345)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.NotSerializableException: org.vaadin.aceeditor.client.AceDoc
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
at java.util.HashMap.writeObject(HashMap.java:1132)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1495)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
at java.util.HashMap.writeObject(HashMap.java:1132)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1495)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
at java.util.ArrayList.writeObject(ArrayList.java:742)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1495)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
at java.util.HashMap.writeObject(HashMap.java:1132)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1495)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
at java.util.HashMap.writeObject(HashMap.java:1133)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1495)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1673)
at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:1079)
at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:432)
at org.apache.catalina.session.StandardManager.unload(StandardManager.java:353)
at org.apache.catalina.session.StandardManager.stopInternal(StandardManager.java:518)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5622)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3947)
... 7 more

scrollToRow

Make it possible to scroll to a given row in the editor

ace.scrollToRow(5);

Support Servlet 3.0 configuration

I really can't figure how to work with this ace wrapper without the web.xml.
The code has no java-doc pointing how it loads files or where it searches. I need my own hosted ace modes as well as custom modes.

scrollToPosition and scrollToRow do not seem to work

Configured poms to AceEditor 0.8.7 and Vaadin 7.1.6. Updated, cleaned and compiled widgetsets. Cleaned browser history and restarted web container. Invoking the following does not seem to have any effect on scrolling:

editor.setValue(builder.toString());
editor.scrollToPosition(lastCursor);

Same with editor.scrollToRow(). Have I forgotten something or maybe a bug?

ENTER (=newline) doesn't work

Addon 0.8.13
Vaadin 7.4.2

I can't insert a new line?

Insertint text works without problems, highlighting works, but it's not possible to create new lines?
Tried with FF and Chrome.

No javascript problems found.

Any hints?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.