use of com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour in project midpoint by Evolveum.
the class RoleMemberPanel method initSearch.
@Override
protected void initSearch(Form form) {
List<QName> allowedTypes = WebComponentUtil.createFocusTypeList();
allowedTypes.add(FocusType.COMPLEX_TYPE);
DropDownChoice<QName> typeSelect = createDropDown(ID_OBJECT_TYPE, Model.of(FocusType.COMPLEX_TYPE), allowedTypes, new QNameChoiceRenderer());
add(typeSelect);
DropDownChoice<OrgType> tenant = createDropDown(ID_TENANT, new Model(), createTenantList(), new ObjectTypeChoiceRenderer<OrgType>());
add(tenant);
tenant.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return isRole();
}
});
DropDownChoice<OrgType> project = createDropDown(ID_PROJECT, new Model(), createProjectList(), new ObjectTypeChoiceRenderer<OrgType>());
add(project);
project.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return isRole();
}
});
CheckBoxPanel includeIndirectMembers = new CheckBoxPanel(ID_INDIRECT_MEMBERS, new Model<Boolean>(false)) {
private static final long serialVersionUID = 1L;
public void onUpdate(AjaxRequestTarget target) {
refreshTable(target);
}
};
add(includeIndirectMembers);
// TODO shouldn't we hide also the label?
includeIndirectMembers.add(new VisibleBehaviour(this::isRole));
}
use of com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour in project midpoint by Evolveum.
the class SynchronizationInformationPanel method initLayout.
protected void initLayout(final boolean useAfter) {
WebMarkupContainer titleBefore = new WebMarkupContainer(ID_TITLE_BEFORE);
titleBefore.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return !useAfter;
}
});
add(titleBefore);
WebMarkupContainer titleAfter = new WebMarkupContainer(ID_TITLE_AFTER);
titleAfter.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return useAfter;
}
});
add(titleAfter);
Label aProtected = new Label(ID_PROTECTED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_PROTECTED));
add(aProtected);
Label noSync = new Label(ID_NO_SYNCHRONIZATION_POLICY, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_NO_SYNCHRONIZATION_POLICY));
add(noSync);
Label syncDisabled = new Label(ID_SYNCHRONIZATION_DISABLED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_SYNCHRONIZATION_DISABLED));
add(syncDisabled);
Label notAppl = new Label(ID_NOT_APPLICABLE_FOR_TASK, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_NOT_APPLICABLE_FOR_TASK));
add(notAppl);
Label deleted = new Label(ID_DELETED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_DELETED));
add(deleted);
Label disputed = new Label(ID_DISPUTED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_DISPUTED));
add(disputed);
Label linked = new Label(ID_LINKED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_LINKED));
add(linked);
Label unlinked = new Label(ID_UNLINKED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_UNLINKED));
add(unlinked);
Label unmatched = new Label(ID_UNMATCHED, new PropertyModel<>(getModel(), SynchronizationInformationDto.F_COUNT_UNMATCHED));
add(unmatched);
}
use of com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour in project midpoint by Evolveum.
the class AssignmentEditorPanel method addRelationDropDown.
private void addRelationDropDown(WebMarkupContainer relationContainer) {
List<RelationTypes> availableRelations = getModelObject().getNotAssignedRelationsList();
DropDownChoicePanel relation = WebComponentUtil.createEnumPanel(RelationTypes.class, ID_RELATION, getModelObject().isMultyAssignable() ? WebComponentUtil.createReadonlyModelFromEnum(RelationTypes.class) : Model.ofList(availableRelations), getRelationModel(availableRelations), this, false);
relation.setEnabled(getModel().getObject().isEditable());
relation.setOutputMarkupId(true);
relation.setOutputMarkupPlaceholderTag(true);
relation.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return isCreatingNewAssignment();
}
});
relationContainer.add(relation);
}
use of com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour in project midpoint by Evolveum.
the class LockoutStatusPanel method initLayout.
private void initLayout(final IModel<LockoutStatusType> model) {
WebMarkupContainer container = new WebMarkupContainer(ID_CONTAINER);
add(container);
Label label = new Label(ID_LABEL, new IModel<String>() {
@Override
public String getObject() {
LockoutStatusType object = model != null ? model.getObject() : null;
String labelValue = object == null ? ((PageBase) getPage()).createStringResource("LockoutStatusType.UNDEFINED").getString() : WebComponentUtil.createLocalizedModelForEnum(object, getLabel()).getObject();
if (!isInitialState) {
labelValue += " " + ((PageBase) getPage()).createStringResource("LockoutStatusPanel.changesSaving").getString();
}
return labelValue;
}
@Override
public void setObject(String s) {
}
@Override
public void detach() {
}
});
label.setOutputMarkupId(true);
container.add(label);
AjaxButton button = new AjaxButton(ID_BUTTON, getButtonModel()) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
PrismPropertyValue oldValue = (PrismPropertyValue) valueWrapper.getOldValue();
if (!isInitialState) {
model.setObject(initialValue);
oldValue.setValue(initialValue);
valueWrapper.setStatus(ValueStatus.NOT_CHANGED);
} else {
model.setObject(LockoutStatusType.NORMAL);
if (oldValue.getValue() != null) {
oldValue.setValue(null);
}
}
isInitialState = !isInitialState;
ajaxRequestTarget.add(getButton());
ajaxRequestTarget.add(getLabel());
}
};
button.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return true;
}
});
button.setOutputMarkupId(true);
container.add(button);
}
use of com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour in project midpoint by Evolveum.
the class AssignmentCatalogPanel method initSearchPanel.
private void initSearchPanel(WebMarkupContainer headerPanel) {
final Form searchForm = new Form(ID_SEARCH_FORM);
headerPanel.add(searchForm);
searchForm.add(new VisibleEnableBehaviour() {
public boolean isVisible() {
return !isCatalogOidEmpty() && !AssignmentViewType.USER_TYPE.equals(getRoleCatalogStorage().getViewType());
}
});
searchForm.setOutputMarkupId(true);
SearchPanel search = new SearchPanel(ID_SEARCH, (IModel) searchModel, false) {
private static final long serialVersionUID = 1L;
@Override
public void searchPerformed(ObjectQuery query, AjaxRequestTarget target) {
AssignmentCatalogPanel.this.searchPerformed(query, target);
}
};
searchForm.add(search);
}
Aggregations