Package clips.delegate.directory.complex

Examples of clips.delegate.directory.complex.DirectoryServicesGroupItem


private void treeServiceGroupKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_treeServiceGroupKeyPressed
    try {
        int code = evt.getKeyCode();
        if (evt.isControlDown() && code == 86 && serviceItemToMove != null) {
            if (treeServiceGroup.getLastSelectedPathComponent() instanceof DirectoryServicesGroupItem) {
                DirectoryServicesGroupItem groupItem = (DirectoryServicesGroupItem) treeServiceGroup.getLastSelectedPathComponent();
                serviceItemToMove.setGroup(groupItem);
                setTable();
                serviceItemToMove = null;
            }
        }
View Full Code Here


*/
private void rename() {
    Object value = treeServiceGroup.getLastSelectedPathComponent();
    try {
        if (value instanceof DirectoryServicesGroupItem) {
            DirectoryServicesGroupItem selected = (DirectoryServicesGroupItem) value;
            tfGroupCodePref.setText(selected.getParent() != null?
                                selected.getParent().getFullCode(): "");
            tfName.setText(selected.getTitle());
            tfGroupCode.setText(selected.getCode());
            int res = JOptionPane.showOptionDialog(this, pnlNewNode, "Переименовать", JOptionPane.OK_CANCEL_OPTION,
                            JOptionPane.PLAIN_MESSAGE, null, a, -1);
            if (res == JOptionPane.OK_OPTION) {
                if (tfName.getText().isEmpty()) {
                    MessageBox.showError(MessageBox.E_MAKE_FUCKING_EXCEPTION, "Данные некорректны");
                    return;
                } else {
                    selected.rename(tfGroupCode.getText(), tfName.getText());
                }
            }
        }
    } catch (ClipsException ex) {
        MessageBox.showException(ex);
View Full Code Here

    if (treeServiceGroup.getPathForLocation(evt.getX(), evt.getY()) == null) {
        return;
    }
    Object obj = treeServiceGroup.getPathForLocation(evt.getX(), evt.getY()).getLastPathComponent();
    if (obj instanceof DirectoryServicesGroupItem) {
        DirectoryServicesGroupItem item = (DirectoryServicesGroupItem) obj;
        treeServiceGroup.setToolTipText(item.getTitle());
    }
    else {
        treeServiceGroup.setToolTipText(null);
    }
}//GEN-LAST:event_treeServiceGroupMouseMoved
View Full Code Here

                tabService.getCellEditor().stopCellEditing();
            }
            String title = "Услуги группы:";
           
            String group = "";
            DirectoryServicesGroupItem parent = serviceGroup;
            ArrayList<String> titles = new ArrayList<String>();
            while (parent != null) {
                titles.add(parent.getTitle()+ "\n");               
                parent = parent.getParent();
            }
            int k = titles.size() - 1;
            for (int i = k; i > -1; i--) {
                String iS  = titles.get(i);
                for (int j = i; j < k; j++) {
View Full Code Here

    public Object getChild(Object parent, int index) {
        try {
            if(parent instanceof DefaultMutableTreeNode) {
              return di.get(index);
            } else {
                DirectoryServicesGroupItem item = (DirectoryServicesGroupItem) parent;
                SelectorEditableExceptional<DirectoryServicesGroupItem> it = item.getItems();
                if (index < it.size()) {                                       
                    return it.get(index);
                } else {                   
                    return getServices(item).get(index - it.size());
                }
View Full Code Here

    public int getChildCount(Object parent) {
        try {
            if(parent instanceof DefaultMutableTreeNode) {
                return di.size();
            } else {
                DirectoryServicesGroupItem item = (DirectoryServicesGroupItem) parent;
                SelectorEditableExceptional<DirectoryServicesGroupItem> it = item.getItems();
                return it.size() + getServices(item).size();
            }
        } catch (ClipsException ex) {
            ex.printStackTrace();
        }
View Full Code Here

            return root.getChildAt(index);
        } else if (parent == SERVICES) {
            return dsg.getItems().get(index);
        } else if (parent instanceof DirectoryServicesGroupItem) {
            try {
                DirectoryServicesGroupItem item = (DirectoryServicesGroupItem) parent;
                SelectorEditableExceptional<DirectoryServicesGroupItem> groups = item.getItems();
                if (index < groups.size()) {
                    return groups.get(index);
                } else {
                    return getServices(item).get(index - groups.size());
                }
            } catch (ClipsException ex) {
                return new ErrorValue(ex);
            }

        }  else if (parent == SERVICE_PACKETS) {
            return packetList.get(index);
        else if (parent == medexamS) {
            return medexamList.get(index);
        else if (parent == PROFCHECKUPS) {
            return profcheckupList.get(index);
        else if (parent == DISPANSERS) {
            return dispanserList.get(index);

        } else if (parent instanceof DirectoryPacketTemplateItem) {
            DirectoryPacketTemplateItem item = (DirectoryPacketTemplateItem) parent;
            DirectoryPacketTemplateListItem pItem = item.getPacketItem(index);
            Object s = pItem;
            return s;
        } else {
            throw new IllegalArgumentException("Неизвестный элемент дерева");
        }
View Full Code Here

        else if (parent == SERVICES) {
            return dsg.getItems().size();
        }
        else if (parent instanceof DirectoryServicesGroupItem) {
            try {
                DirectoryServicesGroupItem item = (DirectoryServicesGroupItem) parent;
                return item.getItems().size() + getServices(item).size();
            } catch (ClipsException ex) {
                MessageBox.showException(ex);
                return 0;
            }
        }  else if (parent == SERVICE_PACKETS) {
            return packetList.size();
        else if (parent == medexamS) {
            return medexamList.size();
        else if (parent == PROFCHECKUPS) {
            return profcheckupList.size();
        else if (parent == DISPANSERS) {
            return dispanserList.size();

        }
        else if (parent instanceof DirectoryPacketTemplateItem) {
            try {
                DirectoryPacketTemplateItem item = (DirectoryPacketTemplateItem) parent;
                return item.getPacketItemCount();
            } catch (ClipsException ex) {
                MessageBox.showException(ex);
                return 0;
            }
        }
View Full Code Here

            ArrayList path = new ArrayList();
            path.add(item);
            return path;
        }
        if (item instanceof DirectoryServicesGroupItem) {
            DirectoryServicesGroupItem parent = (DirectoryServicesGroupItem) item;
            Selector ii = parent.getItems();
            for (int i = 0; i < ii.size(); i++) {
                DirectoryItem child = (DirectoryItem) ii.get(i);
                List path = findMatch(child, pattern);
                if (path != null) {
                    path.add(parent);
View Full Code Here

    public Object getChild(Object parent, int index) {
        try {
            if(parent instanceof DefaultMutableTreeNode) {
                return items[index];
            } else if(parent instanceof DirectoryServicesGroupItem) {
                DirectoryServicesGroupItem item = (DirectoryServicesGroupItem) parent;
                if(index < item.getItems().size()) {
                    return item.getItems().get(index);
                }
                index -= item.getItems().size();
                Selector<DirectoryServiceItem> ss = getServices(item);
                return ss.get(index);
            }           
        } catch(ClipsException ex) {
            ex.printStackTrace();
View Full Code Here

TOP

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

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.