use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class LoggingConfigPanel method initAppenderColumns.
private List<IColumn<AppenderConfiguration, String>> initAppenderColumns() {
List<IColumn<AppenderConfiguration, String>> columns = new ArrayList<>();
IColumn column = new CheckBoxHeaderColumn<AppenderConfiguration>();
columns.add(column);
//name columns (editable)
column = new EditableLinkColumn<AppenderConfiguration>(createStringResource("LoggingConfigPanel.appenders.name"), "name") {
@Override
public void onClick(AjaxRequestTarget target, IModel<AppenderConfiguration> rowModel) {
appenderEditPerformed(target, rowModel);
}
@Override
protected Component createInputPanel(String componentId, IModel<AppenderConfiguration> model) {
TextPanel<String> panel = new TextPanel<String>(componentId, new PropertyModel(model, getPropertyExpression()));
panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
panel.getBaseFormComponent().add(new NotNullValidator<String>("message.emptyString"));
addAjaxFormComponentUpdatingBehavior(panel.getBaseFormComponent());
return panel;
}
};
columns.add(column);
//pattern column (editable)
column = new EditablePropertyColumn(createStringResource("LoggingConfigPanel.appenders.pattern"), "pattern") {
@Override
protected InputPanel createInputPanel(String componentId, IModel model) {
InputPanel panel = super.createInputPanel(componentId, model);
panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
panel.getBaseFormComponent().add(new NotNullValidator<String>("message.emptyString"));
addAjaxFormComponentUpdatingBehavior(panel.getBaseFormComponent());
return panel;
}
};
columns.add(column);
//file path column (editable)
column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.filePath"), "filePath");
columns.add(column);
//file pattern column (editable) jj
column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.filePattern"), "filePattern");
columns.add(column);
//max history column (editable)
column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.maxHistory"), "maxHistory") {
@Override
protected InputPanel createInputPanel(String componentId, IModel model) {
TextPanel panel = new TextPanel<>(componentId, new PropertyModel<String>(model, getPropertyExpression()));
FormComponent component = panel.getBaseFormComponent();
component.add(new AttributeModifier("size", 5));
component.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
addAjaxFormComponentUpdatingBehavior(component);
return panel;
}
};
columns.add(column);
//max file size column (editable)
column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.maxFileSize"), "maxFileSize") {
@Override
protected InputPanel createInputPanel(String componentId, IModel model) {
TextPanel<String> panel = new TextPanel<>(componentId, new PropertyModel<String>(model, getPropertyExpression()));
FormComponent component = panel.getBaseFormComponent();
component.add(new AttributeModifier("size", 5));
component.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
component.add(new NotNullValidator<String>("message.emptyString"));
addAjaxFormComponentUpdatingBehavior(component);
return panel;
}
};
columns.add(column);
CheckBoxColumn check = new EditableCheckboxColumn(createStringResource("LoggingConfigPanel.appenders.appending"), "appending") {
@Override
protected InputPanel createInputPanel(String componentId, IModel model) {
InputPanel panel = super.createInputPanel(componentId, model);
panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
panel.getBaseFormComponent().add(new NotNullValidator<String>("message.emptyString"));
addAjaxFormComponentUpdatingBehavior(panel.getBaseFormComponent());
return panel;
}
};
check.setEnabled(false);
columns.add(check);
return columns;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class PageAccounts method createAccountsColumns.
private List<IColumn> createAccountsColumns() {
List<IColumn> columns = new ArrayList<>();
columns.add(new PropertyColumn(createStringResource("PageAccounts.accounts.oid"), SelectableBean.F_VALUE + ".oid"));
columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.name"), ShadowType.F_NAME.getLocalPart(), SelectableBean.F_VALUE + ".name"));
columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.kind"), ShadowType.F_KIND.getLocalPart(), SelectableBean.F_VALUE + ".kind"));
columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.intent"), ShadowType.F_INTENT.getLocalPart(), SelectableBean.F_VALUE + ".intent"));
columns.add(new PropertyColumn<QName, String>(createStringResource("PageAccounts.accounts.objectClass"), ShadowType.F_OBJECT_CLASS.getLocalPart(), SelectableBean.F_VALUE + ".objectClass.localPart"));
columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.synchronizationSituation"), ShadowType.F_SYNCHRONIZATION_SITUATION.getLocalPart(), SelectableBean.F_VALUE + ".synchronizationSituation"));
columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.synchronizationTimestamp"), ShadowType.F_SYNCHRONIZATION_TIMESTAMP.getLocalPart(), SelectableBean.F_VALUE + ".synchronizationTimestamp"));
// columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.result"),
// ShadowType.F_RESULT.getLocalPart(), SelectableBean.F_VALUE + ".result.status"));
columns.add(new LinkColumn<SelectableBean>(createStringResource("PageAccounts.accounts.result")) {
@Override
protected IModel<String> createLinkModel(final IModel<SelectableBean> rowModel) {
return new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
OperationResultType result = getResult(rowModel);
if (result == null) {
return "";
}
return createStringResource("OperationResultStatusType." + result.getStatus()).getObject();
}
};
}
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean> rowModel) {
showShadowResult(target, rowModel);
}
});
columns.add(new LinkColumn<SelectableBean>(createStringResource("PageAccounts.accounts.owner")) {
@Override
protected IModel<String> createLinkModel(final IModel<SelectableBean> rowModel) {
return new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
FocusType focus = loadShadowOwner(rowModel);
return WebComponentUtil.getName(focus);
}
};
}
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean> rowModel) {
ownerDetailsPerformed(target, rowModel);
}
});
return columns;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project syncope by apache.
the class AccessTokenDirectoryPanel method getColumns.
@Override
protected List<IColumn<AccessTokenTO, String>> getColumns() {
List<IColumn<AccessTokenTO, String>> columns = new ArrayList<>();
columns.add(new KeyPropertyColumn<>(new StringResourceModel(Constants.KEY_FIELD_NAME, this), Constants.KEY_FIELD_NAME, Constants.KEY_FIELD_NAME));
columns.add(new PropertyColumn<>(new ResourceModel("owner"), "owner", "owner"));
columns.add(new AbstractColumn<AccessTokenTO, String>(new ResourceModel("issuedAt", "")) {
private static final long serialVersionUID = -1822504503325964706L;
@Override
public void populateItem(final Item<ICellPopulator<AccessTokenTO>> cellItem, final String componentId, final IModel<AccessTokenTO> model) {
JwsJwtCompactConsumer consumer = new JwsJwtCompactConsumer(model.getObject().getBody());
cellItem.add(new Label(componentId, SyncopeConsoleSession.get().getDateFormat().format(new Date(consumer.getJwtClaims().getIssuedAt()))));
}
});
columns.add(new DatePropertyColumn<>(new ResourceModel("expiryTime"), "expiryTime", "expiryTime"));
return columns;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project syncope by apache.
the class ParametersDirectoryPanel method getColumns.
@Override
protected List<IColumn<AttrTO, String>> getColumns() {
final List<IColumn<AttrTO, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<>(new ResourceModel("schema"), "schema"));
columns.add(new PropertyColumn<AttrTO, String>(new ResourceModel("values"), "values") {
private static final long serialVersionUID = -1822504503325964706L;
@Override
public void populateItem(final Item<ICellPopulator<AttrTO>> item, final String componentId, final IModel<AttrTO> rowModel) {
PlainSchemaTO modelSchemaTO = (PlainSchemaTO) rowModel.getObject().getSchemaInfo();
AttrSchemaType type = modelSchemaTO.getType();
if (type == AttrSchemaType.Binary || type == AttrSchemaType.Encrypted) {
item.add(new Label(componentId, type.name()).add(new AttributeModifier("style", "font-style:italic")));
} else {
super.populateItem(item, componentId, rowModel);
}
}
});
return columns;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project syncope by apache.
the class ReportDirectoryPanel method getColumns.
@Override
protected List<IColumn<ReportTO, String>> getColumns() {
final List<IColumn<ReportTO, String>> columns = new ArrayList<>();
columns.add(new KeyPropertyColumn<>(new StringResourceModel("key", this), "key"));
columns.add(new PropertyColumn<>(new StringResourceModel("name", this), "name", "name"));
columns.add(new DatePropertyColumn<>(new StringResourceModel("lastExec", this), "lastExec", "lastExec"));
columns.add(new DatePropertyColumn<>(new StringResourceModel("nextExec", this), "nextExec", "nextExec"));
columns.add(new DatePropertyColumn<>(new StringResourceModel("start", this), "start", "start"));
columns.add(new DatePropertyColumn<>(new StringResourceModel("end", this), "end", "end"));
columns.add(new PropertyColumn<>(new StringResourceModel("latestExecStatus", this), "latestExecStatus", "latestExecStatus"));
columns.add(new BooleanPropertyColumn<>(new StringResourceModel("active", this), "active", "active"));
columns.add(new AbstractColumn<ReportTO, String>(new Model<>(""), "running") {
private static final long serialVersionUID = 4209532514416998046L;
@Override
public void populateItem(final Item<ICellPopulator<ReportTO>> cellItem, final String componentId, final IModel<ReportTO> rowModel) {
JobTO jobTO = restClient.getJob(rowModel.getObject().getKey());
JobActionPanel panel = new JobActionPanel(componentId, jobTO, false, ReportDirectoryPanel.this, pageRef);
MetaDataRoleAuthorizationStrategy.authorize(panel, WebPage.ENABLE, String.format("%s,%s", StandardEntitlement.TASK_EXECUTE, StandardEntitlement.TASK_UPDATE));
cellItem.add(panel);
}
@Override
public String getCssClass() {
return "col-xs-1";
}
});
return columns;
}
Aggregations