use of com.evolveum.midpoint.gui.impl.component.MultivalueContainerListPanel in project midpoint by Evolveum.
the class FocusTriggersTabPanel method initLayout.
private void initLayout() {
PrismContainerWrapperModel<F, TriggerType> triggersModel = PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), FocusType.F_TRIGGER);
MultivalueContainerListPanel<TriggerType> multivalueContainerListPanel = new MultivalueContainerListPanel<TriggerType>(ID_TRIGGERS_PANEL, TriggerType.class) {
private static final long serialVersionUID = 1L;
@Override
protected boolean isCreateNewObjectVisible() {
return false;
}
@Override
protected IModel<PrismContainerWrapper<TriggerType>> getContainerModel() {
return triggersModel;
}
@Override
protected boolean isHeaderVisible() {
return false;
}
@Override
protected String getStorageKey() {
return SessionStorage.KEY_TRIGGERS_TAB;
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TRIGGERS_TAB_TABLE;
}
@Override
protected List<IColumn<PrismContainerValueWrapper<TriggerType>, String>> createDefaultColumns() {
return createTriggersColumns();
}
@Override
protected void editItemPerformed(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<TriggerType>> rowModel, List<PrismContainerValueWrapper<TriggerType>> listItems) {
}
};
multivalueContainerListPanel.add(new VisibleBehaviour(() -> triggersModel != null && triggersModel.getObject() != null));
add(multivalueContainerListPanel);
setOutputMarkupId(true);
}
use of com.evolveum.midpoint.gui.impl.component.MultivalueContainerListPanel in project midpoint by Evolveum.
the class LoggingConfigurationTabPanel method initLayout.
protected void initLayout() {
try {
ItemPanelSettingsBuilder builder = new ItemPanelSettingsBuilder();
builder.visibilityHandler(itemWrapper -> getLoggingVisibility(itemWrapper.getPath()));
Panel loggingPanel = getPageBase().initItemPanel(ID_LOGGING, LoggingConfigurationType.COMPLEX_TYPE, getModel(), builder.build());
add(loggingPanel);
} catch (SchemaException e) {
LOGGER.error("Cannot create panel for logging: {}", e.getMessage(), e);
getSession().error("Cannot create panle for logging");
}
PrismContainerWrapperModel<LoggingConfigurationType, ClassLoggerConfigurationType> loggerModel = PrismContainerWrapperModel.fromContainerWrapper(getModel(), LoggingConfigurationType.F_CLASS_LOGGER);
MultivalueContainerListPanel<ClassLoggerConfigurationType> loggersMultivalueContainerListPanel = new MultivalueContainerListPanel<ClassLoggerConfigurationType>(ID_LOGGERS, ClassLoggerConfigurationType.class) {
private static final long serialVersionUID = 1L;
@Override
protected List<SearchItemDefinition> initSearchableItems(PrismContainerDefinition<ClassLoggerConfigurationType> containerDef) {
List<SearchItemDefinition> defs = new ArrayList<>();
SearchFactory.addSearchPropertyDef(containerDef, ClassLoggerConfigurationType.F_APPENDER, defs);
SearchFactory.addSearchPropertyDef(containerDef, ClassLoggerConfigurationType.F_PACKAGE, defs);
defs.addAll(SearchFactory.createExtensionDefinitionList(containerDef));
return defs;
}
@Override
protected void newItemPerformed(AjaxRequestTarget target, AssignmentObjectRelation relation) {
PrismContainerValue<ClassLoggerConfigurationType> newLogger = loggerModel.getObject().getItem().createNewValue();
PrismContainerValueWrapper<ClassLoggerConfigurationType> newLoggerWrapper = getLoggersMultivalueContainerListPanel().createNewItemContainerValueWrapper(newLogger, loggerModel.getObject(), target);
loggerEditPerformed(target, Model.of(newLoggerWrapper), null);
}
@Override
protected boolean isCreateNewObjectVisible() {
return true;
}
@Override
protected IModel<PrismContainerWrapper<ClassLoggerConfigurationType>> getContainerModel() {
return loggerModel;
}
@Override
protected String getStorageKey() {
return SessionStorage.KEY_LOGGING_TAB_LOGGER_TABLE;
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.LOGGING_TAB_LOGGER_TABLE;
}
@Override
protected List<IColumn<PrismContainerValueWrapper<ClassLoggerConfigurationType>, String>> createDefaultColumns() {
return initLoggersBasicColumns(loggerModel);
}
@Override
protected void editItemPerformed(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<ClassLoggerConfigurationType>> rowModel, List<PrismContainerValueWrapper<ClassLoggerConfigurationType>> listItems) {
loggerEditPerformed(target, rowModel, listItems);
}
};
add(loggersMultivalueContainerListPanel);
PrismContainerWrapperModel<LoggingConfigurationType, AppenderConfigurationType> appenderModel = PrismContainerWrapperModel.fromContainerWrapper(getModel(), LoggingConfigurationType.F_APPENDER);
MultivalueContainerListPanelWithDetailsPanel<AppenderConfigurationType> appendersMultivalueContainerListPanel = new MultivalueContainerListPanelWithDetailsPanel<AppenderConfigurationType>(ID_APPENDERS, AppenderConfigurationType.class) {
private static final long serialVersionUID = 1L;
@Override
protected void newItemPerformed(AjaxRequestTarget target, AssignmentObjectRelation relation) {
newAppendersClickPerformed(target, appenderModel);
}
@Override
protected boolean isCreateNewObjectVisible() {
return true;
}
@Override
protected IModel<PrismContainerWrapper<AppenderConfigurationType>> getContainerModel() {
return appenderModel;
}
@Override
protected boolean isHeaderVisible() {
return false;
}
@Override
protected String getStorageKey() {
return SessionStorage.KEY_LOGGING_TAB_APPENDER_TABLE;
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.LOGGING_TAB_APPENDER_TABLE;
}
@Override
protected List<IColumn<PrismContainerValueWrapper<AppenderConfigurationType>, String>> createDefaultColumns() {
return initAppendersBasicColumns(appenderModel);
}
@Override
protected MultivalueContainerDetailsPanel<AppenderConfigurationType> getMultivalueContainerDetailsPanel(ListItem<PrismContainerValueWrapper<AppenderConfigurationType>> item) {
return LoggingConfigurationTabPanel.this.getAppendersMultivalueContainerDetailsPanel(item);
}
@Override
protected List<Component> createToolbarButtonsList(String idButton) {
List<Component> bar = new ArrayList<>();
// MidpointForm appenderTypeForm = new MidpointForm(ID_CHOICE_APPENDER_TYPE_FORM);
AjaxSubmitButton newObjectIcon = new AjaxSubmitButton(idButton, new Model<>("<i class=\"fa fa-plus\"></i>")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
newItemPerformed(target, null);
}
};
newObjectIcon.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return isCreateNewObjectVisible();
}
@Override
public boolean isEnabled() {
return isNewObjectButtonEnabled();
}
});
newObjectIcon.add(AttributeModifier.append("class", createStyleClassModelForNewObjectIcon()));
// appenderTypeForm.add(newObjectIcon);
bar.add(newObjectIcon);
List<QName> appendersChoicesList = new ArrayList<>();
appendersChoicesList.add(FileAppenderConfigurationType.COMPLEX_TYPE);
appendersChoicesList.add(SyslogAppenderConfigurationType.COMPLEX_TYPE);
DropDownChoicePanel<QName> appenderChoice = new DropDownChoicePanel<>(idButton, new Model<>(FileAppenderConfigurationType.COMPLEX_TYPE), Model.ofList(appendersChoicesList), new QNameIChoiceRenderer("LoggingConfigurationTabPanel.appendersChoice"));
appenderChoice.setOutputMarkupId(true);
LoggingConfigurationTabPanel.this.appenderChoice = appenderChoice;
bar.add(appenderChoice);
// bar.add(appenderTypeForm);
return bar;
}
};
add(appendersMultivalueContainerListPanel);
IModel<PrismContainerWrapper<LoggingAuditingConfigurationType>> auditModel = PrismContainerWrapperModel.fromContainerWrapper(getModel(), LoggingConfigurationType.F_AUDITING);
try {
Panel auditPanel = getPageBase().initItemPanel(ID_AUDITING, LoggingAuditingConfigurationType.COMPLEX_TYPE, auditModel, new ItemPanelSettingsBuilder().build());
add(auditPanel);
} catch (SchemaException e) {
LOGGER.error("Cannot create panel for auditing: {}", e.getMessage(), e);
getSession().error("Cannot create panel for auditing.");
}
setOutputMarkupId(true);
}
use of com.evolveum.midpoint.gui.impl.component.MultivalueContainerListPanel in project midpoint by Evolveum.
the class FocusTriggersPanel method initLayout.
protected void initLayout() {
PrismContainerWrapperModel<F, TriggerType> triggersModel = PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), FocusType.F_TRIGGER);
MultivalueContainerListPanel<TriggerType> multivalueContainerListPanel = new MultivalueContainerListPanel<>(ID_TRIGGERS_PANEL, TriggerType.class) {
private static final long serialVersionUID = 1L;
@Override
protected boolean isCreateNewObjectVisible() {
return false;
}
@Override
protected IModel<PrismContainerWrapper<TriggerType>> getContainerModel() {
return triggersModel;
}
@Override
protected boolean isHeaderVisible() {
return false;
}
@Override
protected String getStorageKey() {
return SessionStorage.KEY_TRIGGERS_TAB;
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TRIGGERS_TAB_TABLE;
}
@Override
protected List<IColumn<PrismContainerValueWrapper<TriggerType>, String>> createDefaultColumns() {
return createTriggersColumns();
}
@Override
protected void editItemPerformed(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<TriggerType>> rowModel, List<PrismContainerValueWrapper<TriggerType>> listItems) {
}
};
multivalueContainerListPanel.add(new VisibleBehaviour(() -> triggersModel.getObject() != null));
add(multivalueContainerListPanel);
setOutputMarkupId(true);
}
Aggregations