Package com.alkacon.vie.shared

Examples of com.alkacon.vie.shared.I_Type


     */
    public void renderEntityForm(String entityId, List<TabInfo> tabInfos, Panel context, Element scrollParent) {

        I_Entity entity = m_vie.getEntity(entityId);
        if (entity != null) {
            I_Type type = m_vie.getType(entity.getTypeName());
            FlowPanel formPanel = new FlowPanel();
            context.add(formPanel);
            AttributeHandler.setScrollElement(scrollParent);
            RootHandler rootHandler = new RootHandler();
            TabbedPanel<?> formTabs = m_widgetService.getRendererForType(type).renderForm(
View Full Code Here


     */
    public void renderEntityForm(String entityId, Panel context, Element scrollParent) {

        I_Entity entity = m_vie.getEntity(entityId);
        if (entity != null) {
            I_Type type = m_vie.getType(entity.getTypeName());
            FlowPanel formPanel = new FlowPanel();
            context.add(formPanel);
            AttributeHandler.setScrollElement(scrollParent);
            RootHandler rootHandler = new RootHandler();
            m_widgetService.getRendererForType(type).renderForm(entity, formPanel, rootHandler, 0);
View Full Code Here

     */
    public void renderInlineEntity(String entityId, Element context) {

        I_Entity entity = m_vie.getEntity(entityId);
        if (entity != null) {
            I_Type type = m_vie.getType(entity.getTypeName());
            m_widgetService.getRendererForType(type).renderInline(entity, context);
        }
    }
View Full Code Here

     */
    public void renderInlineEntity(String entityId, I_InlineFormParent formParent) {

        I_Entity entity = m_vie.getEntity(entityId);
        if (entity != null) {
            I_Type type = m_vie.getType(entity.getTypeName());
            m_widgetService.getRendererForType(type).renderInline(entity, formParent);
        }
    }
View Full Code Here

     * @return the registered content entity
     */
    private I_Entity register(I_Vie vie, ContentDefinition definition) {

        Map<String, I_Type> types = definition.getTypes();
        I_Type base = types.get(definition.getEntity().getTypeName());
        vie.registerTypes(base, types);
        return vie.registerEntity(definition.getEntity());
    }
View Full Code Here

        I_Type startType,
        boolean startingAtChoiceAttribute,
        ChoiceMenuEntryBean currentEntry) {

        if (startingAtChoiceAttribute || startType.isChoice()) {
            I_Type choiceType = startingAtChoiceAttribute
            ? startType
            : startType.getAttributeType(Type.CHOICE_ATTRIBUTE_NAME);
            for (String choiceName : choiceType.getAttributeNames()) {
                ChoiceMenuEntryBean subEntry = currentEntry.addChild(choiceName);
                I_Type includedType = choiceType.getAttributeType(choiceName);
                collectChoiceEntries(includedType, false, subEntry);
            }
        }
    }
View Full Code Here

            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++) {
                            AttributeValueView valueWidget = new AttributeValueView(handler, label, help);
                            attributeElement.add(valueWidget);
                            if (attribute.isSimpleValue()) {
                                valueWidget.setValueWidget(
                                    m_widgetService.getAttributeFormWidget(attributeName),
                                    attribute.getSimpleValues().get(i),
                                    true);
                            } else {
                                valueWidget.setValueEntity(renderer, attribute.getComplexValues().get(i));

                            }
                            setAttributeChoice(valueWidget, attributeType);
                        }
                    } else {
                        AttributeValueView valueWidget = new AttributeValueView(handler, label, help);
                        attributeElement.add(valueWidget);
                        if (attributeType.isSimpleType()) {
                            // create a deactivated widget, to add the attribute on click
                            valueWidget.setValueWidget(
                                m_widgetService.getAttributeFormWidget(attributeName),
                                m_widgetService.getDefaultAttributeValue(attributeName),
                                false);
View Full Code Here

    public void renderForm(I_Entity entity, Panel context, I_AttributeHandler parentHandler, int attributeIndex) {

        context.addStyleName(ENTITY_CLASS);
        context.getElement().setAttribute("typeof", entity.getTypeName());
        context.getElement().setAttribute("about", entity.getId());
        I_Type entityType = m_vie.getType(entity.getTypeName());
        if (entityType.isChoice()) {
            I_EntityAttribute attribute = entity.getAttribute(Type.CHOICE_ATTRIBUTE_NAME);
            assert (attribute != null) && attribute.isComplexValue() : "a choice type must have a choice attribute";
            AttributeHandler handler = new AttributeHandler(m_vie, entity, Type.CHOICE_ATTRIBUTE_NAME, m_widgetService);
            parentHandler.setHandler(attributeIndex, Type.CHOICE_ATTRIBUTE_NAME, handler);
            ValuePanel attributeElement = new ValuePanel();
            for (I_Entity choiceEntity : attribute.getComplexValues()) {
                I_Type choiceType = m_vie.getType(choiceEntity.getTypeName());
                List<I_EntityAttribute> choiceAttributes = choiceEntity.getAttributes();
                assert (choiceAttributes.size() == 1) && choiceAttributes.get(0).isSingleValue() : "each choice entity may only have a single attribute with a single value";
                I_EntityAttribute choiceAttribute = choiceAttributes.get(0);
                I_Type attributeType = choiceType.getAttributeType(choiceAttribute.getAttributeName());
                I_EntityRenderer renderer = m_widgetService.getRendererForAttribute(
                    choiceAttribute.getAttributeName(),
                    attributeType);
                String label = m_widgetService.getAttributeLabel(choiceAttribute.getAttributeName());
                String help = m_widgetService.getAttributeHelp(choiceAttribute.getAttributeName());
                context.add(attributeElement);
                AttributeValueView valueWidget = new AttributeValueView(handler, label, help);
                attributeElement.add(valueWidget);
                if (choiceAttribute.isSimpleValue()) {
                    valueWidget.setValueWidget(
                        m_widgetService.getAttributeFormWidget(choiceAttribute.getAttributeName()),
                        choiceAttribute.getSimpleValue(),
                        true);
                } else {
                    valueWidget.setValueEntity(renderer, choiceAttribute.getComplexValue());
                }
                setAttributeChoice(valueWidget, entityType);
            }
            handler.updateButtonVisisbility();
        } else {
            List<String> attributeNames = entityType.getAttributeNames();
            for (String attributeName : attributeNames) {
                int minOccurrence = entityType.getAttributeMinOccurrence(attributeName);
                I_EntityAttribute attribute = entity.getAttribute(attributeName);
                if ((attribute == null) && (minOccurrence > 0)) {
                    attribute = createEmptyAttribute(entity, attributeName, minOccurrence);
                }
                I_Type attributeType = entityType.getAttributeType(attributeName);
                I_EntityRenderer renderer = m_widgetService.getRendererForAttribute(attributeName, attributeType);
                String label = m_widgetService.getAttributeLabel(attributeName);
                String help = m_widgetService.getAttributeHelp(attributeName);
                ValuePanel attributeElement = new ValuePanel();
                context.add(attributeElement);
                AttributeHandler handler = new AttributeHandler(m_vie, entity, attributeName, m_widgetService);
                parentHandler.setHandler(attributeIndex, attributeName, handler);
                if (attribute != null) {
                    for (int i = 0; i < attribute.getValueCount(); i++) {
                        AttributeValueView valueWidget = new AttributeValueView(handler, label, help);
                        attributeElement.add(valueWidget);
                        if (attribute.isSimpleValue()) {
                            valueWidget.setValueWidget(
                                m_widgetService.getAttributeFormWidget(attributeName),
                                attribute.getSimpleValues().get(i),
                                true);
                        } else {
                            valueWidget.setValueEntity(renderer, attribute.getComplexValues().get(i));
                        }
                        setAttributeChoice(valueWidget, attributeType);
                    }
                } else {
                    AttributeValueView valueWidget = new AttributeValueView(handler, label, help);
                    attributeElement.add(valueWidget);
                    if (attributeType.isSimpleType()) {
                        // create a deactivated widget, to add the attribute on click
                        valueWidget.setValueWidget(
                            m_widgetService.getAttributeFormWidget(attributeName),
                            m_widgetService.getDefaultAttributeValue(attributeName),
                            false);
View Full Code Here

    /**
     * @see com.alkacon.acacia.client.I_EntityRenderer#renderInline(com.alkacon.vie.shared.I_Entity, com.google.gwt.dom.client.Element)
     */
    public void renderInline(I_Entity entity, Element context) {

        I_Type entityType = m_vie.getType(entity.getTypeName());
        List<String> attributeNames = entityType.getAttributeNames();
        for (String attributeName : attributeNames) {
            I_Type attributeType = entityType.getAttributeType(attributeName);
            I_EntityRenderer renderer = m_widgetService.getRendererForAttribute(attributeName, attributeType);
            renderer.renderInline(
                entity,
                attributeName,
                context,
View Full Code Here

    /**
     * @see com.alkacon.acacia.client.I_EntityRenderer#renderInline(com.alkacon.vie.shared.I_Entity, com.alkacon.acacia.client.I_InlineFormParent)
     */
    public void renderInline(I_Entity entity, I_InlineFormParent formParent) {

        I_Type entityType = m_vie.getType(entity.getTypeName());
        List<String> attributeNames = entityType.getAttributeNames();
        for (String attributeName : attributeNames) {
            I_Type attributeType = entityType.getAttributeType(attributeName);
            I_EntityRenderer renderer = m_widgetService.getRendererForAttribute(attributeName, attributeType);
            renderer.renderInline(
                entity,
                attributeName,
                formParent,
View Full Code Here

TOP

Related Classes of com.alkacon.vie.shared.I_Type

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.