Package org.openfaces.component.panel

Examples of org.openfaces.component.panel.SubPanel


    }

    public Collection<SubPanel> getSubPanels() {
        if (subPanels == null) {
            subPanels = new ArrayList<SubPanel>();
            SubPanel item;
            HtmlOutputText tabValue;
            HtmlOutputText containerValue;

            item = new SubPanel();
            tabValue = new HtmlOutputText();
            tabValue.setId("otext1");
            tabValue.setValue("tab1");
            item.setId("tabbbedPaneItem1");
            item.getFacets().put("caption", tabValue);
            containerValue = new HtmlOutputText();
            containerValue.setId("otext2");
            containerValue.setValue("content 1");
            item.getChildren().add(containerValue);
            subPanels.add(item);

            item = new SubPanel();
            tabValue = new HtmlOutputText();
            tabValue.setId("otext3");
            tabValue.setValue("tab2");
            item.setId("tabbbedPaneItem2");
            item.getFacets().put("caption", tabValue);
            DateChooser dateChooser = new DateChooser();
            dateChooser.setId("dc");
            item.getChildren().add(dateChooser);
            subPanels.add(item);

            item = new SubPanel();
            tabValue = new HtmlOutputText();
            tabValue.setId("otext4");
            tabValue.setValue("tab3");
            item.setId("tabbbedPaneItem3");
            item.getFacets().put("caption", tabValue);
            containerValue = new HtmlOutputText();
            containerValue.setId("otext5");
            containerValue.setValue("content 3");
            item.getChildren().add(containerValue);
            subPanels.add(item);
        }
        return subPanels;
    }
View Full Code Here


        Debug debug = (Debug) component;
        TabbedPane tabbedPane = (TabbedPane) Components.createChildComponent(context, debug, TabbedPane.COMPONENT_TYPE, "pages");
        tabbedPane.setLoadingMode(LoadingMode.CLIENT);
        tabbedPane.setStyle("width: 100%; height: 100%;");

        tabbedPane.getChildren().add(new SubPanel(
                Components.createOutputText(context, "Console"),
                createLogPageContent(context, debug)
        ));
        DataTable elementProperties = (DataTable) Components.createChildComponent(
                context, debug, DataTable.COMPONENT_TYPE, "elementProperties");
        tabbedPane.getChildren().add(new SubPanel(
                Components.createOutputText(context, "Element Inspector"),
                elementProperties
        ));
        elementProperties.setStyle("width: 100%; height: 100%;");
        elementProperties.getChildren().add(new Scrolling());
View Full Code Here

        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);
            viewIds.add(viewId);
        }
View Full Code Here

        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;
View Full Code Here

        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;
View Full Code Here

        writer.startElement("tr", container);
        writer.startElement("td", container);

        writeAttribute(writer, "class", containerClass);

        SubPanel item = (SubPanel) allSubPanels.get(absolutePageIndex);
        Collection<UIComponent> paneContent = item.getChildren();
        encodeComponents(context, paneContent);

        writer.endElement("td");
        writer.endElement("tr");
        writer.endElement("table");
View Full Code Here

            encodePageContent(context, container, subPanels, selectedTabIndex, true, containerClass);
            container.setItemRendered(selectedTabIndex, true);
        } else if (loadingMode.equals(LoadingMode.CLIENT)) {
            for (int i = 0; i < allItemCount; i++) {
                boolean thisPageVisible = selectedTabIndex == i;
                SubPanel subPanel = subPanels.get(i);
                if (subPanel.isRendered())
                    encodePageContent(context, container, subPanels, i, thisPageVisible, containerClass);
                container.setItemRendered(i, true);
            }
        } else if (loadingMode.equals(LoadingMode.AJAX_LAZY)) {
            encodePageContent(context, container, subPanels, selectedTabIndex, true, containerClass);
View Full Code Here

        if (allItemCount == 0) {
            return -1;
        }
        if (selectedTabIndex < 0 || selectedTabIndex >= allItemCount)
            selectedTabIndex = 0;
        SubPanel selectedItem = subPanels.get(selectedTabIndex);
        if (!selectedItem.isRendered()) {
            selectedTabIndex = -1;
            for (int i = 0; i < allItemCount; i++) {
                SubPanel subPanel = subPanels.get(i);
                if (subPanel.isRendered()) {
                    selectedTabIndex = i;
                    break;
                }
            }
        }
View Full Code Here

TOP

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

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.