private void initLayout() {
    Form mainForm = new Form(ID_MAIN_FORM);
    add(mainForm);

    final IModel<Boolean> editable =
        new LoadableModel<Boolean>(false) {

          @Override
          protected Boolean load() {
            return !isEditing();
          }
        };
    mainForm.add(
        new AjaxCheckBox(ID_EDIT, editable) {

          @Override
          protected void onUpdate(AjaxRequestTarget target) {
            editPerformed(target, editable.getObject());
          }
        });
    AceEditor editor =
        new AceEditor(ID_ACE_EDITOR, new PropertyModel<String>(model, ObjectViewDto.F_XML));
    editor.setReadonly(
        new LoadableModel<Boolean>(false) {

          @Override
          protected Boolean load() {
            return isEditing();
          }
        });
    mainForm.add(editor);

    initButtons(mainForm);
  }
  private void initPanelLayout(int minSize) {
    Label title = new Label(ID_TITLE, this.title);
    add(title);

    AceEditor editor = new AceEditor(ID_EDITOR, getModel());
    editor.setReadonly(false);
    if (minSize > 0) {
      editor.setMinSize(minSize);
    }
    add(editor);
  }
  private void editPerformed(AjaxRequestTarget target, boolean editable) {
    AceEditor editor = (AceEditor) get(createComponentPath(ID_MAIN_FORM, ID_ACE_EDITOR));

    editor.setReadonly(!editable);
    editor.refreshReadonly(target);
  }