use of org.apache.wicket.markup.html.panel.Panel in project midpoint by Evolveum.
the class PageBase method initItemPanel.
public <IW extends ItemWrapper> Panel initItemPanel(String panelId, QName typeName, IModel<IW> wrapperModel, ItemPanelSettings itemPanelSettings) throws SchemaException {
Class<?> panelClass = getWrapperPanel(typeName);
if (panelClass == null) {
ErrorPanel errorPanel = new ErrorPanel(panelId, () -> "Cannot create panel for " + typeName);
errorPanel.add(new VisibleBehaviour(() -> getApplication().usesDevelopmentConfig()));
return errorPanel;
}
Constructor<?> constructor;
try {
constructor = panelClass.getConstructor(String.class, IModel.class, ItemPanelSettings.class);
return (Panel) constructor.newInstance(panelId, wrapperModel, itemPanelSettings);
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new SystemException("Cannot instantiate " + panelClass, e);
}
}
use of org.apache.wicket.markup.html.panel.Panel in project midpoint by Evolveum.
the class ProfilingConfigurationTabPanel method initLayout.
protected void initLayout() {
WebMarkupContainer profilingEnabledNote = new WebMarkupContainer(ID_PROFILING_ENABLED_NOTE);
profilingEnabledNote.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return getPageBase().getMidpointConfiguration().getProfilingMode() == ProfilingMode.OFF;
}
});
add(profilingEnabledNote);
try {
ItemPanelSettingsBuilder builder = new ItemPanelSettingsBuilder();
Panel panel = getPageBase().initItemPanel(ID_PROFILING, ProfilingConfigurationType.COMPLEX_TYPE, getProfilingModel(), builder.build());
add(panel);
} catch (SchemaException e) {
LOGGER.error("Cannot create profiling panel. Reason: {}", e.getMessage(), e);
getSession().error("Cannot create profiling panel.");
}
PrismContainerWrapperModel<LoggingConfigurationType, ClassLoggerConfigurationType> profilingLogger = PrismContainerWrapperModel.fromContainerWrapper(getLoggingModel(), ItemPath.create(ProfilingClassLoggerWrapperFactoryImpl.PROFILING_LOGGER_PATH));
try {
ItemPanelSettingsBuilder builder = new ItemPanelSettingsBuilder();
Panel logger = getPageBase().initItemPanel(ID_PROFILING_LOGGER, ProfilingClassLoggerWrapperFactoryImpl.PROFILING_LOGGER_PATH, profilingLogger, builder.build());
add(logger);
} catch (SchemaException e) {
LOGGER.error("Cannot create profiling panel. Reason: {}", e.getMessage(), e);
getSession().error("Cannot create profiling panel.");
}
}
use of org.apache.wicket.markup.html.panel.Panel in project midpoint by Evolveum.
the class SystemConfigPanel method initLayout.
protected void initLayout() {
try {
ItemPanelSettingsBuilder builder = new ItemPanelSettingsBuilder().visibilityHandler(this::getBasicTabVisibity);
Panel panel = getPageBase().initItemPanel(ID_SYSTEM_CONFIG, SystemConfigurationType.COMPLEX_TYPE, getModel(), builder.build());
add(panel);
} catch (SchemaException e) {
LOGGER.error("Cannot create basic panel for system configuration.");
getSession().error("Cannot create basic panel for system configuration.");
}
}
use of org.apache.wicket.markup.html.panel.Panel in project midpoint by Evolveum.
the class ReportCollectionViewPanel method initLayout.
@Override
protected void initLayout() {
PrismPropertyWrapperModel<ReportType, Object> propertyModel = PrismPropertyWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_VIEW, GuiObjectListViewType.F_TYPE));
try {
Panel propertyPanel = getPageBase().initItemPanel(ID_TYPE, propertyModel.getObject().getTypeName(), propertyModel, null);
add(propertyPanel);
} catch (SchemaException e) {
LOGGER.error("Couldn't create panel for type element in view");
}
add(createObjectListForColumns());
}
use of org.apache.wicket.markup.html.panel.Panel in project midpoint by Evolveum.
the class AssignmentHolderTypeDetailsTabPanel method initLayout.
private void initLayout() {
try {
ItemPanelSettingsBuilder builder = new ItemPanelSettingsBuilder().visibilityHandler(w -> ItemVisibility.AUTO);
builder.headerVisibility(false);
Panel main = getPageBase().initItemPanel(ID_MAIN_PANEL, getObjectWrapper().getTypeName(), PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.EMPTY_PATH), builder.build());
add(main);
Panel activation = getPageBase().initItemPanel(ID_ACTIVATION_PANEL, ActivationType.COMPLEX_TYPE, PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), FocusType.F_ACTIVATION), builder.build());
add(activation);
Panel password = getPageBase().initItemPanel(ID_PASSWORD_PANEL, PasswordType.COMPLEX_TYPE, PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(UserType.F_CREDENTIALS, CredentialsType.F_PASSWORD)), builder.build());
add(password);
} catch (SchemaException e) {
LOGGER.error("Could not create focus details panel. Reason: {}", e.getMessage(), e);
}
}
Aggregations