Package org.openfaces.component.panel

Examples of org.openfaces.component.panel.LayeredPane


        writer.startElement("tr", timetable);
        writer.writeAttribute("class", "o_timetableView_tableRow", null);
        writer.startElement("td", timetable);
        writer.writeAttribute("style", "height: 100%", null);

        LayeredPane layeredPane = getLayeredPane(timetable);
        layeredPane.encodeAll(context);

        List<String> viewIds = new ArrayList<String>();
        for (UIComponent c : layeredPane.getChildren()) {
            SubPanel subPanel = (SubPanel) c;
            if (subPanel.getChildCount() != 1) throw new IllegalStateException();
            VirtualContainer container = (VirtualContainer) subPanel.getChildren().get(0);
            TimetableView timetableView = (TimetableView) container.getVirtualChild();
            String viewId = timetableView.getClientId(context);
View Full Code Here


    @Override
    public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
    }

    private LayeredPane getLayeredPane(final Timetable timetable) {
        LayeredPane layeredPane = Components.getChildWithClass(timetable, LayeredPane.class, "layeredPane");
        layeredPane.setStyle("width: 100%");
        layeredPane.setContainerStyle("padding: 0");
        layeredPane.setLoadingMode(LoadingMode.CLIENT);
        if (layeredPane.getChildCount() == 0) {
            List<UIComponent> children = layeredPane.getChildren();
            children.add(new SubPanel(null, new MonthTableVirtualContainer()));
            children.add(new SubPanel(null, new WeekTableVirtualContainer()));
            children.add(new SubPanel(null, new DayTableVirtualContainer()));
        }

        Timetable.ViewType currentViewType = timetable.getViewType();
        List<UIComponent> children = layeredPane.getChildren();
        int viewIndex = 0;
        for (int i = 0, count = children.size(); i < count; i++) {
            SubPanel subPanel = (SubPanel) children.get(i);
            if (subPanel.getChildCount() != 1)
                throw new IllegalArgumentException("One child component expected, but was " + subPanel.getChildCount() + "; panel index: " + i);
            VirtualContainer container = (VirtualContainer) subPanel.getChildren().get(0);
            TimetableView viewInThisPanel = (TimetableView) container.getVirtualChild();
            Timetable.ViewType viewTypeType = viewInThisPanel.getType();
            if (viewTypeType == currentViewType) {
                viewIndex = i;
                break;
            }

        }
        layeredPane.setSelectedIndex(viewIndex);
        return layeredPane;
    }
View Full Code Here

        TimePeriodSwitcher switcher = (TimePeriodSwitcher) component;
        ResponseWriter writer = context.getResponseWriter();

        writer.startElement("span", switcher);
        writeIdAttribute(context, switcher);
        LayeredPane layeredPane = getLayeredPane(switcher);
        layeredPane.encodeAll(context);

        Timetable timetable = switcher.getTimetableView();
        Rendering.renderInitScript(context, new ScriptBuilder().initScript(context, switcher,
                "O$.TimePeriodSwitcher._init", timetable),
                Resources.utilJsURL(context),
View Full Code Here

    }

    private LayeredPane getLayeredPane(TimePeriodSwitcher switcher) {
        FacesContext context = FacesContext.getCurrentInstance();

        LayeredPane layeredPane = Components.getChildWithClass(switcher, LayeredPane.class, "layeredPane");
        layeredPane.setStyleClass("o_timetablePeriodSwitcher_lp");
        layeredPane.setId(switcher.getId() + LAYERED_PANE_SUFFIX);
        layeredPane.setLoadingMode(LoadingMode.CLIENT);
        if (layeredPane.getChildCount() == 0) {
            List<UIComponent> children = layeredPane.getChildren();
            children.add(new SubPanel(null, switcher.getMonthSwitcher()));
            children.add(new SubPanel(null, switcher.getWeekSwitcher()));
            children.add(new SubPanel(null, switcher.getDaySwitcher()));
        }

        Timetable timetable = switcher.getTimetableView();

        Timetable.ViewType currentViewType = timetable.getViewType();
        List<UIComponent> children = layeredPane.getChildren();
        int viewIndex = 0;
        for (int i = 0, count = children.size(); i < count; i++) {
            SubPanel subPanel = (SubPanel) children.get(i);
            if (subPanel.getChildCount() != 1)
                throw new IllegalArgumentException("One child component expected, but was " + subPanel.getChildCount() + "; panel index: " + i);
            AbstractSwitcher viewInThisPanel = (AbstractSwitcher) subPanel.getChildren().get(0);
            Timetable.ViewType viewType = viewInThisPanel.getApplicableViewType();
            TimetableView appropriateView = timetable.getViewByType(viewType);
            viewInThisPanel.setFor(":" + appropriateView.getClientId(context));
            if (viewType == currentViewType) {
                viewIndex = i;
            }

        }
        layeredPane.setSelectedIndex(viewIndex);
        return layeredPane;
    }
View Full Code Here

    @Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        if (AjaxUtil.getSkipExtraRenderingOnPortletsAjax(context))
            return;
        ResponseWriter writer = context.getResponseWriter();
        LayeredPane layeredPane = (LayeredPane) component;

        LoadingMode loadingMode = layeredPane.getLoadingMode();
        if (LoadingMode.AJAX_LAZY.equals(loadingMode) || LoadingMode.AJAX_ALWAYS.equals(loadingMode))
            AjaxUtil.prepareComponentForAjax(context, component);

        List<SubPanel> allItems = layeredPane.getSubPanels(true);

        writer.startElement("table", layeredPane);
        writer.writeAttribute("border", "0", null);
        writer.writeAttribute("cellspacing", "0", null);
        writer.writeAttribute("cellpadding", "0", null);
        writer.writeAttribute("id", layeredPane.getClientId(context), "id");

        Rendering.writeComponentClassAttribute(writer, layeredPane);

        Rendering.writeStandardEvents(writer, layeredPane);
View Full Code Here

TOP

Related Classes of org.openfaces.component.panel.LayeredPane

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.