Search in sources :

Example 1 with FragmentParams

use of org.ovirt.engine.ui.common.presenter.FragmentParams in project ovirt-engine by oVirt.

the class AbstractMainWithDetailsPresenter method onReveal.

@Override
protected void onReveal() {
    super.onReveal();
    setInSlot(TYPE_SetSearchPanel, searchPanelPresenterWidget);
    setInSlot(TYPE_SetBreadCrumbs, breadCrumbsPresenterWidget);
    if (hasActionPanelPresenterWidget()) {
        getTable().setActionMenus(getActionPanelPresenterWidget().getActionButtons());
    }
    breadCrumbsPresenterWidget.hideSelectedName();
    breadCrumbsPresenterWidget.rebuildBreadCrumbs();
    getView().resizeToFullHeight();
    PlaceRequest currentPlace = placeManager.getCurrentPlaceRequest();
    Set<FragmentParams> params = FragmentParams.getParams(currentPlace);
    params.forEach(param -> {
        switch(param) {
            case SEARCH:
                String search = currentPlace.getParameter(FragmentParams.SEARCH.getName(), "");
                if (!"".equals(search)) {
                    // We have a search parameter. The tokenizer has already run it through URL decode so we should be
                    // able to simply pass it to setSearchString in the model.
                    applySearchString(getModel().getDefaultSearchString() + search);
                }
                break;
            default:
                break;
        }
    });
}
Also used : PlaceRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest) FragmentParams(org.ovirt.engine.ui.common.presenter.FragmentParams)

Aggregations

PlaceRequest (com.gwtplatform.mvp.shared.proxy.PlaceRequest)1 FragmentParams (org.ovirt.engine.ui.common.presenter.FragmentParams)1