Search in sources :

Example 6 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project wiquery by WiQuery.

the class SortableBehaviorTestCase method setUp.

@Override
@Before
public void setUp() {
    super.setUp();
    sortableBehavior = new SortableBehavior();
    Panel panel = new DivTestPanel("panelId");
    WebMarkupContainer component = new WebMarkupContainer("anId");
    component.setMarkupId("anId");
    component.add(sortableBehavior);
    panel.add(component);
    tester.startComponentInPage(panel);
}
Also used : Panel(org.apache.wicket.markup.html.panel.Panel) DivTestPanel(org.odlabs.wiquery.ui.DivTestPanel) DivTestPanel(org.odlabs.wiquery.ui.DivTestPanel) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) Before(org.junit.Before)

Example 7 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project wiquery by WiQuery.

the class DialogUtilsBehaviorTestCase method setUp.

@Override
@Before
public void setUp() {
    super.setUp();
    dialogUtilsBehavior = new DialogUtilsBehavior();
    WebMarkupContainer anId = new WebMarkupContainer("anId") {

        private static final long serialVersionUID = 1L;

        @Override
        public Locale getLocale() {
            return Locale.FRENCH;
        }
    };
    anId.setMarkupId(anId.getId());
    anId.add(dialogUtilsBehavior);
}
Also used : WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) Before(org.junit.Before)

Example 8 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project wiquery by WiQuery.

the class DroppableBehaviorTestCase method setUp.

@Override
@Before
public void setUp() {
    super.setUp();
    droppableBehavior = new DroppableBehavior();
    Panel panel = new DivTestPanel("panelId");
    WebMarkupContainer component = new WebMarkupContainer("anId");
    component.setMarkupId("anId");
    component.add(droppableBehavior);
    panel.add(component);
    tester.startComponentInPage(panel);
}
Also used : Panel(org.apache.wicket.markup.html.panel.Panel) DivTestPanel(org.odlabs.wiquery.ui.DivTestPanel) DivTestPanel(org.odlabs.wiquery.ui.DivTestPanel) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) Before(org.junit.Before)

Example 9 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class PrismValuePanel method initLayout.

private void initLayout(IModel<String> labelModel, Form form, String valueCssClass, String inputCssClass) {
    //container
    WebMarkupContainer valueContainer = new WebMarkupContainer(ID_VALUE_CONTAINER);
    valueContainer.setOutputMarkupId(true);
    valueContainer.add(new AttributeModifier("class", valueCssClass));
    add(valueContainer);
    //feedback
    FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK);
    feedback.setOutputMarkupId(true);
    add(feedback);
    //input
    Panel input = createInputComponent(ID_INPUT, labelModel, form);
    input.add(new AttributeModifier("class", inputCssClass));
    if (input instanceof InputPanel) {
        initAccessBehaviour((InputPanel) input);
        feedback.setFilter(new ComponentFeedbackMessageFilter(((InputPanel) input).getBaseFormComponent()));
    } else if (input instanceof LockoutStatusPanel) {
        feedback.setFilter(new ComponentFeedbackMessageFilter(input));
    } else if (input instanceof ValueChoosePanel) {
        feedback.setFilter(new ComponentFeedbackMessageFilter(input));
    } else if (input instanceof AssociationValueChoicePanel) {
        feedback.setFilter(new ComponentFeedbackMessageFilter(((AssociationValueChoicePanel) input).getTextComponent()));
    }
    valueContainer.add(input);
    //buttons
    AjaxLink addButton = new AjaxLink(ID_ADD_BUTTON) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            addValue(target);
        }
    };
    addButton.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return isAddButtonVisible();
        }
    });
    valueContainer.add(addButton);
    AjaxLink removeButton = new AjaxLink(ID_REMOVE_BUTTON) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            removeValue(target);
        }
    };
    removeButton.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return isRemoveButtonVisible();
        }
    });
    valueContainer.add(removeButton);
}
Also used : LockoutStatusPanel(com.evolveum.midpoint.web.component.LockoutStatusPanel) AttributeModifier(org.apache.wicket.AttributeModifier) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) LockoutStatusPanel(com.evolveum.midpoint.web.component.LockoutStatusPanel) FeedbackPanel(org.apache.wicket.markup.html.panel.FeedbackPanel) AutoCompleteTextPanel(com.evolveum.midpoint.gui.api.component.autocomplete.AutoCompleteTextPanel) ValueChoosePanel(com.evolveum.midpoint.web.component.form.ValueChoosePanel) PasswordPanel(com.evolveum.midpoint.gui.api.component.password.PasswordPanel) ModificationsPanel(com.evolveum.midpoint.web.component.model.delta.ModificationsPanel) Panel(org.apache.wicket.markup.html.panel.Panel) AssociationValueChoicePanel(com.evolveum.midpoint.web.page.admin.users.component.AssociationValueChoicePanel) ComponentFeedbackMessageFilter(org.apache.wicket.feedback.ComponentFeedbackMessageFilter) FeedbackPanel(org.apache.wicket.markup.html.panel.FeedbackPanel) AssociationValueChoicePanel(com.evolveum.midpoint.web.page.admin.users.component.AssociationValueChoicePanel) ValueChoosePanel(com.evolveum.midpoint.web.component.form.ValueChoosePanel) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink)

Example 10 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class SceneItemLinePanel method initLayout.

private void initLayout() {
    WebMarkupContainer nameCell = new WebMarkupContainer(ID_NAME_CONTAINER);
    nameCell.add(new AttributeModifier("rowspan", new PropertyModel<Integer>(getModel(), SceneItemLineDto.F_NUMBER_OF_LINES)));
    Label label = new Label("name", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            final SceneItemLineDto lineDto = getModel().getObject();
            if (lineDto == null || lineDto.getName() == null) {
                return null;
            }
            String key = lineDto.getName();
            return getLocalizer().getString(key, SceneItemLinePanel.this, key);
        }
    });
    nameCell.add(label);
    nameCell.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return getModelObject().isFirst();
        }
    });
    add(nameCell);
    WebMarkupContainer oldValueCell = new WebMarkupContainer(ID_OLD_VALUE_CONTAINER);
    oldValueCell.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return getModelObject().isDelta();
        }
    });
    SceneItemValuePanel sivp = new SceneItemValuePanel(ID_OLD_VALUE, new PropertyModel<SceneItemValue>(getModel(), SceneItemLineDto.F_OLD_VALUE));
    sivp.setRenderBodyOnly(true);
    oldValueCell.add(sivp);
    ImagePanel oldValueImagePanel = new ImagePanel(ID_OLD_VALUE_IMAGE, Model.of(GuiStyleConstants.CLASS_MINUS_CIRCLE_DANGER), createStringResource("SceneItemLinePanel.removedValue"));
    oldValueImagePanel.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return getModelObject().getOldValue() != null && getModelObject().getOldValue().getSourceValue() != null;
        }
    });
    oldValueCell.add(oldValueImagePanel);
    add(oldValueCell);
    WebMarkupContainer newValueCell = new WebMarkupContainer(ID_NEW_VALUE_CONTAINER);
    sivp = new SceneItemValuePanel(ID_NEW_VALUE, new PropertyModel<SceneItemValue>(getModel(), SceneItemLineDto.F_NEW_VALUE));
    sivp.setRenderBodyOnly(true);
    newValueCell.add(sivp);
    newValueCell.add(new AttributeModifier("colspan", new AbstractReadOnlyModel<Integer>() {

        @Override
        public Integer getObject() {
            return !getModelObject().isDelta() && getModelObject().isDeltaScene() ? 2 : 1;
        }
    }));
    newValueCell.add(new AttributeModifier("align", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return !getModelObject().isDelta() && getModelObject().isDeltaScene() ? "center" : null;
        }
    }));
    ImagePanel newValueImagePanel = new ImagePanel(ID_NEW_VALUE_IMAGE, !getModelObject().isDelta() && getModelObject().isDeltaScene() ? Model.of(GuiStyleConstants.CLASS_CIRCLE_FULL) : Model.of(GuiStyleConstants.CLASS_PLUS_CIRCLE_SUCCESS), !getModelObject().isDelta() && getModelObject().isDeltaScene() ? createStringResource("SceneItemLinePanel.unchangedValue") : createStringResource("SceneItemLinePanel.addedValue"));
    newValueImagePanel.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return getModelObject().getNewValue() != null && getModelObject().getNewValue().getSourceValue() != null;
        }
    });
    newValueImagePanel.add(new AttributeAppender("style", !getModelObject().isDelta() && getModelObject().isDeltaScene() ? "float: left; margin-right: 5px; width: 30%; position: absolute;" : "float: left; margin-right: 5px;"));
    newValueCell.add(newValueImagePanel);
    add(newValueCell);
}
Also used : SceneItemValue(com.evolveum.midpoint.model.api.visualizer.SceneItemValue) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) PropertyModel(org.apache.wicket.model.PropertyModel) Label(org.apache.wicket.markup.html.basic.Label) AttributeModifier(org.apache.wicket.AttributeModifier) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AttributeAppender(org.apache.wicket.behavior.AttributeAppender) ImagePanel(com.evolveum.midpoint.web.component.data.column.ImagePanel)

Aggregations

WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)224 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)103 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)101 Label (org.apache.wicket.markup.html.basic.Label)95 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)57 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)44 List (java.util.List)41 ListItem (org.apache.wicket.markup.html.list.ListItem)41 ArrayList (java.util.ArrayList)39 ListView (org.apache.wicket.markup.html.list.ListView)37 PropertyModel (org.apache.wicket.model.PropertyModel)34 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)26 TextField (org.apache.wicket.markup.html.form.TextField)25 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)21 AttributeModifier (org.apache.wicket.AttributeModifier)21 Form (org.apache.wicket.markup.html.form.Form)21 IModel (org.apache.wicket.model.IModel)21 Model (org.apache.wicket.model.Model)18 AjaxFormComponentUpdatingBehavior (org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior)17 InfoTooltipBehavior (com.evolveum.midpoint.web.util.InfoTooltipBehavior)16