Package com.alkacon.geranium.client.ui

Examples of com.alkacon.geranium.client.ui.FlowPanel


            AttributeHandler.setResizeHandler(tabSizeHandler);
            tabbedPanel.getElement().getStyle().setBorderWidth(0, Unit.PX);
            Iterator<TabInfo> tabIt = tabInfos.iterator();
            TabInfo currentTab = tabIt.next();
            TabInfo nextTab = tabIt.next();
            FlowPanel tabPanel = new FlowPanel();
            tabPanel.addStyleName(ENTITY_CLASS);
            tabPanel.addStyleName(I_LayoutBundle.INSTANCE.form().formParent());
            tabPanel.getElement().getStyle().setMargin(0, Unit.PX);
            tabbedPanel.addNamed(tabPanel, currentTab.getTabName(), currentTab.getTabId());
            I_Type entityType = m_vie.getType(entity.getTypeName());
            List<String> attributeNames = entityType.getAttributeNames();
            for (final String attributeName : attributeNames) {
                boolean collapsed = false;
                if ((nextTab != null) && attributeName.endsWith("/" + nextTab.getStartName())) {
                    currentTab = nextTab;
                    nextTab = tabIt.hasNext() ? tabIt.next() : null;
                    tabPanel = new FlowPanel();
                    tabPanel.addStyleName(ENTITY_CLASS);
                    tabPanel.addStyleName(I_LayoutBundle.INSTANCE.form().formParent());
                    tabPanel.getElement().getStyle().setMargin(0, Unit.PX);
                    tabbedPanel.addNamed(tabPanel, currentTab.getTabName(), currentTab.getTabId());
                    // check if the tab content may be collapsed
                    if (currentTab.isCollapsed()) {
                        int currentIndex = attributeNames.indexOf(attributeName);
                        collapsed = ((currentIndex + 1) == attributeNames.size())
                            || ((nextTab != null) && attributeNames.get(currentIndex + 1).endsWith(
                                "/" + nextTab.getStartName()));
                    }
                }
                AttributeHandler handler = new AttributeHandler(m_vie, entity, attributeName, m_widgetService);
                parentHandler.setHandler(attributeIndex, attributeName, handler);
                I_Type attributeType = entityType.getAttributeType(attributeName);
                I_EntityRenderer renderer = m_widgetService.getRendererForAttribute(attributeName, attributeType);
                int minOccurrence = entityType.getAttributeMinOccurrence(attributeName);
                I_EntityAttribute attribute = entity.getAttribute(attributeName);
                // only single complex values may be collapsed
                if (collapsed
                    && (attribute != null)
                    && !attributeType.isSimpleType()
                    && (minOccurrence == 1)
                    && (entityType.getAttributeMaxOccurrence(attributeName) == 1)) {
                    renderer.renderForm(attribute.getComplexValue(), tabPanel, handler, 0);
                } else {
                    String label = m_widgetService.getAttributeLabel(attributeName);
                    String help = m_widgetService.getAttributeHelp(attributeName);
                    ValuePanel attributeElement = new ValuePanel();
                    tabPanel.add(attributeElement);
                    if ((attribute == null) && (minOccurrence > 0)) {
                        attribute = createEmptyAttribute(entity, attributeName, minOccurrence);
                    }
                    if (attribute != null) {
                        for (int i = 0; i < attribute.getValueCount(); i++) {
View Full Code Here


         * Adjusts the tabbed panel height to the height of the current tab content.<p>
         */
        protected void adjustContextHeight() {

            int tabIndex = m_tabbedPanel.getSelectedIndex();
            FlowPanel tab = m_tabbedPanel.getWidget(tabIndex);
            int height = PositionBean.getInnerDimensions(tab.getElement()).getHeight();
            m_context.getElement().getStyle().setHeight(50 + height, Unit.PX);
        }
View Full Code Here

            AttributeHandler.setResizeHandler(tabSizeHandler);
            tabbedPanel.getElement().getStyle().setBorderWidth(0, Unit.PX);
            Iterator<TabInfo> tabIt = tabInfos.iterator();
            TabInfo currentTab = tabIt.next();
            TabInfo nextTab = tabIt.next();
            FlowPanel tabPanel = new FlowPanel();
            tabPanel.addStyleName(ENTITY_CLASS);
            tabPanel.addStyleName(I_LayoutBundle.INSTANCE.form().formParent());
            tabPanel.getElement().getStyle().setMargin(0, Unit.PX);
            tabbedPanel.addNamed(tabPanel, currentTab.getTabName(), currentTab.getTabId());
            I_Type entityType = m_vie.getType(entity.getTypeName());
            List<String> attributeNames = entityType.getAttributeNames();
            for (final String attributeName : attributeNames) {
                boolean collapsed = false;
                if ((nextTab != null) && attributeName.endsWith("/" + nextTab.getStartName())) {
                    currentTab = nextTab;
                    nextTab = tabIt.hasNext() ? tabIt.next() : null;
                    tabPanel = new FlowPanel();
                    tabPanel.addStyleName(ENTITY_CLASS);
                    tabPanel.addStyleName(I_LayoutBundle.INSTANCE.form().formParent());
                    tabPanel.getElement().getStyle().setMargin(0, Unit.PX);
                    tabbedPanel.addNamed(tabPanel, currentTab.getTabName(), currentTab.getTabId());
                    // check if the tab content may be collapsed
                    if (currentTab.isCollapsed()) {
                        int currentIndex = attributeNames.indexOf(attributeName);
                        collapsed = ((currentIndex + 1) == attributeNames.size())
                            || ((nextTab != null) && attributeNames.get(currentIndex + 1).endsWith(
                                "/" + nextTab.getStartName()));
                    }
                }
                AttributeHandler handler = new AttributeHandler(m_vie, entity, attributeName, m_widgetService);
                I_Type attributeType = entityType.getAttributeType(attributeName);
                I_EntityRenderer renderer = m_widgetService.getRendererForAttribute(attributeName, attributeType);
                int minOccurrence = entityType.getAttributeMinOccurrence(attributeName);
                I_EntityAttribute attribute = entity.getAttribute(attributeName);
                // only single complex values may be collapsed
                if (collapsed
                    && (attribute != null)
                    && !attributeType.isSimpleType()
                    && (minOccurrence == 1)
                    && (entityType.getAttributeMaxOccurrence(attributeName) == 1)) {
                    renderer.renderForm(attribute.getComplexValue(), tabPanel);
                } else {
                    String label = m_widgetService.getAttributeLabel(attributeName);
                    String help = m_widgetService.getAttributeHelp(attributeName);
                    ValuePanel attributeElement = new ValuePanel();
                    tabPanel.add(attributeElement);
                    if ((attribute == null) && (minOccurrence > 0)) {
                        attribute = createEmptyAttribute(entity, attributeName, minOccurrence);
                    }
                    if (attribute != null) {
                        for (int i = 0; i < attribute.getValueCount(); i++) {
View Full Code Here

         * Adjusts the tabbed panel height to the height of the current tab content.<p>
         */
        protected void adjustContextHeight() {

            int tabIndex = m_tabbedPanel.getSelectedIndex();
            FlowPanel tab = m_tabbedPanel.getWidget(tabIndex);
            int height = PositionBean.getInnerDimensions(tab.getElement()).getHeight();
            m_context.getElement().getStyle().setHeight(50 + height, Unit.PX);
        }
View Full Code Here

TOP

Related Classes of com.alkacon.geranium.client.ui.FlowPanel

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.