use of org.apache.wicket.AttributeModifier 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.AttributeModifier in project ocvn by devgateway.
the class DateTimeFieldBootstrapFormComponent method onInitialize.
/*
* (non-Javadoc)
*
* @see org.devgateway.toolkit.forms.wicket.components.form.
* GenericBootstrapFormComponent#onConfigure()
*/
@Override
protected void onInitialize() {
super.onInitialize();
border.add(new AttributeModifier("style", "position:relative;"));
IndicatingAjaxLink<String> clearDateLink = new IndicatingAjaxLink<String>("clearDate") {
private static final long serialVersionUID = -1705495886974891511L;
@Override
public void onClick(final AjaxRequestTarget target) {
DateTimeFieldBootstrapFormComponent.this.field.setModelObject(null);
target.add(DateTimeFieldBootstrapFormComponent.this.field);
}
};
border.add(clearDateLink);
}
use of org.apache.wicket.AttributeModifier in project oc-explorer by devgateway.
the class DateTimeFieldBootstrapFormComponent method onInitialize.
/*
* (non-Javadoc)
*
* @see org.devgateway.toolkit.forms.wicket.components.form.
* GenericBootstrapFormComponent#onConfigure()
*/
@Override
protected void onInitialize() {
super.onInitialize();
border.add(new AttributeModifier("style", "position:relative;"));
IndicatingAjaxLink<String> clearDateLink = new IndicatingAjaxLink<String>("clearDate") {
private static final long serialVersionUID = -1705495886974891511L;
@Override
public void onClick(final AjaxRequestTarget target) {
DateTimeFieldBootstrapFormComponent.this.field.setModelObject(null);
target.add(DateTimeFieldBootstrapFormComponent.this.field);
}
};
border.add(clearDateLink);
}
use of org.apache.wicket.AttributeModifier in project oc-explorer by devgateway.
the class BootstrapPagingNavigation method populateItem.
@Override
protected void populateItem(final LoopItem loopItem) {
super.populateItem(loopItem);
final long pageIndex = getStartIndex() + loopItem.getIndex();
// Add disabled class to enclosing list item.
loopItem.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
if (pageable.getCurrentPage() == pageIndex) {
return "active";
} else {
return "";
}
}
}));
// Do not mask disabled link by em tag.
// ((AbstractLink)
// loopItem.get("pageLink")).setBeforeDisabledLink("").setAfterDisabledLink("");
}
Aggregations