Package com.alkacon.vie.shared

Examples of com.alkacon.vie.shared.I_Type


        if (getType(type.getId()) != null) {
            // type already registered
            return;
        }
        I_Type regType = createType(type.getId());
        if (type.isSimpleType()) {
            return;
        }
        regType.setChoiceMaxOccurrence(type.getChoiceMaxOccurrence());
        for (String attributeName : type.getAttributeNames()) {
            String attributeType = type.getAttributeTypeName(attributeName);
            registerTypes(types.get(attributeType), types);
            regType.addAttribute(
                attributeName,
                attributeType,
                type.getAttributeMinOccurrence(attributeName),
                type.getAttributeMaxOccurrence(attributeName));
        }
View Full Code Here


        if (getType(type.getId()) != null) {
            // type already registered
            return;
        }
        I_Type regType = createType(type.getId());
        if (type.isSimpleType()) {
            return;
        }
        regType.setChoiceMaxOccurrence(type.getChoiceMaxOccurrence());
        for (String attributeName : type.getAttributeNames()) {
            String attributeType = type.getAttributeTypeName(attributeName);
            registerTypes(types.get(attributeType), types);
            regType.addAttribute(
                attributeName,
                attributeType,
                type.getAttributeMinOccurrence(attributeName),
                type.getAttributeMaxOccurrence(attributeName));
        }
View Full Code Here

     */
    public void createNestedEntitiesForChoicePath(I_Entity value, List<String> choicePath) {

        I_Entity parentValue = value;
        for (String attributeChoice : choicePath) {
            I_Type choiceType = m_vie.getType(parentValue.getTypeName()).getAttributeType(Type.CHOICE_ATTRIBUTE_NAME);
            I_Entity choice = m_vie.createEntity(null, choiceType.getId());
            parentValue.addAttributeValue(Type.CHOICE_ATTRIBUTE_NAME, choice);
            I_Type choiceOptionType = choiceType.getAttributeType(attributeChoice);
            if (choiceOptionType.isSimpleType()) {
                String choiceValue = m_widgetService.getDefaultAttributeValue(attributeChoice);
                choice.addAttributeValue(attributeChoice, choiceValue);
                break;
            } else {
                I_Entity choiceValue = m_vie.createEntity(null, choiceOptionType.getId());
                choice.addAttributeValue(attributeChoice, choiceValue);
                parentValue = choiceValue;
            }
        }
    }
View Full Code Here

     * @param definition the content definition
     */
    public void registerContentDefinition(ContentDefinition definition) {

        m_widgetService.addConfigurations(definition.getConfigurations());
        I_Type baseType = definition.getTypes().get(definition.getEntityTypeName());
        m_vie.registerTypes(baseType, definition.getTypes());
        m_vie.registerTypes(baseType, definition.getTypes());
        m_vie.registerEntity(definition.getEntity());
    }
View Full Code Here

        Entity entity = (Entity)m_vie.getEntity(entityId);
        if (entity != null) {
            boolean initUndo = (m_entity == null) || !entity.getId().equals(m_entity.getId());
            m_entity = entity;
            I_Type type = m_vie.getType(m_entity.getTypeName());
            m_formPanel = new FlowPanel();
            context.add(m_formPanel);
            AttributeHandler.setScrollElement(scrollParent);
            ButtonBarHandler.INSTANCE.setWidgetService(m_widgetService);
            if (m_rootHandler == null) {
View Full Code Here

        Entity entity = (Entity)m_vie.getEntity(entityId);
        if (entity != null) {
            boolean initUndo = (m_entity == null) || !entity.getId().equals(m_entity.getId());
            m_entity = entity;
            I_Type type = m_vie.getType(m_entity.getTypeName());
            m_formPanel = new FlowPanel();
            context.add(m_formPanel);
            AttributeHandler.setScrollElement(scrollParent);
            ButtonBarHandler.INSTANCE.setWidgetService(m_widgetService);
            if (m_rootHandler == null) {
View Full Code Here

        if (m_entity != null) {
            m_rootHandler = new RootHandler();
            m_validationHandler.setContentService(m_service);
            m_validationHandler.registerEntity(m_entity);
            m_validationHandler.setRootHandler(m_rootHandler);
            I_Type type = m_vie.getType(m_entity.getTypeName());
            ButtonBarHandler.INSTANCE.setWidgetService(m_widgetService);
            m_widgetService.getRendererForType(type).renderInline(m_entity, formParent, this);
            UndoRedoHandler.getInstance().initialize(m_entity, this, m_rootHandler);
        }
    }
View Full Code Here

     */
    public void rerenderForm(I_Entity newContent) {

        m_validationHandler.setPaused(true, m_entity);
        m_vie.changeEntityContentValues(m_entity, newContent);
        I_Type type = m_vie.getType(m_entity.getTypeName());
        if ((m_tabInfos != null) && !m_tabInfos.isEmpty()) {
            int currentTab = m_formTabs.getSelectedIndex();
            m_formPanel.clear();
            m_rootHandler.clearHandlers();
            m_formTabs = m_widgetService.getRendererForType(type).renderForm(
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

        I_Entity parentEntity,
        AttributeHandler attributeHandler,
        int attributeIndex,
        Panel context) {

        I_Type entityType = m_vie.getType(parentEntity.getTypeName());
        I_Type attributeType = attributeHandler.getAttributeType();
        String attributeName = attributeHandler.getAttributeName();
        int minOccurrence = entityType.getAttributeMinOccurrence(attributeName);
        I_EntityAttribute attribute = parentEntity.getAttribute(attributeName);
        if ((attribute == null) && (minOccurrence > 0)) {
            attribute = createEmptyAttribute(parentEntity, attributeName, minOccurrence);
        }

        ValuePanel attributeElement = new ValuePanel();
        context.add(attributeElement);
        context.addStyleName(ENTITY_CLASS);
        RootHandler parentHandler = new RootHandler();
        parentHandler.ensureHandlers(attributeIndex);
        parentHandler.setHandler(attributeIndex, attributeName, attributeHandler);
        attributeHandler.setSingleValueIndex(attributeIndex);
        String label = m_widgetService.getAttributeLabel(attributeName);
        String help = m_widgetService.getAttributeHelp(attributeName);
        if (attribute != null) {
            I_EntityRenderer renderer = m_widgetService.getRendererForAttribute(attributeName, attributeType);
            AttributeValueView valueWidget = new AttributeValueView(attributeHandler, label, help);
            if (attributeType.isChoice() && (entityType.getAttributeMaxOccurrence(attributeName) == 1)) {
                valueWidget.setCollapsed(true);
            }
            attributeElement.add(valueWidget);
            if (attribute.isSimpleValue()) {
                valueWidget.setValueWidget(
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.