use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.
the class AbstractRoleMainPanel method createTabs.
@Override
protected List<ITab> createTabs(final PageAdminObjectDetails<R> parentPage) {
List<ITab> tabs = super.createTabs(parentPage);
FocusTabVisibleBehavior authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_INDUCEMENTS_URL);
tabs.add(new CountablePanelTab(parentPage.createStringResource("FocusType.inducement"), authorization) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new AssignmentTablePanel<R>(panelId, parentPage.createStringResource("FocusType.inducement"), inducementsModel) {
private static final long serialVersionUID = 1L;
@Override
public List<AssignmentType> getAssignmentTypeList() {
return getObject().asObjectable().getInducement();
}
@Override
public String getExcludeOid() {
return getObject().getOid();
}
@Override
protected boolean ignoreMandatoryAttributes() {
return true;
}
};
}
@Override
public String getCount() {
return Integer.toString(inducementsModel.getObject() == null ? 0 : inducementsModel.getObject().size());
}
});
authorization = new FocusTabVisibleBehavior(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_MEMBERS_URL);
tabs.add(new PanelTab(parentPage.createStringResource("pageRole.members"), authorization) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return createMemberPanel(panelId);
}
@Override
public boolean isVisible() {
return super.isVisible() && getObjectWrapper().getStatus() != ContainerStatus.ADDING && isAllowedToReadRoleMembership(getObjectWrapper().getOid(), parentPage);
}
});
return tabs;
}
use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.
the class TextAreaFormGroup method initLayout.
private void initLayout(IModel<String> label, final String tooltipKey, boolean isTooltipInModal, String labelSize, String textSize, boolean required, int rowNumber) {
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 textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
if (StringUtils.isNotEmpty(textSize)) {
textWrapper.add(AttributeAppender.prepend("class", textSize));
}
add(textWrapper);
TextArea text = new TextArea<>(ID_TEXT, getModel());
text.add(new AttributeModifier("rows", rowNumber));
text.setOutputMarkupId(true);
text.setRequired(required);
text.setLabel(label);
text.add(AttributeAppender.replace("placeholder", label));
textWrapper.add(text);
}
use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.
the class ValueChoosePanel method initLayout.
private void initLayout(final IModel<T> value, final List<PrismReferenceValue> values, final boolean required, Collection<Class<? extends O>> types) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.setOutputMarkupId(true);
TextField<String> text = new TextField<String>(ID_TEXT, createTextModel(value));
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
}
});
text.setRequired(required);
text.setEnabled(false);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
textWrapper.add(feedback);
AjaxLink<String> edit = new AjaxLink<String>(ID_EDIT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
editValuePerformed(values, target);
}
};
textWrapper.add(edit);
add(textWrapper);
initButtons();
}
use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.
the class MultiValueTextFormGroup method initLayout.
private void initLayout(final IModel<String> label, final String labelSize, final String textSize, final boolean required) {
Label l = new Label(ID_LABEL, label);
if (StringUtils.isNotEmpty(labelSize)) {
l.add(AttributeAppender.prepend("class", labelSize));
}
add(l);
ListView repeater = new ListView<T>(ID_REPEATER, getModel()) {
@Override
protected void populateItem(final ListItem<T> item) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.add(AttributeAppender.prepend("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
StringBuilder sb = new StringBuilder();
if (StringUtils.isNotEmpty(textSize)) {
sb.append(textSize).append(' ');
}
if (item.getIndex() > 0 && StringUtils.isNotEmpty(getOffsetClass())) {
sb.append(getOffsetClass()).append(' ');
sb.append(CLASS_MULTI_VALUE);
}
return sb.toString();
}
}));
item.add(textWrapper);
TextField text = new TextField(ID_TEXT, createTextModel(item.getModel()));
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
}
});
text.setRequired(required);
text.add(AttributeAppender.replace("placeholder", label));
text.setLabel(label);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
textWrapper.add(feedback);
WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP);
buttonGroup.add(AttributeAppender.append("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
if (item.getIndex() > 0 && StringUtils.isNotEmpty(labelSize)) {
return CLASS_MULTI_VALUE;
}
return null;
}
}));
item.add(buttonGroup);
initButtons(buttonGroup, item);
}
};
add(repeater);
}
use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.
the class MultiStateHorizontalButton method initLayout.
private void initLayout() {
WebMarkupContainer buttonsPanel = new WebMarkupContainer(ID_BUTTONS_CONTAINER);
buttonsPanel.setOutputMarkupId(true);
add(buttonsPanel);
RepeatingView buttons = new RepeatingView(ID_BUTTON);
buttons.setOutputMarkupId(true);
buttonsPanel.add(buttons);
for (String propertyKey : propertyKeysList) {
AjaxSubmitButton button = new AjaxSubmitButton(buttons.newChildId(), pageBase.createStringResource(propertyKey)) {
@Override
public void onSubmit(AjaxRequestTarget ajaxRequestTarget, Form form) {
MultiStateHorizontalButton.this.onStateChanged(propertyKeysList.indexOf(propertyKey), ajaxRequestTarget);
}
@Override
public void onError(AjaxRequestTarget ajaxRequestTarget, Form form) {
MultiStateHorizontalButton.this.onStateChanged(propertyKeysList.indexOf(propertyKey), ajaxRequestTarget);
}
};
button.add(getActiveButtonClassAppender(propertyKeysList.indexOf(propertyKey)));
button.setOutputMarkupId(true);
buttons.add(button);
}
}
Aggregations