Skip to content

Commit

Permalink
style fix for ace editor panel
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jun 18, 2020
1 parent b840f7f commit faa8b9e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Expand Up @@ -8,7 +8,9 @@
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>

<h3 style="margin-left: 20px;" wicket:id="title"/>
<div wicket:id="titleContainer">
<h3 style="margin-left: 20px;" wicket:id="title"/>
</div>

<div class="form-group">
<div class="col-lg-12">
Expand Down
Expand Up @@ -9,8 +9,10 @@
import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.web.component.AceEditor;

import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;

import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;

Expand All @@ -20,6 +22,7 @@
public class AceEditorPanel extends BasePanel<String> {

private static final String ID_TITLE = "title";
private static final String ID_TITLE_CONTAINER = "titleContainer";
private static final String ID_EDITOR = "editor";

private IModel<String> title;
Expand All @@ -40,14 +43,14 @@ public AceEditorPanel(String id, IModel<String> title, IModel<String> data, int


private void initLayout(int minSize) {
WebMarkupContainer titleContainer = new WebMarkupContainer(ID_TITLE_CONTAINER);
titleContainer.setOutputMarkupId(true);
titleContainer.add(new VisibleBehaviour(() -> title != null));
add(titleContainer);

Label title = new Label(ID_TITLE, this.title);
title.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return title != null;
}
});
add(title);
title.setOutputMarkupId(true);
titleContainer.add(title);

AceEditor editor = new AceEditor(ID_EDITOR, getModel());
editor.setReadonly(false);
Expand Down

0 comments on commit faa8b9e

Please sign in to comment.