use of com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance in project midpoint by Evolveum.
the class AbstractRoleMainPanel method getPreviousPage.
private Class getPreviousPage(PageAdminObjectDetails<R> parentPage) {
List<Breadcrumb> breadcrumbs = parentPage.getBreadcrumbs();
if (breadcrumbs == null || breadcrumbs.size() < 2) {
return null;
}
Breadcrumb previousBreadcrumb = breadcrumbs.get(breadcrumbs.size() - 2);
Class page = null;
if (previousBreadcrumb instanceof BreadcrumbPageClass) {
page = ((BreadcrumbPageClass) previousBreadcrumb).getPage();
} else if (previousBreadcrumb instanceof BreadcrumbPageInstance) {
page = ((BreadcrumbPageInstance) previousBreadcrumb).getPage().getClass();
}
return page;
}
use of com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance in project midpoint by Evolveum.
the class CaseWorkItemListWithDetailsPanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
AjaxButton cancelButton = new AjaxButton(ID_CANCEL_BUTTON, createStringResource("MultivalueContainerListPanel.cancelButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
setItemDetailsVisible(false);
cancelItemDetailsPerformed(ajaxRequestTarget);
ajaxRequestTarget.add(CaseWorkItemListWithDetailsPanel.this);
ajaxRequestTarget.add(CaseWorkItemListWithDetailsPanel.this.getPageBase().getFeedbackPanel());
}
};
getDetailsPanelContainer().add(cancelButton);
CaseWorkItemActionsPanel actionsPanel = new CaseWorkItemActionsPanel(ID_CASE_WORK_ITEM_ACTIONS_PANEL, new LoadableModel<>() {
private static final long serialVersionUID = 1L;
@Override
protected CaseWorkItemType load() {
return getDetailsPanelItemsList().size() > 0 ? getDetailsPanelItemsList().get(0).getRealValue() : null;
}
}) {
private static final long serialVersionUID = 1L;
@Override
protected WorkItemDelegationRequestType getDelegationRequest(UserType delegate) {
return super.getDelegationRequest(delegate).comment(WorkItemTypeUtil.getComment(getModelObject()));
}
@Override
protected Component getCustomForm() {
return workItemDetails != null ? workItemDetails.getCustomForm() : null;
}
@Override
protected void afterActionFinished(AjaxRequestTarget target) {
Breadcrumb previousBreadcrumb = getPageBase().getPreviousBreadcrumb();
if (previousBreadcrumb instanceof BreadcrumbPageInstance && ((BreadcrumbPageInstance) previousBreadcrumb).getPage() instanceof PageCaseWorkItem) {
getPageBase().redirectBack(3);
} else {
getPageBase().redirectBack();
}
}
};
actionsPanel.setOutputMarkupId(true);
actionsPanel.add(new VisibleBehaviour(() -> {
CaseWorkItemType workItemSelected = getDetailsPanelItemsList().size() > 0 ? getDetailsPanelItemsList().get(0).getRealValue() : null;
return CaseWorkItemUtil.isCaseWorkItemNotClosed(workItemSelected);
}));
getDetailsPanelContainer().add(actionsPanel);
}
use of com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance in project midpoint by Evolveum.
the class PageFocusPreviewChanges method savePerformed.
private void savePerformed(AjaxRequestTarget target) {
Breadcrumb bc = redirectBack();
if (bc instanceof BreadcrumbPageInstance) {
BreadcrumbPageInstance bcpi = (BreadcrumbPageInstance) bc;
WebPage page = bcpi.getPage();
if (page instanceof PageFocusDetails) {
((PageFocusDetails) page).setSaveOnConfigure(true);
} else {
error("Couldn't save changes - unexpected referring page: " + page);
}
} else {
error("Couldn't save changes - no instance for referring page; breadcrumb is " + bc);
}
}
use of com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance in project midpoint by Evolveum.
the class PagePreviewChanges method savePerformed.
private void savePerformed(AjaxRequestTarget target) {
Breadcrumb bc = redirectBack();
if (bc instanceof BreadcrumbPageInstance) {
BreadcrumbPageInstance bcpi = (BreadcrumbPageInstance) bc;
WebPage page = bcpi.getPage();
if (page instanceof PageAdminObjectDetails) {
((PageAdminObjectDetails) page).setSaveOnConfigure(true);
} else {
error("Couldn't save changes - unexpected referring page: " + page);
}
} else {
error("Couldn't save changes - no instance for referring page; breadcrumb is " + bc);
}
}
use of com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance in project midpoint by Evolveum.
the class WebComponentUtil method getPreviousPageClass.
public static Class<?> getPreviousPageClass(PageBase parentPage) {
List<Breadcrumb> breadcrumbs = parentPage.getBreadcrumbs();
if (breadcrumbs == null || breadcrumbs.size() < 2) {
return null;
}
Breadcrumb previousBreadcrumb = breadcrumbs.get(breadcrumbs.size() - 2);
Class<?> page = null;
if (previousBreadcrumb instanceof BreadcrumbPageClass) {
page = ((BreadcrumbPageClass) previousBreadcrumb).getPage();
} else if (previousBreadcrumb instanceof BreadcrumbPageInstance) {
page = ((BreadcrumbPageInstance) previousBreadcrumb).getPage().getClass();
}
return page;
}
Aggregations