Package com.alkacon.vie.shared

Examples of com.alkacon.vie.shared.I_Type


     * @return the entity attribute
     */
    protected I_EntityAttribute createEmptyAttribute(I_Entity parentEntity, String attributeName, int minOccurrence) {

        I_EntityAttribute result = null;
        I_Type attributeType = m_vie.getType(parentEntity.getTypeName()).getAttributeType(attributeName);
        if (attributeType.isSimpleType()) {
            for (int i = 0; i < minOccurrence; i++) {
                parentEntity.addAttributeValue(attributeName, m_widgetService.getDefaultAttributeValue(attributeName));
            }
            result = parentEntity.getAttribute(attributeName);
        } else {
            for (int i = 0; i < minOccurrence; i++) {
                parentEntity.addAttributeValue(attributeName, m_vie.createEntity(null, attributeType.getId()));
            }
            result = parentEntity.getAttribute(attributeName);
        }
        return result;
    }
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

            removeHandlers(currentPosition);
            I_Entity value = m_entity.getAttribute(m_attributeName).getComplexValues().get(currentPosition);
            m_entity.removeAttributeValue(m_attributeName, currentPosition);
            m_entity.insertAttributeValue(m_attributeName, value, targetPosition);
            String attributeChoice = getChoiceName(targetPosition);
            I_Type optionType = getAttributeType().getAttributeType(attributeChoice);
            valueWidget = new AttributeValueView(
                this,
                m_widgetService.getAttributeLabel(attributeChoice),
                m_widgetService.getAttributeHelp(attributeChoice));
            parent.insert(valueWidget, targetPosition);
            insertHandlers(targetPosition);
            if (optionType.isSimpleType()) {
                valueWidget.setValueWidget(
                    m_widgetService.getAttributeFormWidget(attributeChoice),
                    value.getAttribute(attributeChoice).getSimpleValue(),
                    true);
            } else {
View Full Code Here

     * @param choicePath the choice attribute path
     */
    private void addChoiceOption(AttributeValueView reference, List<String> choicePath) {

        String attributeChoice = choicePath.get(0);
        I_Type optionType = getAttributeType().getAttributeType(attributeChoice);

        I_Entity choiceEntity = m_vie.createEntity(null, getAttributeType().getId());
        AttributeValueView valueWidget = reference;
        if (reference.hasValue()) {
            valueWidget = new AttributeValueView(
                this,
                m_widgetService.getAttributeLabel(attributeChoice),
                m_widgetService.getAttributeHelp(attributeChoice));
        }

        List<ChoiceMenuEntryBean> menuEntries = Renderer.getChoiceEntries(getAttributeType(), true);
        for (ChoiceMenuEntryBean menuEntry : menuEntries) {
            valueWidget.addChoice(m_widgetService, menuEntry);
        }
        int valueIndex = reference.getValueIndex() + 1;
        m_entity.insertAttributeValue(m_attributeName, choiceEntity, valueIndex);
        ((FlowPanel)reference.getParent()).insert(valueWidget, valueIndex);
        insertHandlers(valueWidget.getValueIndex());

        if (optionType.isSimpleType()) {
            String value = m_widgetService.getDefaultAttributeValue(attributeChoice);
            I_FormEditWidget widget = m_widgetService.getAttributeFormWidget(attributeChoice);
            choiceEntity.addAttributeValue(attributeChoice, value);
            valueWidget.setValueWidget(widget, value, true);
        } else {
            I_Entity value = m_vie.createEntity(null, optionType.getId());
            choiceEntity.addAttributeValue(attributeChoice, value);
            List<String> remainingAttributeNames = tail(choicePath);
            createNestedEntitiesForChoicePath(value, remainingAttributeNames);
            I_EntityRenderer renderer = m_widgetService.getRendererForAttribute(attributeChoice, optionType);
            valueWidget.setValueEntity(renderer, value);
View Full Code Here

    private void addComplexChoiceValue(AttributeValueView reference, List<String> choicePath) {

        I_Entity value = m_vie.createEntity(null, getAttributeType().getId());
        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;
            }
        }
        insertValueAfterReference(value, reference);
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

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.