Package reportgen.ren.report.column

Examples of reportgen.ren.report.column.ReportResultColumn


                    + "' не соответствуют результатам отчета");
            }

            for(int j=0; j<coreColumns.size(); j++) {
                QueryResultColumn coreCol = coreColumns.get(j);
                ReportResultColumn resultCol = results.get(j);
                Class coreCls = coreCol.getCls();
                Class resCls = resultCol.getCls();
                if(resCls == null) {
                    throw new ReportException("Результаты выборки '" + coreCol.getColTitle()
                        + "' не может быть равен null");
                } else if (coreCls != null && !coreCls.equals(resCls)) {
                    throw new ReportException("Результаты выборки '" + coreCol.getColTitle()
                        + "' не соответствует результату отчета по типу ("
                        + coreCol.getCls().getSimpleName() + " != "
                        + resultCol.getCls().getSimpleName() + ")");
                }
            }
        }
    }
View Full Code Here


       super(outer, root, context);
   }

    @Override
    protected ReportResultColumn loadChild(Element root, Context context) throws ReportException {
        return new ReportResultColumn(root, context);
    }
View Full Code Here

    @Override
    public Component getTableCellEditorComponent(JTable table, Object value,
            boolean isSelected, int row, int column) {
        ResultsTableModel model = (ResultsTableModel) table.getModel();
        ReportResultColumn field = model.getField(row);

        combo.setSelectedItem(new ColumnPriority(field.getOrderPriority()));
        return combo;
    }
View Full Code Here

    @Override
    public Component getTableCellEditorComponent(JTable table, Object value,
            boolean isSelected, int row, int column) {
        ResultsTableModel model = (ResultsTableModel) table.getModel();
        ReportResultColumn field = model.getField(row);

        combo.setSelectedItem(classToString(field.getColClass()));

        return super.getTableCellEditorComponent(table, value, isSelected, row, column);
    }
View Full Code Here

    @Override
    public Component getTableCellEditorComponent(JTable table, Object value,
            boolean isSelected, int row, int column) {
        ResultsTableModel model = (ResultsTableModel) table.getModel();
        ReportResultColumn field = model.getField(row);

        combo.removeAllItems();
        try {
            Object[] options = field.getContext().getAggregFunctions(field.getCls()).toArray();
            combo.setModel(new DefaultComboBoxModel(options));
            combo.setSelectedItem(field.getFunction());
        } catch (ReportException ex) {
            combo.addItem(AggregateFunction.ASIS);
            Message.warning(combo, ex.getLocalizedMessage(), "Выражение составлено некорректно");
        }
       
View Full Code Here

    @Override
    public Component getTableCellEditorComponent(JTable table, Object value,
            boolean isSelected, int row, int column) {
        ResultsTableModel model = (ResultsTableModel) table.getModel();
        ReportResultColumn field = model.getField(row);

        combo.removeAllItems();
        try {
            Iterator<AggregateFunction> options =
                    SimpleFormatColMode.getModeList(field.getCls()).iterator();
            while(options.hasNext()) {
                combo.addItem(options.next());
            }
            combo.setSelectedItem(field.getFunction());
        } catch (ReportException ex) {
            combo.addItem(AggregateFunction.ASIS);
            Message.warning(combo, ex.getLocalizedMessage(), "Выражение составлено некорректно");
        }
View Full Code Here

        );
    }// </editor-fold>//GEN-END:initComponents

    private void addResultColBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addResultColBtnActionPerformed
        try {
            ReportResultColumn exp = new ReportResultColumn(query.getUnionContext(new NoNeedAtom()));
            ResultColumnList cols = query.getColumns();
            cols.add(exp);

            resultColTable.setModel(new ResultsTableModel(cols));
View Full Code Here

            }
            ResultColumnList results = query.getColumns();
            for(int j=0; j<cols.size(); j++) {
                QueryResultColumn col = cols.get(j);
                if(results.size() <= j) {
                    ReportResultColumn result = new ReportResultColumn(query.getUnionContext(new NoNeedAtom()));
                    result.setColClass(col.getCls());
                    result.setTitle(col.getColTitle());
                    results.add(result);
                } else {
                    ReportResultColumn result = results.get(j);
                    Class colClass = col.getCls();
                    Class resClass = result.getCls();
                    if(colClass != null &&
                            (resClass == null || !colClass.equals(resClass))) {
                        int res = JOptionPane.showConfirmDialog(this, "Класс результата №" + j
                                + "отличается от результата выборки. Заменить?",
                                "Корректировка", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
                        if(res == JOptionPane.YES_OPTION) {
                            result.setColClass(colClass);
                        }
                    }
                }
            }
        } catch (ReportException ex) {
View Full Code Here

        return true;
    }
   
    @Override
    public Object getValueAt(int row, int col) {
        ReportResultColumn ren = results.get(row);
        switch(col) {
            case COL_OPERATOR: {
                 return ren.getFunction();
            }
            case COL_VIEWMODE: {
                return ren.getViewFunction();
            }
            case COL_TITLE: {
                Object val = ren.getTitle();
                if(val != null) {
                    return val;
                }
                break;
            }
            case COL_ORDERPRIORITY: {
                return new ColumnPriority(ren.getOrderPriority());
            }
            case COL_CLASS: {
                return ResultTableClassEditor.classToString(ren.getColClass());
            }
        }
        return null;
    }
View Full Code Here

        return null;
    }

    @Override
    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
        ReportResultColumn ren = results.get(rowIndex);
        switch(columnIndex) {
            case COL_CLASS: {
                ren.setColClass(ResultTableClassEditor.stringToClass((String)aValue));
                break;
            }
            case COL_OPERATOR: {
                ren.setFunction((AggregateFunction) aValue);
                break;
            }
            case COL_VIEWMODE: {
                ren.setViewFunction((AggregateFunction) aValue);
                break;
            }
            case COL_TITLE: {
                String newTitle = aValue.toString().trim();
                for(int i=0; i<results.size(); ) {
                    if(i == rowIndex) {
                        i++;
                        continue;
                    }
                    if(newTitle.equals(results.get(i).getTitle())) {
                        newTitle += " (копия)";
                        i=0;
                    } else {
                        i++;
                    }
                }
                ren.setTitle(newTitle);
                break;
            }
            case COL_ORDERPRIORITY: {
                if(aValue instanceof ColumnPriority) {
                    ColumnPriority cp = (ColumnPriority) aValue;
                    ren.setOrderPriority(cp.getValue());
                }
                break;
            }
        }
    }
View Full Code Here

TOP

Related Classes of reportgen.ren.report.column.ReportResultColumn

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.