Search in sources :

Example 1 with AceEditor

use of com.evolveum.midpoint.web.component.AceEditor in project midpoint by Evolveum.

the class SchemaStep method createSchemaEditor.

private ITab createSchemaEditor() {
    return new AbstractTab(createStringModel("SchemaStep.xml")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            XmlEditorPanel xmlEditorPanel = new XmlEditorPanel(panelId, createXmlEditorModel());
            // quick fix: now changes from XmlEditorPanel are not saved anyhow
            //(e.g. by clicking Finish button in wizard). For now,
            //panel is made disabled for editing
            AceEditor aceEditor = (AceEditor) xmlEditorPanel.get(ID_ACE_EDITOR);
            aceEditor.setReadonly(true);
            return xmlEditorPanel;
        }
    };
}
Also used : XmlEditorPanel(com.evolveum.midpoint.web.component.wizard.resource.component.XmlEditorPanel) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab) AceEditor(com.evolveum.midpoint.web.component.AceEditor)

Example 2 with AceEditor

use of com.evolveum.midpoint.web.component.AceEditor in project midpoint by Evolveum.

the class XmlEditorPanel method initLayout.

@Override
protected void initLayout() {
    AceEditor editor = new AceEditor(ID_ACE_EDITOR, getModel());
    add(editor);
}
Also used : AceEditor(com.evolveum.midpoint.web.component.AceEditor)

Example 3 with AceEditor

use of com.evolveum.midpoint.web.component.AceEditor in project midpoint by Evolveum.

the class AceEditorPanel method initLayout.

private void initLayout(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.setMinHeight(minSize);
    }
    add(editor);
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) AceEditor(com.evolveum.midpoint.web.component.AceEditor)

Example 4 with AceEditor

use of com.evolveum.midpoint.web.component.AceEditor in project midpoint by Evolveum.

the class AceEditorFormGroup method initLayout.

private void initLayout(IModel<String> label, final String tooltipKey, boolean isTooltipInModal, String labelSize, String textSize, boolean required, int rowNumber) {
    WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
    add(labelContainer);
    Label l = new Label(ID_LABEL, label);
    if (StringUtils.isNotEmpty(labelSize)) {
        labelContainer.add(AttributeAppender.prepend("class", labelSize));
    }
    labelContainer.add(l);
    Label tooltipLabel = new Label(ID_TOOLTIP, new Model<>());
    tooltipLabel.add(new AttributeAppender("data-original-title", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return getString(tooltipKey);
        }
    }));
    tooltipLabel.add(new InfoTooltipBehavior(isTooltipInModal));
    tooltipLabel.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return tooltipKey != null;
        }
    });
    tooltipLabel.setOutputMarkupId(true);
    tooltipLabel.setOutputMarkupPlaceholderTag(true);
    labelContainer.add(tooltipLabel);
    WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
    if (StringUtils.isNotEmpty(textSize)) {
        textWrapper.add(AttributeAppender.prepend("class", textSize));
    }
    add(textWrapper);
    AceEditor text = new AceEditor(ID_TEXT, getModel());
    text.add(new AttributeModifier("rows", rowNumber));
    text.setOutputMarkupId(true);
    text.setRequired(required);
    text.setLabel(label);
    text.add(AttributeAppender.replace("placeholder", label));
    textWrapper.add(text);
}
Also used : InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) Label(org.apache.wicket.markup.html.basic.Label) AceEditor(com.evolveum.midpoint.web.component.AceEditor) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AttributeModifier(org.apache.wicket.AttributeModifier) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AttributeAppender(org.apache.wicket.behavior.AttributeAppender)

Example 5 with AceEditor

use of com.evolveum.midpoint.web.component.AceEditor in project midpoint by Evolveum.

the class PageResourceEdit method editPerformed.

private void editPerformed(AjaxRequestTarget target, boolean editable) {
    AceEditor editor = (AceEditor) get(createComponentPath(ID_MAIN_FORM, ID_ACE_EDITOR));
    editor.setReadonly(!editable);
    editor.refreshReadonly(target);
}
Also used : AceEditor(com.evolveum.midpoint.web.component.AceEditor)

Aggregations

AceEditor (com.evolveum.midpoint.web.component.AceEditor)16 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)9 Form (org.apache.wicket.markup.html.form.Form)8 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)5 Label (org.apache.wicket.markup.html.basic.Label)5 AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)3 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)3 DropDownChoice (org.apache.wicket.markup.html.form.DropDownChoice)3 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)2 InfoTooltipBehavior (com.evolveum.midpoint.web.util.InfoTooltipBehavior)2 StringResourceChoiceRenderer (com.evolveum.midpoint.web.util.StringResourceChoiceRenderer)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 List (java.util.List)2 AjaxFormChoiceComponentUpdatingBehavior (org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior)2 AjaxFormComponentUpdatingBehavior (org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior)2 OnChangeAjaxBehavior (org.apache.wicket.ajax.form.OnChangeAjaxBehavior)2 AjaxSubmitLink (org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink)2 Radio (org.apache.wicket.markup.html.form.Radio)2 RadioGroup (org.apache.wicket.markup.html.form.RadioGroup)2