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;
}
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());
}
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;
}
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;
}
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;
}
Aggregations