Package clips.delegate.directory.complex

Examples of clips.delegate.directory.complex.DirectoryPacketTemplateListItem


    }

    @Override
    public void setValueAt(Object aValue, int rowIndex, int col) {
        try {
            DirectoryPacketTemplateListItem item = list.get(rowIndex);           
            if (col == COL_DISCOUNT) {
                item.setDiscount(Integer.parseInt(aValue.toString()));
            }
            if (col == COL_DURATION) {
                item.setDefaultDuration(Integer.parseInt(aValue.toString()));
            }
            if (col == COL_WEIGHT) {
                item.setWeight(Integer.parseInt(aValue.toString()));
            }           
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
        }
    }
View Full Code Here


        return COLCOUNT;
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        DirectoryPacketTemplateListItem item = list.get(rowIndex);
        switch (columnIndex) {
            case COL_SERVICE: {
                try {
                    return item.getService();
                } catch (ClipsException e) {
                    return new ErrorValue(e);
                }
            }              
            case COL_WEIGHT: return item.getWeight();
            case COL_DURATION: return item.getDefaultDuration();
            case COL_DISCOUNT: return item.getDiscount();
            default: return null;
        }
    }
View Full Code Here

    class PacketItemComparator implements Comparator {

        @Override
        public int compare(Object o1, Object o2) {
            DirectoryPacketTemplateListItem p1 = (DirectoryPacketTemplateListItem) o1;
            DirectoryPacketTemplateListItem p2 = (DirectoryPacketTemplateListItem) o2;
            if (p1.getWeight() < p2.getWeight()) {
                return 1;
            } else {
                return -1;
            }
        }
View Full Code Here

                    d.service = service.getID();
                    d.defaultDuration = 0;
                    d.discount = 0;
                    d.weight = 0;
                    d.packetTemplate = packet.getID();
                    DirectoryPacketTemplateListItem item = new DirectoryPacketTemplateListItem(d);
                    if (!dir.checkContracts(d)) {
                        if (MessageBox.showConfirmYesNo(MessageBox.C_CONTRACT_SETVICE_NOT_FOUNDED) == MessageBox.ANSWER_NO) {
                            return;
                        }
                    }
View Full Code Here

            items.add(packet.getPacketItem(sel[i]));
        }
        DirectoryPacketTemplateList dir =
                (DirectoryPacketTemplateList) DirectoryLocator.getDirectory(DirectoryPacketTemplateList.class, false);
        for (int i = 0; i < items.size(); i++) {
            DirectoryPacketTemplateListItem item = items.get(i);
            dir.getItems().remove(item);
        }
        setTable();
    } catch (ClipsException ex) {
        MessageBox.showException(ex);
View Full Code Here

    }

    @Override
    public void setValueAt(Object aValue, int rowIndex, int col) {
        try {
            DirectoryPacketTemplateListItem item = list.get(rowIndex);           
            if (col == COL_DISCOUNT) {
                item.setDiscount(Integer.parseInt(aValue.toString()));
            }
            if (col == COL_DURATION) {
                item.setDefaultDuration(Integer.parseInt(aValue.toString()));
            }
            if (col == COL_WEIGHT) {
                item.setWeight(Integer.parseInt(aValue.toString()));
            }           
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
        }
    }
View Full Code Here

        return COLCOUNT;
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        DirectoryPacketTemplateListItem item = list.get(rowIndex);
        switch (columnIndex) {
            case COL_ID : return item.getID();            
            case COL_SERVICE: {
                try {
                    return item.getService();
                } catch (ClipsException e) {
                    MessageBox.showException(e);
                    return new ErrorValue(e);
                }
            }              
            case COL_WEIGHT: return item.getWeight();
            case COL_DURATION: return item.getDefaultDuration();
            case COL_DISCOUNT: return item.getDiscount();
            default: return null;
        }
    }
View Full Code Here

        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

TOP

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

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.