ahn / vaadin-aceeditor

Vaadin wrapper for Ace editor
Apache License 2.0
24 stars 37 forks source link

setEnabled(false) does not work #25

Closed jreznot closed 10 years ago

jreznot commented 10 years ago

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);
    }
}