Package clips.delegate.expenditure

Examples of clips.delegate.expenditure.ExpenditureItemData


                DirectoryDialogDefault dialogDefault = new DirectoryDialogDefault(true, null, "\\", det);
                dialogDefault.setVisible(true);
                if (dialogDefault.getDlgResult() == ModalDialog.DLG_OK){
                    Selector s = dialogDefault.getSelectedItems();
                    for (int i = 0; i < s.size(); i++) {
                        ExpenditureItemData eil;
                        if (serRenLocal != null) {
                            eil = new ExpenditureItemData(serRenLocal);
                        } else {
                            eil = new ExpenditureItemData(service);
                        }
                        DirectoryExpenditureTypeItem type = (DirectoryExpenditureTypeItem) s.get(i);
                        eil.setType(type);
                        items.append(eil);
                        resetTable();
                    }
                }
View Full Code Here


        if (list.size() != 0){
            throw new RuntimeException("Заменить реальный расход на новый можно только если он пустой");
        }
        if(defaultList != null) {
            for (int i = 0; i < defaultList.size(); i++) {
                ExpenditureItemData item = defaultList.get(i);
                ExpenditureItemData newItem = new ExpenditureItemData(service);

                newItem.setQuantity(item.getQuantity());
                newItem.setType(item.getType());
                list.append(newItem);
            }
        }
       
        return list;
View Full Code Here

        }

        @Override
        protected void loadDB() throws Exception {
            for (ExpenditureDetails d : getBean().getExpenditureList()) {
                initByDetails(new ExpenditureItemData(d));
            }
        }
View Full Code Here

    /**
     * Восстанавливает последнее изменение объёма
     */
    public void recoverChangedValue() {
        ExpenditureItemData eil  = null;       
        if (lastChanged != null
                && lastChanged.row < items.size()
                && lastChanged.row >= 0){
            eil = items.get(lastChanged.row);
        }
        if (eil != null && lastChanged.value != null){
            eil.setQuantity((Float) lastChanged.value);
        }
    }
View Full Code Here

    @Override
    public Object getValueAt(int row, int col) {//загрузка
        String s = null;
        try {
            ExpenditureItemData item = items.get(row);
            if (col == COL_EXPEN_TYPE) {
                s = item.getType().toString();
               
            } else if (col == COL_QUANTITY) {
                String volume = String.format("%.2f", (item.getQuantity()));
                System.out.println(volume);
                while (volume.charAt(volume.length() - 1) == '0') {
                    volume = volume.substring(0, volume.length() - 1);
                }
                char ch = volume.charAt(volume.length() - 1);
                if (ch == ',' || ch == '.') {
                    volume = volume.substring(0, volume.length() - 1);
                }
                return volume;
               
            } else if (col == COL_METRIC) {
                return item.getMetric();
               
            } else {
                assert false;
            }
        } catch (ClipsException ex) {
View Full Code Here

    }

    @Override
    public void setValueAt(Object value, int row, int col) {
        try {
            ExpenditureItemData eil = items.get(row);
            if (col == COL_QUANTITY) {
                //сохраняем старое значение величины
                lastChanged.value = eil.getQuantity();
                lastChanged.row = row;
                lastChanged.col = col;
               
                Number v = NumberFormat.getInstance().parse(value.toString());
                eil.setQuantity(v.floatValue());
                fireTableDataChanged();
            }
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
View Full Code Here

TOP

Related Classes of clips.delegate.expenditure.ExpenditureItemData

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.