/
XmlEditorPanel.java
43 lines (33 loc) · 1.05 KB
/
XmlEditorPanel.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Copyright (c) 2010-2013 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.web.component.wizard.resource.component;
import com.evolveum.midpoint.web.component.util.EnableBehaviour;
import org.apache.wicket.model.IModel;
import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.web.component.AceEditor;
/**
* @author lazyman
*/
public class XmlEditorPanel extends BasePanel<String> {
private static final String ID_ACE_EDITOR = "aceEditor";
public XmlEditorPanel(String id, IModel<String> model) {
super(id, model);
}
@Override
protected void onInitialize() {
super.onInitialize();
initLayout();
}
protected void initLayout() {
AceEditor editor = new AceEditor(ID_ACE_EDITOR, getModel());
editor.setReadonly(!isEditEnabled());
add(editor);
}
protected boolean isEditEnabled() {
return true;
}
}