use of org.apache.wicket.AttributeModifier 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 org.apache.wicket.AttributeModifier in project midpoint by Evolveum.
the class TooltipBehavior method onConfigure.
@Override
public void onConfigure(final Component component) {
component.setOutputMarkupId(true);
component.add(AttributeModifier.replace("data-toggle", "tooltip"));
component.add(new AttributeModifier("data-placement", getDataPlacement()) {
@Override
protected String newValue(String currentValue, String replacementValue) {
if (StringUtils.isEmpty(currentValue)) {
return replacementValue;
}
return currentValue;
}
});
}
use of org.apache.wicket.AttributeModifier in project ocvn 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("");
}
use of org.apache.wicket.AttributeModifier in project gitblit by gitblit.
the class TicketPage method addDateAttributions.
protected void addDateAttributions(MarkupContainer container, Change entry) {
container.add(WicketUtils.createDateLabel("changeDate", entry.date, GitBlitWebSession.get().getTimezone(), getTimeUtils(), false));
// set the id attribute
if (entry.hasComment()) {
container.setOutputMarkupId(true);
container.add(new AttributeModifier("id", Model.of(entry.getId())));
ExternalLink link = new ExternalLink("changeLink", "#" + entry.getId());
container.add(link);
} else {
container.add(new Label("changeLink").setVisible(false));
}
}
use of org.apache.wicket.AttributeModifier in project midpoint by Evolveum.
the class TablePanel method setStyle.
public void setStyle(String value) {
Validate.notEmpty(value, "Value must not be null or empty.");
DataTable table = getDataTable();
table.add(new AttributeModifier("style", new Model(value)));
}
Aggregations