Search in sources :

Example 1 with BootstrapLabel

use of com.evolveum.midpoint.web.component.BootstrapLabel in project midpoint by Evolveum.

the class H3Header method initLayout.

@Override
protected void initLayout() {
    Label title = new Label(ID_TITLE, new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return getDisplayName();
        }
    });
    add(title);
    final IModel<List<InlineMenuItem>> items = new Model((Serializable) createMenuItems());
    BootstrapLabel status = new BootstrapLabel(ID_STATUS, createStringResource("H3Header.label.error"), new Model(BootstrapLabel.State.DANGER));
    status.add(createFetchErrorVisibleBehaviour());
    add(status);
    AjaxLink showMore = new AjaxLink(ID_SHOW_MORE) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            onShowMorePerformed(target);
        }
    };
    showMore.add(createFetchErrorVisibleBehaviour());
    add(showMore);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) BootstrapLabel(com.evolveum.midpoint.web.component.BootstrapLabel) Label(org.apache.wicket.markup.html.basic.Label) BootstrapLabel(com.evolveum.midpoint.web.component.BootstrapLabel) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) Model(org.apache.wicket.model.Model) IModel(org.apache.wicket.model.IModel) ArrayList(java.util.ArrayList) List(java.util.List) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink)

Example 2 with BootstrapLabel

use of com.evolveum.midpoint.web.component.BootstrapLabel in project midpoint by Evolveum.

the class CheckTableHeader method initLayout.

private void initLayout() {
    AjaxCheckBox check = new AjaxCheckBox(ID_CHECK, new PropertyModel<Boolean>(getModel(), ObjectWrapper.F_SELECTED)) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
        }
    };
    add(check);
    Label icon = new Label(ID_ICON);
    icon.add(AttributeModifier.replace("class", new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return "check-table-header-icon " + createAccountIcon();
        }
    }));
    add(icon);
    Label trigger = new Label(ID_TRIGGER);
    trigger.add(AttributeModifier.replace("title", new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return createTriggerTooltip();
        }
    }));
    trigger.add(new TooltipBehavior());
    trigger.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return hasTriggers();
        }
    });
    add(trigger);
    BootstrapLabel status = new BootstrapLabel(ID_STATUS, createStringResource("CheckTableHeader.label.error"), new Model<>(BootstrapLabel.State.DANGER));
    status.add(createFetchErrorVisibleBehaviour());
    add(status);
    AjaxLink showMore = new AjaxLink(ID_SHOW_MORE) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            onShowMorePerformed(target);
        }
    };
    showMore.add(createFetchErrorVisibleBehaviour());
    add(showMore);
    AjaxLink link = new AjaxLink(ID_LINK) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            onClickPerformed(target);
        }
    };
    add(link);
    Label name = new Label(ID_NAME, new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return getDisplayName();
        }
    });
    link.add(name);
    Label description = new Label(ID_DESCRIPTION, new AbstractReadOnlyModel<String>() {

        private static final long serialVersionUID = 1L;

        @Override
        public String getObject() {
            return getDescription();
        }
    });
    add(description);
    ToggleIconButton expandButton = new ToggleIconButton(ID_EXPAND, GuiStyleConstants.CLASS_ICON_EXPAND, GuiStyleConstants.CLASS_ICON_COLLAPSE) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            onClickPerformed(target);
        }

        @Override
        public boolean isOn() {
            return !CheckTableHeader.this.getModelObject().isMinimalized();
        }
    };
    add(expandButton);
}
Also used : ToggleIconButton(com.evolveum.midpoint.gui.api.component.togglebutton.ToggleIconButton) BootstrapLabel(com.evolveum.midpoint.web.component.BootstrapLabel) Label(org.apache.wicket.markup.html.basic.Label) BootstrapLabel(com.evolveum.midpoint.web.component.BootstrapLabel) AjaxCheckBox(org.apache.wicket.ajax.markup.html.form.AjaxCheckBox) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) TooltipBehavior(com.evolveum.midpoint.web.util.TooltipBehavior) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink)

Aggregations

BootstrapLabel (com.evolveum.midpoint.web.component.BootstrapLabel)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)2 Label (org.apache.wicket.markup.html.basic.Label)2 ToggleIconButton (com.evolveum.midpoint.gui.api.component.togglebutton.ToggleIconButton)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 TooltipBehavior (com.evolveum.midpoint.web.util.TooltipBehavior)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 AjaxCheckBox (org.apache.wicket.ajax.markup.html.form.AjaxCheckBox)1 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)1 IModel (org.apache.wicket.model.IModel)1 Model (org.apache.wicket.model.Model)1