Package org.apache.isis.viewer.wicket.model.hints

Examples of org.apache.isis.viewer.wicket.model.hints.UiHintContainer


    }



    protected void setViewHintAndBroadcast(int viewNum, AjaxRequestTarget target) {
        final UiHintContainer uiHintContainer = getUiHintContainer();
        if(uiHintContainer == null) {
            return;
        }
        uiHintContainer.setHint(LinksSelectorPanelAbstract.this, UIHINT_VIEW, ""+viewNum);
        send(getPage(), Broadcast.EXACT, new UiHintsSetEvent(uiHintContainer, target));
    }
View Full Code Here


        component.add(modifier);
    }

    protected int honourViewHintElseDefault(final List<ComponentFactory> componentFactories, final IModel<?> model) {
        // honour hints ...
        final UiHintContainer hintContainer = getUiHintContainer();
        if(hintContainer != null) {
            String viewStr = hintContainer.getHint(this, UIHINT_VIEW);
            if(viewStr != null) {
                try {
                    int view = Integer.parseInt(viewStr);
                    if(view >= 0 && view < componentFactories.size()) {
                        return view;
                    }
                } catch(NumberFormatException ex) {
                    // ignore
                }
            }
        }

        // ... else default
        int initialFactory = determineInitialFactory(componentFactories, model);
        if(hintContainer != null) {
            hintContainer.setHint(this, UIHINT_VIEW, ""+initialFactory);
            // don't broadcast (no AjaxRequestTarget, still configuring initial setup)
        }
        return initialFactory;
    }
View Full Code Here

        }

    }

    public void honourHints() {
        UiHintContainer uiHintContainer = getUiHintContainer();
        if(uiHintContainer == null) {
            return;
        }
       
        headersToolbar.honourSortOrderHints();
View Full Code Here

        uiHintContainer.setHint(this, UIHINT_PAGE_NUMBER, ""+getCurrentPage());
        // don't broadcast (no AjaxRequestTarget, still configuring initial setup)
    }

    public void setPageNumberHintAndBroadcast(AjaxRequestTarget target) {
        final UiHintContainer uiHintContainer = getUiHintContainer();
        if(uiHintContainer == null) {
            return;
        }
        uiHintContainer.setHint(this, IsisAjaxFallbackDataTable.UIHINT_PAGE_NUMBER, ""+getCurrentPage());
        send(getPage(), Broadcast.EXACT, new UiHintsSetEvent(uiHintContainer, target));
    }
View Full Code Here

        uiHintContainer.setHint(this, IsisAjaxFallbackDataTable.UIHINT_PAGE_NUMBER, ""+getCurrentPage());
        send(getPage(), Broadcast.EXACT, new UiHintsSetEvent(uiHintContainer, target));
    }

    public void setSortOrderHintAndBroadcast(SortOrder order, String property, AjaxRequestTarget target) {
        final UiHintContainer uiHintContainer = getUiHintContainer();
        if(uiHintContainer == null) {
            return;
        }

        // first clear all SortOrder hints...
        for (SortOrder eachSortOrder : SortOrder.values()) {
            uiHintContainer.clearHint(this, eachSortOrder.name());
        }
        // .. then set this one
        uiHintContainer.setHint(this, order.name(), property);
        send(getPage(), Broadcast.EXACT, new UiHintsSetEvent(uiHintContainer, target));
    }
View Full Code Here

    @Override
    protected void onAjaxClick(final AjaxRequestTarget target)
    {
        target.add(dataTable);

        final UiHintContainer uiHintContainer = getUiHintContainer();
        if(uiHintContainer == null) {
            return;
        }
       
        final ISortState<T> state = stateLocator.getSortState();
View Full Code Here

    }
   
    // //////////////////////////////////////

    void honourSortOrderHints() {
        final UiHintContainer uiHintContainer = getUiHintContainer();
        if(uiHintContainer == null) {
            return;
        }
        for (SortOrder sortOrder : SortOrder.values()) {
            String property = uiHintContainer.getHint(table, sortOrder.name());
            if(property != null) {
                // bit hacky... how know this cast is safe?
                S propertyS = (S) property;
                stateLocator.getSortState().setPropertySortOrder(propertyS, sortOrder);
            }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.wicket.model.hints.UiHintContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.