use of org.apache.wicket.Component in project midpoint by Evolveum.
the class UploadDownloadPanel method removeFilePerformed.
public void removeFilePerformed(AjaxRequestTarget target) {
Component input = get(ID_INPUT_FILE);
try {
updateValue(null);
LOGGER.trace("Remove file success.");
input.success(getString("UploadPanel.message.removeSuccess"));
} catch (Exception e) {
LOGGER.trace("Remove file error.", e);
input.error(getString("UploadPanel.message.removeError") + " " + e.getMessage());
}
}
use of org.apache.wicket.Component in project midpoint by Evolveum.
the class DropDownFormGroup method initLayout.
private void initLayout(IModel<List<T>> choices, IChoiceRenderer<T> renderer, IModel<String> label, final String tooltipKey, boolean isTooltipInModal, String labelSize, String textSize, final boolean required) {
WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
add(labelContainer);
Label l = new Label(ID_LABEL, label);
if (StringUtils.isNotEmpty(labelSize)) {
labelContainer.add(AttributeAppender.prepend("class", labelSize));
}
labelContainer.add(l);
Label tooltipLabel = new Label(ID_TOOLTIP, new Model<>());
tooltipLabel.add(new AttributeAppender("data-original-title", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getString(tooltipKey);
}
}));
tooltipLabel.add(new InfoTooltipBehavior(isTooltipInModal));
tooltipLabel.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return tooltipKey != null;
}
});
tooltipLabel.setOutputMarkupId(true);
tooltipLabel.setOutputMarkupPlaceholderTag(true);
labelContainer.add(tooltipLabel);
WebMarkupContainer requiredContainer = new WebMarkupContainer(ID_REQUIRED);
requiredContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return required;
}
});
labelContainer.add(requiredContainer);
WebMarkupContainer selectWrapper = new WebMarkupContainer(ID_SELECT_WRAPPER);
if (StringUtils.isNotEmpty(textSize)) {
selectWrapper.add(AttributeAppender.prepend("class", textSize));
}
add(selectWrapper);
DropDownChoice select = createDropDown(ID_SELECT, choices, renderer, required);
select.setLabel(label);
selectWrapper.add(select);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(select));
feedback.setOutputMarkupId(true);
selectWrapper.add(feedback);
Component additionalInfo = createAdditionalInfoComponent(ID_ADDITIONAL_INFO);
if (additionalInfo == null) {
additionalInfo = new Label(ID_ADDITIONAL_INFO, "");
}
selectWrapper.add(additionalInfo);
}
use of org.apache.wicket.Component in project midpoint by Evolveum.
the class TestConnectionResultPanel method initLayout.
private void initLayout(Page parentPage) {
WebMarkupContainer contentPanel = new WebMarkupContainer(ID_CONTENT_PANEL);
contentPanel.setOutputMarkupId(true);
add(contentPanel);
Label messageLabel = new Label(ID_MESSAGE, ((PageBase) parentPage).createStringResource("TestConnectionResultPanel.message"));
messageLabel.setOutputMarkupId(true);
contentPanel.add(messageLabel);
messageLabel.add(new VisibleEnableBehaviour() {
public boolean isVisible() {
return !isLoaded;
}
});
AjaxLazyLoadPanel resultsPanel = new AjaxLazyLoadPanel(ID_RESULT) {
@Override
public Component getLazyLoadComponent(String id) {
return new TestConnectionMessagesPanel(id, resourceOid, (PageBase) parentPage);
}
@Override
protected void onComponentLoaded(Component component, AjaxRequestTarget target) {
isLoaded = true;
target.add(component);
target.add(messageLabel);
}
};
contentPanel.add(resultsPanel);
AjaxButton ok = new AjaxButton(ID_OK) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
getPageBase().hideMainPopup(target);
okPerformed(target);
}
};
contentPanel.add(ok);
}
use of org.apache.wicket.Component in project midpoint by Evolveum.
the class WebComponentUtil method debugDumpComponentTree.
private static void debugDumpComponentTree(StringBuilder sb, Component c, int level) {
DebugUtil.indentDebugDump(sb, level);
sb.append(c).append("\n");
if (c instanceof MarkupContainer) {
for (Component sub : (MarkupContainer) c) {
debugDumpComponentTree(sb, sub, level + 1);
}
}
}
use of org.apache.wicket.Component in project midpoint by Evolveum.
the class InfoTooltipBehavior method getModalContainer.
@Override
public String getModalContainer(Component component) {
String id = component.getMarkupId();
if (component.getParent() != null) {
Component parent = component.getParent();
id = parent.getParent() != null ? parent.getParent().getMarkupId() : parent.getMarkupId();
}
return id;
}
Aggregations