Package clips.delegate.directory.complex

Examples of clips.delegate.directory.complex.DirectoryDoctorActionItem


    public int getChildCount(Object parent) {
       // try {
            if(parent instanceof DefaultMutableTreeNode) {
                return directory.getItems().size();
            } else {
                DirectoryDoctorActionItem item = (DirectoryDoctorActionItem) parent;
                return item.getItems().size();
            }
      /*  } catch (ClipsException ex) {
            ex.printStackTrace();
        }
        return 0;*/
 
View Full Code Here


    public Object getChild(Object parent, int index) {
       // try {
            if(parent instanceof DefaultMutableTreeNode) {
              return directory.getItems().get(index);
            } else {
                DirectoryDoctorActionItem item = (DirectoryDoctorActionItem) parent;
                return item.getItems().get(index);
            }
      /*  } catch (ClipsException ex) {
            ex.printStackTrace();
        }
        return null;*/
 
View Full Code Here

   
    public void uploadDoctorAction() throws IOException, ClipsException {
    DirectoryDoctorAction dirAction =
                (DirectoryDoctorAction) DirectoryLocator.getDirectory(DirectoryDoctorAction.class, false);
       
        DirectoryDoctorActionItem parent = null;
        DirectoryDoctorActionItem current = null;
        DirectoryDoctorActionItem item = null;
       
        String line = input.readLine();
        while (line != null) {
            if (!line.trim().isEmpty()) {
                int pos = line.indexOf('|');
                if (pos > -1) {
                    String code = line.substring(0, pos);
                    String title = line.substring(pos + 1);
                    if (code.length() == 2) {
                        DoctorActionDetails details = new DoctorActionDetails();
                        details.parentItem = 0;
                        details.title = title;
                        details.code = code;
                       
                        parent = new DirectoryDoctorActionItem(details);
                        dirAction.getItems().append(parent);
                       
                        System.out.println(code + " " + title);
                    }
                    else if (code.length() == 5) {
                        code = code.substring(3, 5);
                       
                        DoctorActionDetails details = new DoctorActionDetails();
                        details.parentItem = parent.getID();
                        details.title = title;
                        details.code = code;
                       
                        current = new DirectoryDoctorActionItem(details);
                        dirAction.getItems().append(current);
                       
                        System.out.println("   " +code + " " + title);
                    }
                    else if (code.length() == 9) {
                        code = code.substring(6);                       
                       
                        DoctorActionDetails details = new DoctorActionDetails();
                        details.parentItem = current.getID();
                        details.title = title;
                        details.code = code;
                       
                        item = new DirectoryDoctorActionItem(details);
                        dirAction.getItems().append(item);
                       
                        System.out.println("     " +code + " " + title);
                    }
                }
View Full Code Here

        }
       
        Map<String, DirectoryDoctorActionItem> actionMap = new HashMap<String, DirectoryDoctorActionItem>();
        DirectoryItemRO[] actionArr = dirAction.toArray(false, true);
        for (int i = 0; i < actionArr.length; i++) {
            DirectoryDoctorActionItem item = (DirectoryDoctorActionItem) actionArr[i];
            actionMap.put(item.getGroupCode(), item);
        }
       
        DirectoryServiceItem pservice = null;
        DirectoryServiceItem cservice = null;
        DirectoryDoctorActionItem action = null;
       
        String line = input.readLine();
        while (line != null) {
            if (!line.trim().isEmpty()) {
                int pos = line.indexOf('|');
View Full Code Here

        initComponents();
        this.service = service;
        SelectorEditableExceptional<DirectoryDoctorActionItem> doctorActions = service.getDoctorActions();
        actionList = new ArrayList<DirectoryDoctorActionItem>();
        for (int i = 0; i < doctorActions.size(); i++) {
            DirectoryDoctorActionItem directoryDoctorActionItem = doctorActions.get(i);
            actionList.add(directoryDoctorActionItem);
        }
        DirectoryDoctorAction directory = (DirectoryDoctorAction) DirectoryLocator.getDirectory(DirectoryDoctorAction.class, false);
        treeModel = new TreeModelDirectoryActions(directory);
        jTree1.setModel(treeModel);
View Full Code Here

            listModel = new DefaultListModel();
            jList1.setModel(listModel);
        }
        listModel.clear();
        for (int i = 0; i < actionList.size(); i++) {
            DirectoryDoctorActionItem action = actionList.get(i);
            listModel.addElement(action);
        }
    }
View Full Code Here

private void btOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btOKActionPerformed
    try {
        SelectorEditableExceptional<DirectoryDoctorActionItem> doctorActions = service.getDoctorActions();
        //Убираем лишние
        for (int i = doctorActions.size() - 1; i >=0 ; i--) {
            DirectoryDoctorActionItem item = doctorActions.get(i);
            if (!actionList.contains(item)) {
                doctorActions.remove(i);
            }
        }
        //Добавляем недостающие
        for (int i = 0; i < actionList.size(); i++) {
            DirectoryDoctorActionItem newItem = actionList.get(i);
            boolean founded = false;
            for (int j = 0; j < doctorActions.size(); j++) {
                DirectoryDoctorActionItem item = doctorActions.get(j);
                if (item.equals(newItem)) {
                    founded = true;
                    break;
                }
            }
            if (!founded) {
View Full Code Here

    ArrayList<DirectoryDoctorActionItem> acs = new ArrayList<DirectoryDoctorActionItem>();
    for (int i = 0; i < paths.length; i++) {
        acs.add((DirectoryDoctorActionItem)paths[i].getLastPathComponent());
    }
    for (int i = 0; i < acs.size(); i++) {
        DirectoryDoctorActionItem item = acs.get(i);
        if (!actionList.contains(item)) {
            actionList.add(item);
        }
    }
    refreshList();
View Full Code Here

    if (evt.getClickCount() == 2) {
        Object node = jTree1.getLastSelectedPathComponent();
        if (node != null && treeModel.isLeaf(node)) {
            boolean founded = false;
            for (int i = 0; i < actionList.size(); i++) {
                DirectoryDoctorActionItem oldItem = actionList.get(i);
                if (node.equals(oldItem)) {
                    founded = true;
                    break;
                }
            }
View Full Code Here

            jList1.setModel(listModel);
        }
        listModel.clear();
        SelectorEditableExceptional<DirectoryDoctorActionItem> doctorActions = serRenLocal.getService().getDoctorActions();
        for (int i = 0; i < doctorActions.size(); i++) {
            DirectoryDoctorActionItem action = doctorActions.get(i);
            listModel.addElement(action);
        }
    }
View Full Code Here

TOP

Related Classes of clips.delegate.directory.complex.DirectoryDoctorActionItem

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.