use of com.evolveum.midpoint.web.component.util.ListDataProvider in project midpoint by Evolveum.
the class ChangePasswordPanel method initLayout.
private void initLayout(final boolean oldPasswordVisible) {
model = (LoadableModel<MyPasswordsDto>) getModel();
Label oldPasswordLabel = new Label(ID_OLD_PASSWORD_LABEL, createStringResource("PageSelfCredentials.oldPasswordLabel"));
add(oldPasswordLabel);
oldPasswordLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return oldPasswordVisible;
}
});
Label passwordLabel = new Label(ID_PASSWORD_LABEL, createStringResource("PageSelfCredentials.passwordLabel1"));
add(passwordLabel);
PasswordTextField oldPasswordField = new PasswordTextField(ID_OLD_PASSWORD_FIELD, new PropertyModel<String>(model, MyPasswordsDto.F_OLD_PASSWORD));
oldPasswordField.setRequired(false);
oldPasswordField.setResetPassword(false);
add(oldPasswordField);
oldPasswordField.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
public boolean isVisible() {
return oldPasswordVisible;
}
;
});
PasswordPanel passwordPanel = new PasswordPanel(ID_PASSWORD_PANEL, new PropertyModel<ProtectedStringType>(model, MyPasswordsDto.F_PASSWORD));
passwordPanel.getBaseFormComponent().add(new AttributeModifier("autofocus", ""));
add(passwordPanel);
WebMarkupContainer accountContainer = new WebMarkupContainer(ID_ACCOUNTS_CONTAINER);
List<IColumn<PasswordAccountDto, String>> columns = initColumns();
ListDataProvider<PasswordAccountDto> provider = new ListDataProvider<PasswordAccountDto>(this, new PropertyModel<List<PasswordAccountDto>>(model, MyPasswordsDto.F_ACCOUNTS));
TablePanel accounts = new TablePanel(ID_ACCOUNTS_TABLE, provider, columns);
accounts.setItemsPerPage(30);
accounts.setShowPaging(false);
if (model.getObject().getPropagation() != null && model.getObject().getPropagation().equals(CredentialsPropagationUserControlType.MAPPING)) {
accountContainer.setVisible(false);
}
accountContainer.add(accounts);
AjaxLink help = new AjaxLink(ID_BUTTON_HELP) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
showHelpPerformed(target);
}
};
accountContainer.add(help);
add(accountContainer);
}
use of com.evolveum.midpoint.web.component.util.ListDataProvider in project midpoint by Evolveum.
the class LoggingConfigPanel method initLoggers.
private void initLoggers() {
initRoot();
ISortableDataProvider<LoggerConfiguration, String> provider = new ListDataProvider<>(this, new PropertyModel<List<LoggerConfiguration>>(getModel(), "loggers"));
TablePanel table = new TablePanel<>(ID_LOGGERS_TABLE, provider, initLoggerColumns());
table.setOutputMarkupId(true);
table.setShowPaging(true);
add(table);
AjaxButton addStandardLogger = new AjaxButton(ID_BUTTON_ADD_STANDARD_LOGGER, createStringResource("LoggingConfigPanel.button.addStandardLogger")) {
@Override
public void onClick(AjaxRequestTarget target) {
addStandardLoggerPerformed(target);
}
};
add(addStandardLogger);
AjaxButton addComponentLogger = new AjaxButton("addComponentLogger", createStringResource("LoggingConfigPanel.button.addComponentLogger")) {
@Override
public void onClick(AjaxRequestTarget target) {
addComponentLoggerPerformed(target);
}
};
add(addComponentLogger);
AjaxButton addClassLogger = new AjaxButton("addClassLogger", createStringResource("LoggingConfigPanel.button.addClassLogger")) {
@Override
public void onClick(AjaxRequestTarget target) {
addClassLoggerPerformed(target);
}
};
add(addClassLogger);
AjaxButton deleteLogger = new AjaxButton("deleteLogger", createStringResource("LoggingConfigPanel.button.deleteLogger")) {
@Override
public void onClick(AjaxRequestTarget target) {
deleteLoggerPerformed(target);
}
};
add(deleteLogger);
}
use of com.evolveum.midpoint.web.component.util.ListDataProvider in project midpoint by Evolveum.
the class LoggingConfigPanel method initAppenders.
private void initAppenders() {
ISortableDataProvider<AppenderConfiguration, String> provider = new ListDataProvider<>(this, new PropertyModel<List<AppenderConfiguration>>(getModel(), LoggingDto.F_APPENDERS));
TablePanel table = new TablePanel<>(ID_TABLE_APPENDERS, provider, initAppenderColumns());
table.setOutputMarkupId(true);
table.setShowPaging(false);
add(table);
AjaxButton addConsoleAppender = new AjaxButton(ID_BUTTON_ADD_CONSOLE_APPENDER, createStringResource("LoggingConfigPanel.button.addConsoleAppender")) {
@Override
public void onClick(AjaxRequestTarget target) {
addConsoleAppenderPerformed(target);
}
};
add(addConsoleAppender);
AjaxButton addFileAppender = new AjaxButton(ID_BUTTON_ADD_FILE_APPENDER, createStringResource("LoggingConfigPanel.button.addFileAppender")) {
@Override
public void onClick(AjaxRequestTarget target) {
addFileAppenderPerformed(target);
}
};
add(addFileAppender);
AjaxButton deleteAppender = new AjaxButton(ID_BUTTON_DELETE_APPENDER, createStringResource("LoggingConfigPanel.button.deleteAppender")) {
@Override
public void onClick(AjaxRequestTarget target) {
deleteAppenderPerformed(target);
}
};
add(deleteAppender);
}
use of com.evolveum.midpoint.web.component.util.ListDataProvider in project midpoint by Evolveum.
the class SubtasksPanel method initLayout.
private void initLayout(boolean workflowsEnabled) {
List<IColumn<TaskDto, String>> columns = new ArrayList<IColumn<TaskDto, String>>();
columns.add(PageTasks.createTaskNameColumn(this, "SubtasksPanel.label.name"));
columns.add(PageTasks.createTaskCategoryColumn(this, "SubtasksPanel.label.category"));
columns.add(PageTasks.createTaskExecutionStatusColumn(this, "SubtasksPanel.label.executionState"));
columns.add(PageTasks.createTaskResultStatusColumn(this, "SubtasksPanel.label.result"));
//columns.add(PageTasks.createTaskDetailColumn(this, "SubtasksPanel.label.detail", workflowsEnabled));
ISortableDataProvider provider = new ListDataProvider(this, getModel());
add(new TablePanel<TaskDto>(ID_SUBTASKS_TABLE, provider, columns));
}
use of com.evolveum.midpoint.web.component.util.ListDataProvider in project midpoint by Evolveum.
the class CapabilityStep method initLayout.
protected void initLayout() {
final ListDataProvider<CapabilityDto<CapabilityType>> capabilityProvider = new ListDataProvider<>(this, new PropertyModel<List<CapabilityDto<CapabilityType>>>(dtoModel, CapabilityStepDto.F_CAPABILITIES));
WebMarkupContainer tableBody = new WebMarkupContainer(ID_CAPABILITY_TABLE);
tableBody.setOutputMarkupId(true);
add(tableBody);
WebMarkupContainer configBody = new WebMarkupContainer(ID_CAPABILITY_CONFIG);
configBody.setOutputMarkupId(true);
add(configBody);
DataView<CapabilityDto<CapabilityType>> capabilityDataView = new DataView<CapabilityDto<CapabilityType>>(ID_CAPABILITY_ROW, capabilityProvider) {
@Override
protected void populateItem(final Item<CapabilityDto<CapabilityType>> capabilityRow) {
final CapabilityDto<CapabilityType> dto = capabilityRow.getModelObject();
AjaxLink name = new AjaxLink(ID_CAPABILITY_LINK) {
@Override
public void onClick(AjaxRequestTarget target) {
editCapabilityPerformed(target, dto);
}
};
Label label = new Label(ID_CAPABILITY_NAME, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
String rv = dto.getDisplayName();
if (Boolean.FALSE.equals(dto.getCapability().isEnabled())) {
rv += " " + getString("CapabilityStep.disabled");
}
return rv;
}
});
name.add(label);
capabilityRow.add(name);
Label tooltipLabel = new Label(ID_TOOLTIP, new Model<>());
if (dto.getTooltipKey() != null) {
tooltipLabel.add(new AttributeAppender("data-original-title", getString(dto.getTooltipKey())));
tooltipLabel.add(new InfoTooltipBehavior());
} else {
tooltipLabel.setVisible(false);
}
tooltipLabel.setOutputMarkupId(true);
tooltipLabel.setOutputMarkupPlaceholderTag(true);
name.add(tooltipLabel);
AjaxLink deleteLink = new AjaxLink(ID_CAPABILITY_DELETE) {
@Override
public void onClick(AjaxRequestTarget target) {
deleteCapabilityPerformed(target, dto);
}
};
deleteLink.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return !dto.isAmongNativeCapabilities() && !parentPage.isReadOnly();
}
});
name.add(deleteLink);
capabilityRow.add(AttributeModifier.replace("class", new AbstractReadOnlyModel<Object>() {
@Override
public Object getObject() {
return isSelected(capabilityRow.getModelObject()) ? "success" : null;
}
}));
}
};
tableBody.add(capabilityDataView);
AjaxLink addLink = new AjaxLink(ID_CAPABILITY_ADD) {
@Override
public void onClick(AjaxRequestTarget target) {
addCapabilityPerformed(target);
}
};
parentPage.addEditingVisibleBehavior(addLink);
add(addLink);
ModalWindow dialog = new AddCapabilityDialog(DIALOG_SELECT_CAPABILITY, dtoModel) {
@Override
protected void addPerformed(AjaxRequestTarget target) {
addCapabilitiesPerformed(target, getSelectedData());
}
};
add(dialog);
}
Aggregations