Package net.datacrow.settings.definitions

Examples of net.datacrow.settings.definitions.DcFieldDefinitions


    }

    public void setVisibleColumns(int[] fields) {
        removeColumns();
       
        DcFieldDefinitions definitions = (DcFieldDefinitions)
            module.getSetting(DcRepository.ModuleSettings.stFieldDefinitions);

        for (int field : fields) {

            DcFieldDefinition definition = definitions.get(field);

            if (!module.canBeLend()
                    && (field == DcObject._SYS_AVAILABLE
                     || field == DcObject._SYS_LOANDURATION
                     || field == DcObject._SYS_LENDBY
View Full Code Here


        getSettings().addGroup(_General, generalGroup);
    }
   
    private void createDefinitions(DcModule module) {
       
        DcFieldDefinitions fldDefinitions = new DcFieldDefinitions();
        WebFieldDefinitions webDefinitions = new WebFieldDefinitions();
       
        QuickViewFieldDefinitions qvDefinitions = new QuickViewFieldDefinitions();
       
        for (DcField field : module.getFields()) {
            fldDefinitions.add(new DcFieldDefinition(field.getIndex(), null, field.isEnabled(), false, false, false, null));
            qvDefinitions.add(new QuickViewFieldDefinition(field.getIndex(), field.isEnabled(), DcResources.getText("lblHorizontal"), 0));
            webDefinitions.add(new WebFieldDefinition(field.getIndex(), 100, 0, field.isEnabled(), field.getIndex() == DcMediaObject._A_TITLE, field.getIndex() == DcMediaObject._A_TITLE));
        }
       
        getSettings().addSetting(_General,
View Full Code Here

        this.module = module;
        build();
    }
   
    protected void save() {
        DcFieldDefinitions definitions = new DcFieldDefinitions();
        for (String key : listsRight.keySet()) {
            for (DcField field : listsRight.get(key).getFields()) {
                DcFieldDefinition definition = field.getDefinition();
                definition.setTab(key);
                definitions.add(definition);
            }
        }
       
        for (DcFieldDefinition definition : module.getFieldDefinitions().getDefinitions()) {
            if (definitions.get(definition.getIndex()) == null)
                definitions.add(definition);
        }
       
        module.setSetting(DcRepository.ModuleSettings.stFieldDefinitions, definitions);
    }
View Full Code Here

            DcModule result = DcModules.convert(module);
            DcModules.register(result);
            DcModules.registerPropertyModules(result);

            Settings settings = result.getSettings();
            DcFieldDefinitions definitions = (DcFieldDefinitions) settings.getDefinitions(DcRepository.ModuleSettings.stFieldDefinitions);
            DcFieldDefinition definition;
            for (XmlField field : module.getFields()) {
                definition = definitions.get(field.getIndex());
               
                if (field.getDefinition() != null) {
                    definition.setEnabled(true);
                    definition.setTab(field.getDefinition().getTab());
                    definition.setUnique(field.getDefinition().isUnique());
View Full Code Here

        for (WebFieldDefinition definition : webDefinitions.getDefinitions()) {
            if (getField(definition.getField()) != null)
                newWebDefinitions.add(definition);
        }
       
        DcFieldDefinitions definitions =
            (DcFieldDefinitions) settings.get(DcRepository.ModuleSettings.stFieldDefinitions);
       
        DcFieldDefinitions newDefinitions = new DcFieldDefinitions();
        for (DcFieldDefinition definition : definitions.getDefinitions()) {
            if (getField(definition.getIndex()) != null)
                newDefinitions.add(definition);
        }
       
        settings.set(DcRepository.ModuleSettings.stQuickViewFieldDefinitions, newQvDefinitions);
        settings.set(DcRepository.ModuleSettings.stFieldDefinitions, newDefinitions);
        settings.set(DcRepository.ModuleSettings.stWebFieldDefinitions, newWebDefinitions);
View Full Code Here

                }
            }
        }

        private void save() {
            DcFieldDefinitions definitions = getDefinitions();
            module.setSetting(DcRepository.ModuleSettings.stFieldDefinitions, definitions);

            // other settings depend on the global definitions settings
            definitions.checkDependencies();

            if (module.hasSearchView())
                module.getSearchView().applySettings();

            if (module.hasInsertView())
                module.getInsertView().applySettings();

            for (DcFieldDefinition def : definitions.getDefinitions()) {
                DcField field = module.getField(def.getIndex());
                field.setRequired(def.isRequired());
                field.setEnabled(def.isEnabled());
            }
        }
View Full Code Here

        }

        public DcFieldDefinitions getDefinitions() {
            table.cancelEdit();

            DcFieldDefinitions definitions = new DcFieldDefinitions();
            for (int i = 0; i < table.getRowCount(); i++)
                definitions.add(getDefinition(i));

            return definitions;
        }
View Full Code Here

     * The field settings/definitions.
     * @see DcModule#getFieldDefinitions()
     */   
    @Override
    public DcFieldDefinitions getFieldDefinitions() {
        DcFieldDefinitions fds = parent.getFieldDefinitions();
        DcFieldDefinitions definitions = new DcFieldDefinitions();
       
        definitions.add(new DcFieldDefinition(DcTemplate._SYS_TEMPLATENAME, null, true, true, true, true, "lblSummary"));
        definitions.add(new DcFieldDefinition(DcTemplate._SYS_DEFAULT, null, true, true, true, false, "lblSummary"));
       
        for (DcFieldDefinition fd : fds.getDefinitions())
            definitions.add(new DcFieldDefinition(fd.getIndex(), fd.getLabel(), fd.isEnabled(), false, false, false, fd.getTab(parent.getIndex())));
       
        return definitions;
    }     
View Full Code Here

                        else if (key.equals(DcRepository.ModuleSettings.stQuickViewFieldDefinitions))
                            definitions = new QuickViewFieldDefinitions();
                        else if (key.equals(DcRepository.ModuleSettings.stWebFieldDefinitions))
                            definitions = new QuickViewFieldDefinitions();
                        else
                            definitions = new DcFieldDefinitions();
                    }
                   
                    while (group > -1) {
                        String value = sValue.substring(1, group);
                        definitions.add(value);
View Full Code Here

                return enabled;

            if (DcModules.get(getModule()).getSettings() == null)
                return enabled;
           
            DcFieldDefinitions definitions = (DcFieldDefinitions)
                DcModules.get(getModule()).getSettings().getDefinitions(DcRepository.ModuleSettings.stFieldDefinitions);
           
            for (DcFieldDefinition definition : definitions.getDefinitions()) {
                if (definition.getIndex() == getIndex())
                    return definition.isEnabled();
               
            }
           
View Full Code Here

TOP

Related Classes of net.datacrow.settings.definitions.DcFieldDefinitions

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.