Package net.datacrow.core.modules

Examples of net.datacrow.core.modules.DcModule


    public abstract Collection<Picture> getPictures();
   
    private boolean loading = false;
   
    public int[] getFields() {
      DcModule module = DcModules.get(getModule());
      return module.isAbstract() ? new int[] {DcObject._ID} : module.getMinimalFields(getFields(getModule()));
    }
View Full Code Here


    }
   
    public boolean load() {
        int count = getComponentCount();
        if (count == 0 && !loading) {
            DcModule module = DcModules.get(getModule());
           
            if (dco == null) {
                dco = DataManager.getItem(getModule(), key, getFields());
                //this.module = dco.getModule().getIndex();
                if (module.isAbstract())
                    dco.reload();
            }

            loading = true;
            build();
View Full Code Here

   
    @Override
    public void build() {
        setLayout(layout);
 
        DcModule module = DcModules.get(entry.getModule());
        DcField field = module.getField(entry.getField());
        Operator operator = entry.getOperator();
       
       
        JLabel labelAnd = ComponentFactory.getLabel(entry.getAndOr());
        JLabel labelMod = ComponentFactory.getLabel(module.getLabel());
        JLabel labelFld = ComponentFactory.getLabel(field.getLabel());
        JLabel labelOp = ComponentFactory.getLabel(operator.toString());
        JLabel labelVal = ComponentFactory.getLabel(
                entry.getValue() != null ? entry.getValue().toString() : "");
       
View Full Code Here

        if (e.getActionCommand().equals("paste"))
            paste(vc);
    }
   
    private void paste(IViewComponent vc) {
        DcModule module = vc.getModule();
       
        int[] fields = (int[]) vc.getModule().getSetting(DcRepository.ModuleSettings.stTableColumnOrder);
       
        try {
            String text = (String) (clipboard.getContents(this).getTransferData(DataFlavor.stringFlavor));
            StringTokenizer rowTokenizer = new StringTokenizer(text, "\n");
            for (int i = 0; rowTokenizer.hasMoreTokens(); i++) {
                String values = rowTokenizer.nextToken();
                DcObject dco = module.getItem();

                int fldCounter = 0;
                int index = values.indexOf("\t");
                while (index > -1) {
                    String value = values.substring(0, index);
View Full Code Here

       
        return sb.toString();
    }

    private DcField getField(int modIdx, String label) {
        DcModule module = DcModules.get(modIdx);
        for (DcField field : module.getFields()) {
            if (field.getSystemName().equals(label)) {
                return field;
           
            } else if (module.getParent() != null && 
                       module.getParent().getObjectName().equals(label)) {
               
                return field;
            }
        }
        return null;
View Full Code Here

    }
   
    @Override
    public int[] getFields() {
      // only return one field for performance reasons, especially for abstract module children
      DcModule module = DcModules.get(getModule());
      return module.getType() == DcModule._TYPE_PROPERTY_MODULE ?
          new int[] {DcProperty._ID, module.getDisplayFieldIdx(), DcProperty._B_ICON} : new int[] {DcObject._ID, module.getDisplayFieldIdx()};
    }
View Full Code Here

        this.groupingPane = mv.getGroupingPane();
        this.type = type;
        this.vc = vc;
        this.index = index;
       
        DcModule cm = vc.getModule() != null ? vc.getModule().getChild() : null;
        this.childView = cm != null ?
                getType() == _TYPE_SEARCH ? cm.getSearchView().get(index) :
                cm.getInsertView().get(index) : null;
       
        if (childView != null)
            childView.setParentView(this);
               
        vc.addMouseListener(vml);
View Full Code Here

    }   
   
  public void addModules() {
        if (elements != null) elements.clear();
       
        DcModule referencedMod;
        for (DcModule module : DcModules.getAllModules()) {
            try {
               
                if (module.isSelectableInUI() && module.isEnabled()) {
                   
                    List<ModulePanel> c = new ArrayList<ModulePanel>();
                    c.add(new ModulePanel(module, ModulePanel._ICON32));
                   
                    for (DcField field : module.getFields()) {
                        referencedMod = DcModules.getReferencedModule(field);
                        if (    referencedMod.isEnabled() &&
                            referencedMod.getIndex() != module.getIndex() &&
                                referencedMod.getType() != DcModule._TYPE_PROPERTY_MODULE &&
                                referencedMod.getType() != DcModule._TYPE_EXTERNALREFERENCE_MODULE &&
                                referencedMod.getIndex() != DcModules._CONTACTPERSON &&
                                referencedMod.getIndex() != DcModules._CONTAINER) {
                           
                            c.add(new ModulePanel(referencedMod, ModulePanel._ICON16));
                        }
                    }
                    elements.put(module.getIndex(), c);
View Full Code Here

    private void handle(DcObject dco, Collection<String> handled) throws IOException {
        for (int fieldIdx : fields) {
            DcField field = dco.getField(fieldIdx);
            if (field != null && field.getValueType() == DcRepository.ValueTypes._DCOBJECTCOLLECTION) {
                DcModule sm = DcModules.get(field.getReferenceIdx());
                DcObject so = sm.getItem();

                if (!handled.contains(so.getModule().getSystemObjectName())) {
                    writeDco(so);
                    newLine();
                }
View Full Code Here

   
    private void writeField(DcField field) throws IOException {
        String label = getValidTag(field.getSystemName());

        if (field.getValueType() == DcRepository.ValueTypes._DCOBJECTCOLLECTION) {
            DcModule sm = DcModules.get(field.getReferenceIdx());
            String name = getValidTag(field.getSystemName());
            String reference = getValidTag(sm.getSystemObjectName());

            writeLine("<xsd:element name=\"" + name + "\"/>", 3);
            addReference(name, reference);
        } else {
            String type;
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.