Package net.datacrow.core.modules

Examples of net.datacrow.core.modules.DcModule


        JMenuItem menuInsertDir = ComponentFactory.getMenuItem(DcResources.getText("lblInsertDirectory"));
        JMenuItem menuRemove = ComponentFactory.getMenuItem(DcResources.getText("lblRemove"));

        JMenu menuInsertField = ComponentFactory.getMenu(DcResources.getText("lblInsertField"));
       
        DcModule module = DcModules.get(modIdx);
        for (DcField field : DcModules.get(modIdx).getFields()) {
           
          if (field.getIndex() == DcObject._SYS_CONTAINER)
            continue;
         
            if (field.getIndex() == module.getParentReferenceFieldIndex()) {
              JMenuItem menuField = ComponentFactory.getMenuItemmodule.getParent().getObjectName());
                menuField.setActionCommand(String.valueOf(field.getIndex()));
                menuField.addActionListener(fpf);
                menuInsertField.add(menuField);
            } else if (isValid(field)) {
                JMenuItem menuField = ComponentFactory.getMenuItem(field.getSystemName());
View Full Code Here


        build();
        comboModules.setSelectedIndex(0);
    }
   
    public void applyEntry(DataFilterEntry entry) {
        DcModule module = DcModules.get(entry.getModule());
        DcField field = module.getField(entry.getField());
        Operator operator = entry.getOperator();
       
        comboModules.setSelectedItem(module);
       
        setFields(module);
View Full Code Here

        }
       
        protected void createTree() {
            build();
           
            DcModule m = DcModules.get(getModule());
            StringBuffer sql = new StringBuffer("");
            Collection<DcModule> modules = new ArrayList<DcModule>();
           
            if (m.isAbstract()) {
              for (DcModule module : DcModules.getAllModules()) {
                if (module.getType() == m.getType() && !module.isAbstract())
                  modules.add(module);
              }
            } else {
              modules.add(m);
            }
           
            int moduleCounter = 0;
            for (DcModule module : modules) {
              if (moduleCounter > 0)
                sql.append(" UNION ");
             
              sql.append("SELECT ID, ");
              sql.append(module.getIndex());
              sql.append(" AS MODULEIDX, ");
              sql.append(module.getFileField().getDatabaseFieldName());
              sql.append(" AS FILENAME FROM ");
              sql.append(module.getTableName());
              sql.append(" WHERE ");
              sql.append(module.getFileField().getDatabaseFieldName());
              sql.append(" IS NOT NULL ");
            }
           
            if (m.isAbstract()) {
              sql.insert(0, "select ID, FILENAME from (");
              sql.append(") ");
          }

            sql.append(" ORDER BY FILENAME");
View Full Code Here

        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

        this.getContentPane().setLayout(Layout.getGBL());

        initializeComponents();
        final DcModule module = DcModules.get(moduleIdx);
        JPanel panelActions = getActionPanel(module, readonly);

        addInputPanels();
        addChildrenPanel();
        addPictureTabs();
        addRelationPanel();
       
        if (module.canBeLend() && SecurityCentre.getInstance().getUser().isAuthorized("Loan") && update && !readonly) {
            addLoanTab();
        }

        getContentPane().add(tabbedPane,  Layout.getGBC(0, 0, 1, 1, 1.0, 1.0
                            ,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
                             new Insets(0,0,15,0), 0, 0));
        getContentPane().add(panelActions,  Layout.getGBC(0, 1, 1, 1, 0.0, 0.0
                            ,GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE,
                             new Insets(5, 5, 5, 5), 0, 0));

        setRequiredFields();
        setReadonly(readonly);
        setData(dco, true, false);

        pack();
       
        applySettings();
        setCenteredLocation();
       
        addWindowListener(new WindowAdapter() {
            @Override
            public void windowOpened(WindowEvent we) {
                try {
                 
                    for (DcFieldDefinition definition : module.getFieldDefinitions().getDefinitions()) {
                        int index = definition.getIndex();
                        DcField field = dco.getField(index);
                        JComponent component = fields.get(field);
                       
                        if (component == null)
View Full Code Here

        }
    }
   
    protected void applySettings() {
        DcModule m = dcoOrig != null ? dcoOrig.getModule() : DcModules.get(moduleIdx);
        setSize(m.getSettings().getDimension(DcRepository.ModuleSettings.stItemFormSize));
    }
View Full Code Here

    protected void addInputPanels() {
        Map<String, Integer> positions = new HashMap<String, Integer>();
        Map<String, JPanel> panels = new LinkedHashMap<String, JPanel>();
       
        DcModule module = DcModules.get(moduleIdx);
       
        for (DcFieldDefinition definition : module.getFieldDefinitions().getDefinitions()) {
            String name = definition.getTab(module.getIndex());
            if (name != null && name.trim().length() > 0)
                DataManager.checkTab(module.getIndex(), name);
        }
       
        // get the tabs (sorted) and initialize the panels
        for (DcObject tab : DataManager.getTabs(moduleIdx)) {
            String name = tab.getDisplayString(Tab._A_NAME);
            JPanel panel = new JPanel();
            panel.setLayout(Layout.getGBL());
            panels.put(name, panel);
        }
       
        // add the fields to the panels
        for (DcFieldDefinition definition : module.getFieldDefinitions().getDefinitions()) {
           
            String name = definition.getTab(module.getIndex());
            if (name == null || name.trim().length() == 0)
                continue;

            JPanel panel = panels.get(name);
            if (!positions.containsKey(name))
View Full Code Here

            }
        }
    }

    protected void addChildrenPanel() {
        DcModule module = DcModules.get(moduleIdx);
        DcModule childModule = module.getChild();
       
        if (childModule != null) {
            IChildModule m = (IChildModule) childModule;
            childView = m.getItemView(dco, childModule.getIndex(), !update);
            childView.hideDialogActions(true);
            tabbedPane.addTab(childModule.getObjectNamePlural(), childModule.getIcon16(), childView.getContentPane());
        }
    }
View Full Code Here

    protected void addLoanTab() {
        tabbedPane.addTab(DcResources.getText("lblLoan"), IconLibrary._icoLoan, new LoanPanel(dco, null));
    }

    protected void addPictureTabs() {
        DcModule module = DcModules.get(moduleIdx);

        for (DcFieldDefinition definition : module.getFieldDefinitions().getDefinitions()) {
            int index = definition.getIndex();
            DcField field = dco.getField(index);
            JComponent component = fields.get(field);

            if (field.isEnabled() &&
View Full Code Here

        super();
       
        setTitle(DcResources.getText("lblViewSettings"));
        setHelpIndex("dc.settings.cardview");

        DcModule module = DcModules.getCurrent();
   
        build();
        pack();
       
        setSize(module.getSettings().getDimension(DcRepository.ModuleSettings.stCardViewSettingsDialogSize));
        setCenteredLocation();
    }
View Full Code Here

        setSize(module.getSettings().getDimension(DcRepository.ModuleSettings.stCardViewSettingsDialogSize));
        setCenteredLocation();
    }

    private void save() {
        DcModule module = DcModules.getCurrent();
       
        DcField[] f = fsp.getSelectedFields();
        int[] fields = new int[f.length];
        int idx = 0;
        for (DcField field : f) {
            fields[idx++] = field.getIndex();
        }
       
        module.setSetting(DcRepository.ModuleSettings.stCardViewItemDescription, fields);
        cisp.save();
       
        if (module.hasSearchView())
            module.getSearchView().applySettings();

        if (module.hasInsertView())
            module.getInsertView().applySettings();
       
        close();
    }
View Full Code Here

TOP

Related Classes of net.datacrow.core.modules.DcModule

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.