use of org.apache.wicket.markup.html.TransparentWebMarkupContainer in project ocvn by devgateway.
the class VietnamImportPage method addLogText.
protected void addLogText() {
importContainer = new TransparentWebMarkupContainer("importContainer");
importContainer.setOutputMarkupId(true);
importForm.add(importContainer);
AbstractReadOnlyModel<String> logTextModel = new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return vnExcelImportService.getMsgBuffer().toString();
}
};
logText = new LogLabel("logText", logTextModel) {
private static final long serialVersionUID = 1L;
@Override
protected void onPostProcessTarget(final AjaxRequestTarget target) {
if (threadPoolTaskExecutor.getActiveCount() == 0) {
getSelfUpdatingBehavior().stop(target);
spinner.setVisibilityAllowed(false);
target.add(spinner);
}
}
};
importContainer.add(logText);
spinner = new WebMarkupContainer("spinner");
spinner.setOutputMarkupId(true);
importContainer.add(spinner);
}
use of org.apache.wicket.markup.html.TransparentWebMarkupContainer in project wicket by apache.
the class Enclosure method resolveChild.
/**
* Searches for the controlling child component looking also
* through transparent components.
*
* @param container
* the current container
* @return the controlling child component, null if no one is found
*/
private Component resolveChild(MarkupContainer container) {
Component childController = container.get(childId);
Iterator<Component> children = container.iterator();
while (children.hasNext() && childController == null) {
Component transparentChild = children.next();
if (transparentChild instanceof TransparentWebMarkupContainer) {
childController = resolveChild((MarkupContainer) transparentChild);
}
}
return childController;
}
use of org.apache.wicket.markup.html.TransparentWebMarkupContainer in project wicket by apache.
the class WicketMessageTagHandler method resolve.
@Override
public Component resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag) {
// localize any raw markup that has wicket:message attrs
if ((tag != null) && (tag.getId().startsWith(getWicketMessageIdPrefix(markupStream)))) {
Component wc;
String id = tag.getId();
if (tag.isOpenClose()) {
wc = new WebComponent(id);
} else {
wc = new TransparentWebMarkupContainer(id);
}
return wc;
}
return null;
}
use of org.apache.wicket.markup.html.TransparentWebMarkupContainer in project midpoint by Evolveum.
the class PageBase method initLayout.
private void initLayout() {
TransparentWebMarkupContainer body = new TransparentWebMarkupContainer(ID_BODY);
// body.add(new AttributeAppender("class", "hold-transition ", " "));
// body.add(new AttributeAppender("class", "custom-hold-transition ", " "));
body.add(AttributeAppender.append("class", new IModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
DeploymentInformationType info = MidPointApplication.get().getDeploymentInfo();
if (info == null || StringUtils.isEmpty(info.getSkin())) {
return CLASS_DEFAULT_SKIN;
}
return info.getSkin();
}
}));
add(body);
WebMarkupContainer mainHeader = new WebMarkupContainer(ID_MAIN_HEADER);
mainHeader.setOutputMarkupId(true);
add(mainHeader);
AjaxLink<String> logo = new AjaxLink<>(ID_LOGO) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
Class<? extends Page> page = MidPointApplication.get().getHomePage();
setResponsePage(page);
}
};
logo.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return !isCustomLogoVisible();
}
@Override
public boolean isEnabled() {
return isLogoLinkEnabled();
}
});
mainHeader.add(logo);
AjaxLink<String> customLogo = new AjaxLink<>(ID_CUSTOM_LOGO) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
// TODO may be this should lead to customerUrl ?
Class<? extends Page> page = MidPointApplication.get().getHomePage();
setResponsePage(page);
}
};
customLogo.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return isCustomLogoVisible();
}
});
mainHeader.add(customLogo);
WebMarkupContainer navigation = new WebMarkupContainer(ID_NAVIGATION);
navigation.setOutputMarkupId(true);
mainHeader.add(navigation);
IModel<IconType> logoModel = new IModel<>() {
private static final long serialVersionUID = 1L;
@Override
public IconType getObject() {
DeploymentInformationType info = MidPointApplication.get().getDeploymentInfo();
return info != null ? info.getLogo() : null;
}
};
ExternalImage customLogoImgSrc = new ExternalImage(ID_CUSTOM_LOGO_IMG_SRC) {
@Override
protected void buildSrcAttribute(ComponentTag tag, IModel<?> srcModel) {
tag.put("src", WebComponentUtil.getIconUrlModel(logoModel.getObject()).getObject());
}
};
customLogoImgSrc.add(new VisibleBehaviour(() -> logoModel.getObject() != null && StringUtils.isEmpty(logoModel.getObject().getCssClass())));
WebMarkupContainer customLogoImgCss = new WebMarkupContainer(ID_CUSTOM_LOGO_IMG_CSS);
customLogoImgCss.add(new VisibleBehaviour(() -> logoModel.getObject() != null && StringUtils.isNotEmpty(logoModel.getObject().getCssClass())));
customLogoImgCss.add(new AttributeAppender("class", new IModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return logoModel.getObject() != null ? logoModel.getObject().getCssClass() : null;
}
}));
mainHeader.add(new AttributeAppender("style", new IModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return logoModel.getObject() != null ? "background-color: " + GuiStyleConstants.DEFAULT_BG_COLOR + " !important;" : null;
}
}));
customLogo.add(customLogoImgSrc);
customLogo.add(customLogoImgCss);
Label title = new Label(ID_TITLE, createPageTitleModel());
title.setRenderBodyOnly(true);
add(title);
initHeaderLayout(navigation);
initTitleLayout(navigation);
logo.add(createHeaderColorStyleModel(false));
customLogo.add(createHeaderColorStyleModel(false));
mainHeader.add(createHeaderColorStyleModel(false));
navigation.add(createHeaderColorStyleModel(true));
initDebugBarLayout();
LeftMenuPanel sidebarMenu = new LeftMenuPanel(ID_SIDEBAR_MENU);
sidebarMenu.add(createUserStatusBehaviour());
add(sidebarMenu);
WebMarkupContainer footerContainer = new WebMarkupContainer(ID_FOOTER_CONTAINER);
footerContainer.add(new VisibleBehaviour(() -> !isErrorPage() && isFooterVisible()));
add(footerContainer);
WebMarkupContainer version = new WebMarkupContainer(ID_VERSION) {
private static final long serialVersionUID = 1L;
@Deprecated
public String getDescribe() {
return PageBase.this.getDescribe();
}
};
version.add(new VisibleBehaviour(() -> isFooterVisible() && RuntimeConfigurationType.DEVELOPMENT.equals(getApplication().getConfigurationType())));
footerContainer.add(version);
WebMarkupContainer copyrightMessage = new WebMarkupContainer(ID_COPYRIGHT_MESSAGE);
copyrightMessage.add(getFooterVisibleBehaviour());
footerContainer.add(copyrightMessage);
Label subscriptionMessage = new Label(ID_SUBSCRIPTION_MESSAGE, new IModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
String subscriptionId = getSubscriptionId();
if (StringUtils.isEmpty(subscriptionId)) {
return "";
}
if (!WebComponentUtil.isSubscriptionIdCorrect(subscriptionId)) {
return " " + createStringResource("PageBase.nonActiveSubscriptionMessage").getString();
}
if (SubscriptionType.DEMO_SUBSRIPTION.getSubscriptionType().equals(subscriptionId.substring(0, 2))) {
return " " + createStringResource("PageBase.demoSubscriptionMessage").getString();
}
return "";
}
});
subscriptionMessage.setOutputMarkupId(true);
subscriptionMessage.add(getFooterVisibleBehaviour());
footerContainer.add(subscriptionMessage);
WebMarkupContainer feedbackContainer = new WebMarkupContainer(ID_FEEDBACK_CONTAINER);
feedbackContainer.setOutputMarkupId(true);
feedbackContainer.setOutputMarkupPlaceholderTag(true);
add(feedbackContainer);
FeedbackAlerts feedbackList = new FeedbackAlerts(ID_FEEDBACK);
feedbackList.setOutputMarkupId(true);
feedbackList.setOutputMarkupPlaceholderTag(true);
feedbackContainer.add(feedbackList);
MainPopupDialog mainPopup = new MainPopupDialog(ID_MAIN_POPUP);
// mainPopup.showUnloadConfirmation(false);
// mainPopup.setResizable(false);
add(mainPopup);
}
use of org.apache.wicket.markup.html.TransparentWebMarkupContainer in project ocvn by devgateway.
the class ListViewSectionPanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
setOutputMarkupId(true);
setOutputMarkupPlaceholderTag(true);
listWrapper = new TransparentWebMarkupContainer("listWrapper");
listWrapper.setOutputMarkupId(true);
add(listWrapper);
listWrapper.add(new Label("panelTitle", title));
listView = new ListView<T>("list", getModel()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<T> item) {
// we wrap the item model on a compound model so we can use the field ids as property models
final CompoundPropertyModel<T> compoundPropertyModel = new CompoundPropertyModel<>(item.getModel());
// we set back the model as the compound model, thus ensures the rest of the items added will benefit
item.setModel(compoundPropertyModel);
// we add the rest of the items in the listItem
populateCompoundListItem(item);
// we add the remove button
final BootstrapDeleteButton removeButton = getRemoveChildButton(item.getIndex());
item.add(removeButton);
}
};
listView.setReuseItems(true);
listView.setOutputMarkupId(true);
listWrapper.add(listView);
final BootstrapAddButton addButton = getAddNewChildButton();
add(addButton);
}
Aggregations