Search in sources :

Example 1 with HighLightBehavior

use of io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior in project the-app by devops-dojo.

the class ProductCatalogPage method productsWrapper.

private Component productsWrapper() {
    WebMarkupContainer productsWrapper = new WebMarkupContainer("productsWrapper");
    productsWrapper.add(rowView());
    productsWrapper.add(new HighLightBehavior());
    return productsWrapper;
}
Also used : HighLightBehavior(io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 2 with HighLightBehavior

use of io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior in project the-app by devops-dojo.

the class ProductItemListPanel method listWrapper.

private Component listWrapper(String recommenderType) {
    WebMarkupContainer listWrapper = new WebMarkupContainer("listWrapper");
    listWrapper.add(topicLabel());
    listWrapper.add(productList(recommenderType));
    return listWrapper.add(new HighLightBehavior());
}
Also used : HighLightBehavior(io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 3 with HighLightBehavior

use of io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior in project the-app by devops-dojo.

the class NavigationPanel method otherNavigation.

private Component otherNavigation() {
    WebMarkupContainer otherNavigationWrapper = new WebMarkupContainer("otherNavigationWrapper");
    otherNavigationWrapper.add(new ListView<NavigationGroup>("otherNavigation", otherNavigationModel()) {

        private static final long serialVersionUID = 5452289050410685190L;

        public int counter = 0;

        @Override
        protected void populateItem(ListItem<NavigationGroup> listItem) {
            listItem.add(dropDown(listItem));
        }

        private Component dropDown(ListItem<NavigationGroup> listItem) {
            WebMarkupContainer dropdown = new WebMarkupContainer("dropdown");
            IModel<String> id = Model.of("menu" + counter++);
            dropdown.add(new AttributeModifier("id", id));
            dropdown.add(navigationLink(listItem, id));
            ListView<NavigationEntry> items = navigationEntryView("items", navigationEntries(listItem.getModel()));
            dropdown.add(items);
            dropdown.setVisibilityAllowed(isVisible(items));
            return dropdown;
        }

        private boolean isVisible(ListView<NavigationEntry> items) {
            boolean result = false;
            for (NavigationEntry entry : items.getList()) {
                result |= entry.isVisible();
            }
            return result;
        }

        private WebMarkupContainer navigationLink(ListItem<NavigationGroup> listItem, IModel<String> id) {
            WebMarkupContainer link = new WebMarkupContainer("link");
            link.add(new Label("name", new PropertyModel<String>(listItem.getModel(), "name")));
            link.add(new AttributeModifier("href", "#" + id.getObject()));
            return link;
        }

        private IModel<List<NavigationEntry>> navigationEntries(final IModel<NavigationGroup> navigationGroupModel) {
            return new AbstractReadOnlyModel<List<NavigationEntry>>() {

                private static final long serialVersionUID = 5373877077756361153L;

                @Override
                public List<NavigationEntry> getObject() {
                    return navigationGroupModel.getObject().getNavigationEntries();
                }
            };
        }
    });
    otherNavigationWrapper.add(new HighLightBehavior());
    return otherNavigationWrapper;
}
Also used : HighLightBehavior(io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior) Label(org.apache.wicket.markup.html.basic.Label) AttributeModifier(org.apache.wicket.AttributeModifier) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) ListView(org.apache.wicket.markup.html.list.ListView) LinkedList(java.util.LinkedList) List(java.util.List) Component(org.apache.wicket.Component)

Example 4 with HighLightBehavior

use of io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior in project the-app by devops-dojo.

the class NavigationPanel method mainNavigation.

private Component mainNavigation() {
    WebMarkupContainer mainNavigationWrapper = new WebMarkupContainer("mainNavigationWrapper");
    mainNavigationWrapper.add(navigationEntryView("mainNavigation", mainNavigationEntriesModel()));
    mainNavigationWrapper.add(new HighLightBehavior());
    return mainNavigationWrapper;
}
Also used : HighLightBehavior(io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 5 with HighLightBehavior

use of io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior in project the-app by devops-dojo.

the class ProductItemListPanel method productList.

private DataView<ProductInfo> productList(final String parentTag) {
    DataView<ProductInfo> productsView = new DataView<ProductInfo>("products", productsProvider()) {

        @Override
        protected void populateItem(Item<ProductInfo> item) {
            item.add(newProductItemPanel("product", parentTag, item.getModel()));
        }
    };
    productsView.add(new HighLightBehavior());
    return productsView;
}
Also used : ProductInfo(io.github.zutherb.appstash.shop.service.product.model.ProductInfo) DataView(org.apache.wicket.markup.repeater.data.DataView) Item(org.apache.wicket.markup.repeater.Item) HighLightBehavior(io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior)

Aggregations

HighLightBehavior (io.github.zutherb.appstash.shop.ui.panel.base.HighLightBehavior)5 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)4 ProductInfo (io.github.zutherb.appstash.shop.service.product.model.ProductInfo)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 AttributeModifier (org.apache.wicket.AttributeModifier)1 Component (org.apache.wicket.Component)1 Label (org.apache.wicket.markup.html.basic.Label)1 ListView (org.apache.wicket.markup.html.list.ListView)1 Item (org.apache.wicket.markup.repeater.Item)1 DataView (org.apache.wicket.markup.repeater.data.DataView)1