Search in sources :

Example 16 with ResourceModel

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;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) Serializable(java.io.Serializable) StringResourceModel(org.apache.wicket.model.StringResourceModel) ResourceModel(org.apache.wicket.model.ResourceModel) ActionLink(org.apache.syncope.client.console.wicket.markup.html.form.ActionLink)

Example 17 with ResourceModel

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");
    }
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) ResourceModel(org.apache.wicket.model.ResourceModel)

Example 18 with ResourceModel

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));
}
Also used : StringValidator(org.apache.wicket.validation.validator.StringValidator) ResourceModel(org.apache.wicket.model.ResourceModel) RequiredTextField(org.apache.wicket.markup.html.form.RequiredTextField) SimpleFormComponentLabel(org.apache.wicket.markup.html.form.SimpleFormComponentLabel)

Example 19 with ResourceModel

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);
}
Also used : ResourceModel(org.apache.wicket.model.ResourceModel) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 20 with ResourceModel

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);
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) ResourceModel(org.apache.wicket.model.ResourceModel) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

Aggregations

ResourceModel (org.apache.wicket.model.ResourceModel)48 ArrayList (java.util.ArrayList)20 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)19 Label (org.apache.wicket.markup.html.basic.Label)17 StringResourceModel (org.apache.wicket.model.StringResourceModel)15 Panel (org.apache.wicket.markup.html.panel.Panel)11 List (java.util.List)9 AbstractTab (org.apache.wicket.extensions.markup.html.tabs.AbstractTab)9 AjaxBootstrapTabbedPanel (de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel)8 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)8 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)8 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)6 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)5 Form (org.apache.wicket.markup.html.form.Form)5 Serializable (java.io.Serializable)4 HashMap (java.util.HashMap)4 WizardMgtPanel (org.apache.syncope.client.console.wizards.WizardMgtPanel)4 Fragment (org.apache.wicket.markup.html.panel.Fragment)4 NavbarButton (de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton)3 StringUtils (org.apache.commons.lang3.StringUtils)3