Package com.nexirius.framework.datamodel

Examples of com.nexirius.framework.datamodel.DataModelEnumeration


    public void setMainAddress() {
        DataModel highlighted = getHighlightedItem();

        if (highlighted != null) {
            DataModelEnumeration en = getList().getEnumeration();

            while (en.hasMore()) {
                AddressModel address = (AddressModel) en.next();

                address.setMainAddress(address == highlighted);
            }
        } else {
            DialogManager.error("NothingHighlighted");
View Full Code Here


    public static final String DATA_MODEL = "DataModel";
    public static final String ARRAY_MODEL = "ArrayModel";

    public void generateXml(DataModelXmlGenerator generator, OutputStream out, DataModel model) throws IOException {
        DataModelVector children = model.getChildren();
        DataModelEnumeration en = children.getEnumeration();

        generator.startTag(out, ARRAY_MODEL, model.getFieldName());
        generator.newLine(out);
        generator.incrementIndent();
        while(en.hasMore()) {
            DataModel dataModel = en.next();

            generator.indent(out);
            generator.startTag(out, DATA_MODEL, dataModel.getClass().getName());
            generator.newLine(out);
            generator.incrementIndent();
View Full Code Here

public class StructModelXmlGenerator implements IXmlGenerator {
    public static final String STRUCT_MODEL = "StructModel";

    public void generateXml(DataModelXmlGenerator generator, OutputStream out, DataModel model) throws IOException {
        DataModelVector children = model.getChildren();
        DataModelEnumeration en = children.getEnumeration();

        generator.startTag(out, STRUCT_MODEL, model.getFieldName());
        generator.newLine(out);
        generator.incrementIndent();
        while(en.hasMore()) {
            DataModel dataModel = en.next();
            generator.indent(out);
            generator.generateXml(out, dataModel);
            generator.newLine(out);
        }
        generator.decrementIndent();
View Full Code Here

        super(mapping, createStoredProcedureSql(storedProcedureName, numberOfParameters), false);
        this.storedProcedureName = storedProcedureName;
    }

    public void setParameters(DataModelVector children) throws SQLException {
        DataModelEnumeration en = children.getEnumeration();

        int index = 0;

        while(en.hasMore()) {
            DataModel param = en.next();

            mapping.setValue(this, ++index, param);
        }
    }
View Full Code Here

            return true;
        }

        public boolean execute(HTMLSessionVariable sessionVariable) throws Exception {
            DataModelVector selectedChildren = sessionVariable.getSelectedChildren();
            DataModelEnumeration en = selectedChildren.getEnumeration();

            while (en.hasMore()) {
                DataModel model = en.next();

                PersistenceManager.remove(model);
                model.getParentDataModelContainer().removeItem(model);
            }
View Full Code Here

        JdbcConnectionHandler.instance().registerDatabaseTableMapping(ItemModel.class.getName(), itemMapping);
    }

    public static void save(ItemArrayModel array) throws Exception {
        DatabaseTableMapping m = JdbcConnectionHandler.instance().getDatabaseTableMapping(ItemModel.class.getName());
        DataModelEnumeration en = array.getEnumeration();
        DataModelVector remove = new DataModelVector();

        while (en.hasMore()) {
            ItemModel model = (ItemModel) en.next();

            if (model.getFlag(ModelFlag.DELETED)) {
                if (model.getInstanceName() == null) {
                    m.delete(model);
                }
View Full Code Here

    }
    //Method that defines that actual command and should return true if the transition
    //it could be mapped into should take place.
    public boolean execute(HTMLSessionVariable sessionVariable) throws Exception {
        DataModelVector selectedChildren = sessionVariable.getSelectedChildren();
        DataModelEnumeration en = selectedChildren.getEnumeration();

        while (en.hasMore()) {
            MainModel mainModel = ((MainModel) sessionVariable.getApplicationModel());

            DataModel model = en.next();
            mainModel.getPersonArray().removeItem(model);
        }

        return true;
    }
View Full Code Here

        DatabaseTableMapping phoneMapping = JdbcConnectionHandler.instance().getDatabaseTableMapping(PhoneModel.class.getName());

        try {
            mapping.search(null, new MemberModel(), members);

            DataModelEnumeration en = members.getEnumeration();

            while (en.hasMore()) {
                MemberModel member = (MemberModel) en.next();
                PersonModel person = member.getPerson();

                person.setInstanceName(member.getPersonId());
                personMapping.read(person);
View Full Code Here

        }
    }

    public void delete(DataModelVector v) {

        DataModelEnumeration en = v.getEnumeration();

        while (en.hasMore()) {
            DataModel model = en.next();
            DatabaseTableMapping mapping = JdbcConnectionHandler.instance().getDatabaseTableMapping(model.getClass().getName());
            try {
                mapping.delete(model);
            } catch (Exception e) {
                e.printStackTrace()//TODO
View Full Code Here

            }
        }
    }

    private void removeSelected() {
        DataModelEnumeration en = getList().getEnumeration();

        while (en.hasMore()) {
            MailModel mail = (MailModel) en.next();

            if (mail.isSelected()) {
                en.removeActualItem();
            }
        }

        getList().fireValueChange();
    }
View Full Code Here

TOP

Related Classes of com.nexirius.framework.datamodel.DataModelEnumeration

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.