use of org.apache.wicket.model.ResourceModel in project syncope by apache.
the class GroupDirectoryPanel method getHeader.
@Override
public ActionsPanel<Serializable> getHeader(final String componentId) {
final ActionsPanel<Serializable> panel = super.getHeader(componentId);
panel.add(new ActionLink<Serializable>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final Serializable ignore) {
target.add(displayAttributeModal.setContent(new GroupDisplayAttributesModalPanel<>(displayAttributeModal, page.getPageReference(), pSchemaNames, dSchemaNames)));
displayAttributeModal.header(new ResourceModel("any.attr.display"));
displayAttributeModal.show(true);
}
}, ActionType.CHANGE_VIEW, StandardEntitlement.GROUP_READ).hideLabel();
return panel;
}
use of org.apache.wicket.model.ResourceModel in project syncope by apache.
the class MultilevelPanel method next.
public final void next(final String title, final SecondLevel secondLevel, final AjaxRequestTarget target) {
if (isFirstLevel) {
secondLevelContainer.addOrReplace(new Label("title", new ResourceModel(title, title)));
secondLevelContainer.addOrReplace(secondLevel);
secondLevelContainer.setVisible(true);
target.add(secondLevelContainer);
firstLevelContainer.setVisible(false);
target.add(firstLevelContainer);
isFirstLevel = false;
} else {
LOG.warn("No further level available");
}
}
use of org.apache.wicket.model.ResourceModel in project wicket by apache.
the class FormPage method addFormComponents.
private void addFormComponents(final Form<Bean> form) {
FormComponent<String> fc = new RequiredTextField<>("name");
fc.add(new StringValidator(4, null));
fc.setLabel(new ResourceModel("label.name"));
// add AjaxPreventSubmitBehavior to the text field if it mustn't submit
// the form when ENTER is pressed
// fc.add(new AjaxPreventSubmitBehavior());
form.add(fc);
form.add(new SimpleFormComponentLabel("name-label", fc));
fc = new RequiredTextField<>("email");
fc.add(EmailAddressValidator.getInstance());
fc.setLabel(new ResourceModel("label.email"));
form.add(fc);
form.add(new SimpleFormComponentLabel("email-label", fc));
}
use of org.apache.wicket.model.ResourceModel in project wiquery by WiQuery.
the class ButtonTestPage method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
behavior = new ButtonBehavior();
if (addBefore)
behavior.setLabel(new ResourceModel("key"));
WebMarkupContainer link = new WebMarkupContainer("link");
link.add(behavior);
if (!addBefore)
behavior.setLabel(new ResourceModel("key"));
add(link);
}
use of org.apache.wicket.model.ResourceModel in project midpoint by Evolveum.
the class DeltaPanel method initLayout.
protected void initLayout() {
Label changeType = new Label(ID_CHANGE_TYPE, new PropertyModel<String>(getModel(), DeltaDto.F_CHANGE_TYPE));
add(changeType);
VisibleEnableBehaviour isAdd = new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return getModel().getObject().isAdd();
}
};
VisibleEnableBehaviour isNotAdd = new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return !getModel().getObject().isAdd();
}
};
Label oidLabel = new Label(ID_OID_LABEL, new ResourceModel("DeltaPanel.label.oid"));
oidLabel.add(isNotAdd);
add(oidLabel);
Label oid = new Label(ID_OID, new PropertyModel<String>(getModel(), DeltaDto.F_OID));
oid.add(isNotAdd);
add(oid);
VisibleEnableBehaviour never = new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return false;
}
};
Label objectToAddLabel = new Label(ID_OBJECT_TO_ADD_LABEL, new ResourceModel("DeltaPanel.label.objectToAdd"));
// objectToAddLabel.add(isAdd);
objectToAddLabel.add(never);
add(objectToAddLabel);
ContainerValuePanel objectToAddPanel = new ContainerValuePanel(ID_OBJECT_TO_ADD, new PropertyModel<>(getModel(), DeltaDto.F_OBJECT_TO_ADD));
objectToAddPanel.add(isAdd);
add(objectToAddPanel);
Label modificationsLabel = new Label(ID_MODIFICATIONS_LABEL, new ResourceModel("DeltaPanel.label.modifications"));
// modificationsLabel.add(isNotAdd);
modificationsLabel.add(never);
add(modificationsLabel);
ModificationsPanel modificationsPanel = new ModificationsPanel(ID_MODIFICATIONS, getModel());
modificationsPanel.add(isNotAdd);
add(modificationsPanel);
}
Aggregations