Search in sources :

Example 1 with Breadcrumb

use of com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb in project midpoint by Evolveum.

the class PageBase method redirectBack.

public Breadcrumb redirectBack() {
    List<Breadcrumb> breadcrumbs = getBreadcrumbs();
    if (!canRedirectBack()) {
        setResponsePage(getMidpointApplication().getHomePage());
        return null;
    }
    Breadcrumb breadcrumb = breadcrumbs.get(breadcrumbs.size() - 2);
    redirectBackToBreadcrumb(breadcrumb);
    return breadcrumb;
}
Also used : Breadcrumb(com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb)

Example 2 with Breadcrumb

use of com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb 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;
}
Also used : BreadcrumbPageClass(com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageClass) Breadcrumb(com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb) BreadcrumbPageClass(com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageClass) BreadcrumbPageInstance(com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance)

Example 3 with Breadcrumb

use of com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb in project midpoint by Evolveum.

the class PageSelfProfile method createBreadcrumb.

@Override
protected void createBreadcrumb() {
    super.createBreadcrumb();
    Breadcrumb bc = getLastBreadcrumb();
    bc.setIcon(new Model("fa fa-user"));
}
Also used : Model(org.apache.wicket.model.Model) IModel(org.apache.wicket.model.IModel) Breadcrumb(com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb)

Example 4 with Breadcrumb

use of com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb 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);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) Breadcrumb(com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb) BreadcrumbPageInstance(com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance)

Example 5 with Breadcrumb

use of com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb in project midpoint by Evolveum.

the class PageAbstractSelfCredentials method createBreadcrumb.

@Override
protected void createBreadcrumb() {
    super.createBreadcrumb();
    Breadcrumb bc = getLastBreadcrumb();
    bc.setIcon(new Model<>("fa fa-shield"));
}
Also used : Breadcrumb(com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb)

Aggregations

Breadcrumb (com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb)26 Model (org.apache.wicket.model.Model)11 IModel (org.apache.wicket.model.IModel)10 BreadcrumbPageInstance (com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageInstance)5 WebPage (org.apache.wicket.markup.html.WebPage)4 BreadcrumbPageClass (com.evolveum.midpoint.web.component.breadcrumbs.BreadcrumbPageClass)3 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 UserDetailsModel (com.evolveum.midpoint.gui.impl.page.admin.user.UserDetailsModel)1 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)1 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 PageAdminObjectDetails (com.evolveum.midpoint.web.page.admin.PageAdminObjectDetails)1 PageAssignmentsList (com.evolveum.midpoint.web.page.self.PageAssignmentsList)1 IPageFactory (org.apache.wicket.IPageFactory)1 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)1 TransparentWebMarkupContainer (org.apache.wicket.markup.html.TransparentWebMarkupContainer)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1