Package net.datacrow.core.objects

Examples of net.datacrow.core.objects.DcMapping


     * @param child The to be referenced item.
     * @param fieldIdx The field holding the reference.
     */
    @SuppressWarnings("unchecked")
    public static void addMapping(DcObject parent, DcObject child, int fieldIdx) {
        DcMapping mapping = (DcMapping) DcModules.get(DcModules.getMappingModIdx(parent.getModule().getIndex(), child.getModule().getIndex(), fieldIdx)).getItem();
        mapping.setValue(DcMapping._A_PARENT_ID, parent.getID());
        mapping.setValue(DcMapping._B_REFERENCED_ID, child.getID());
        mapping.setReference(child);
       
        Collection<DcMapping> mappings = (Collection<DcMapping>) parent.getValue(fieldIdx);
        mappings = mappings == null ? new ArrayList<DcMapping>() : mappings;
       
        // check if a mapping exists already
View Full Code Here


     * Creates a new instance of a mapping item.
     * @see DcMapping
     */
    @Override
    public DcObject createItem() {
        DcMapping mapping = new DcMapping(getIndex());
        return mapping;
    }   
View Full Code Here

        setTitle(DcModules.get(mappingModule.getReferencedModIdx()).getObjectNamePlural());
        buildDialog();
       
        DcSimpleValue sv;
        DcObject reference;
        DcMapping mapping;
        Collection<DcSimpleValue> selected = new ArrayList<DcSimpleValue>();
        for (DcObject dco : current) {
            mapping = (DcMapping) dco;
            reference = mapping.getReferencedObject();
            if (reference != null) {
                sv = new DcSimpleValue(reference.getID(),
                         String.valueOf(reference.getValue(reference.getSystemDisplayFieldIdx())),
                         reference.getIcon());
               
View Full Code Here

    }
   
    public Collection<DcObject> getDcObjects() {
        Collection<DcObject> items = new ArrayList<DcObject>();
        for (DcSimpleValue sv : getValues(tblSelectedItems)) {
            DcMapping mapping = (DcMapping) mappingModule.getItem();
            mapping.setValue(DcMapping._B_REFERENCED_ID, sv.getID());
            items.add(mapping);
        }
        return items;
    }
View Full Code Here

TOP

Related Classes of net.datacrow.core.objects.DcMapping

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.