-
Notifications
You must be signed in to change notification settings - Fork 188
/
ObjectDeltaPanelFactory.java
44 lines (34 loc) · 1.36 KB
/
ObjectDeltaPanelFactory.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
44
/*
* Copyright (c) 2020 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.gui.impl.factory;
import javax.annotation.PostConstruct;
import com.evolveum.midpoint.web.component.input.TextAreaPanel;
import org.apache.wicket.markup.html.panel.Panel;
import org.springframework.stereotype.Component;
import com.evolveum.midpoint.gui.api.factory.AbstractGuiComponentFactory;
import com.evolveum.midpoint.gui.api.prism.ItemWrapper;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType;
@Component
public class ObjectDeltaPanelFactory extends AbstractGuiComponentFactory<ObjectDeltaType> {
@PostConstruct
public void register() {
getRegistry().addToRegistry(this);
}
@Override
public Integer getOrder() {
return super.getOrder() - 100;
}
@Override
protected Panel getPanel(PrismPropertyPanelContext<ObjectDeltaType> panelCtx) {
return new TextAreaPanel<>(panelCtx.getComponentId(), new ObjectDeltaModel(panelCtx.getRealValueModel(), panelCtx.getPageBase()), 20);
}
@Override
public <IW extends ItemWrapper> boolean match(IW wrapper) {
return QNameUtil.match(ObjectDeltaType.COMPLEX_TYPE, wrapper.getTypeName());
}
}