-
Notifications
You must be signed in to change notification settings - Fork 188
/
AbstractGuiComponentFactory.java
49 lines (35 loc) · 1.48 KB
/
AbstractGuiComponentFactory.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
45
46
47
48
49
/*
* Copyright (c) 2010-2018 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.api.factory;
import java.util.List;
import com.evolveum.midpoint.common.LocalizationService;
import com.evolveum.midpoint.gui.api.registry.GuiComponentRegistry;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import org.apache.wicket.feedback.ComponentFeedbackMessageFilter;
import org.apache.wicket.markup.html.panel.Panel;
import com.evolveum.midpoint.gui.impl.factory.panel.PrismPropertyPanelContext;
import com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType;
import org.springframework.beans.factory.annotation.Autowired;
public abstract class AbstractGuiComponentFactory<T> implements GuiComponentFactory<PrismPropertyPanelContext<T>> {
private static final long serialVersionUID = 1L;
@Autowired
private transient GuiComponentRegistry registry;
public GuiComponentRegistry getRegistry() {
return registry;
}
@Override
public Panel createPanel(PrismPropertyPanelContext<T> panelCtx) {
Panel panel = getPanel(panelCtx);
panelCtx.getFeedback().setFilter(new ComponentFeedbackMessageFilter(panel));
return panel;
}
@Override
public Integer getOrder() {
return Integer.MAX_VALUE;
}
protected abstract Panel getPanel(PrismPropertyPanelContext<T> panelCtx);
}