Package javax.swing.table

Examples of javax.swing.table.TableModel


    public void clear() {
        cache.clear();
        cancelEdit();
        loadedRows.clear();

        TableModel model = getModel();
        for (int row = 0; row < model.getRowCount(); row++) {
            clear(row);
        }
       
        setListeningForChanges(false);
        getDcModel().setRowCount(0);
View Full Code Here


                for (int field : settings.getIntArray(DcRepository.ModuleSettings.stTableColumnOrder))
                    fields.add(Integer.valueOf(field));
               
                DcObject dco = DataManager.getItem(getModuleForRow(row).getIndex(), ID, module.getMinimalFields(fields));
   
                TableModel model = getModel();
                int col;
                Object value;
                for (int field : dco.getFieldIndices()) {
                    col = getColumnIndexForField(field);
                    value = dco.getValue(field);
                    model.setValueAt(value, row, col);
                }
   
                if (module.isAbstract()) {
                    col = getColumnIndexForField(Media._SYS_MODULE);
                    value = dco.getModule();
                    model.setValueAt(value, row, col);
                }
   
                applyHeaders();
                setListeningForChanges(listenForChanges);
View Full Code Here

    return columnNames[column];
  }

  public static void main(String[] args)
  {
    TableModel m = new org.pentaho.reporting.engine.classic.core.modules.misc.tablemodel.GeneratorTableModel
      (new String[]{"id", "name", "firstname", "zip", "city",
          "birthdate", "street", "housenr", "statecode", "state"
      }, new Class[] {
        Integer.class, String.class, String.class, Integer.class, String.class,
        java.util.Date.class, String.class, Integer.class, String.class, String.class
View Full Code Here

    final ExpressionRuntime runtime = getRuntime();
    if (runtime == null)
    {
      return false;
    }
    final TableModel data = runtime.getData();
    if (data == null)
    {
      return false;
    }
    if (data.getRowCount() == 0)
    {
      return false;
    }
    return true;
  }
View Full Code Here

      final String[] tables = tableDataFactory.getQueryNames();
      for (int i = 0; i < tables.length; i++)
      {
        final String tableName = tables[i];
        final TableModel tableModel = tableDataFactory.queryData(tableName, null);

        xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "inline-table", "name", tableName, XmlWriterSupport.OPEN);
        xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "definition", XmlWriterSupport.OPEN);

        final Class[] colTypes = new Class[tableModel.getColumnCount()];
        for (int col = 0; col < tableModel.getColumnCount(); col += 1)
        {
          final AttributeList colAttrs = new AttributeList();
          colAttrs.setAttribute(InlineDataFactoryModule.NAMESPACE, "name", tableModel.getColumnName(col));

          final Class columnClass = tableModel.getColumnClass(col);
          if (columnClass == null)
          {
            colAttrs.setAttribute(InlineDataFactoryModule.NAMESPACE, "type", Object.class.getName());
            colTypes[col] = Object.class;
          }
          else
          {
            colAttrs.setAttribute(InlineDataFactoryModule.NAMESPACE, "type", columnClass.getName());
            colTypes[col] = columnClass;
          }

          xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "column", colAttrs, XmlWriterSupport.CLOSE);
        }
        xmlWriter.writeCloseTag(); // definition

        for (int row = 0; row < tableModel.getRowCount(); row += 1)
        {
          xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "row", XmlWriterSupport.OPEN);
          for (int col = 0; col < tableModel.getColumnCount(); col += 1)
          {
            final AttributeList colAttrs = new AttributeList();
            final Object value = tableModel.getValueAt(row, col);
            if (value == null)
            {
              colAttrs.setAttribute(InlineDataFactoryModule.NAMESPACE, "null", "true");
              xmlWriter.writeTag(InlineDataFactoryModule.NAMESPACE, "data", colAttrs, XmlWriterSupport.CLOSE);
            }
View Full Code Here

    }

    final DataRow parameterData = context.getParameterData();
    final ReportEnvironmentDataRow envDataRow = new ReportEnvironmentDataRow(context.getReportEnvironment());
    final DataFactory dataFactory = context.getDataFactory();
    final TableModel tableModel = dataFactory.queryData(getQueryName(),
        new CompoundDataRow(envDataRow, parameterData));

    final String formula = getParameterAttribute(ParameterAttributeNames.Core.NAMESPACE,
        ParameterAttributeNames.Core.DISPLAY_VALUE_FORMULA, context);
    if (StringUtils.isEmpty(formula, true))
View Full Code Here

      throws ParseException
  {
    final URL in = ObjectUtilities.getResource
        ("org/pentaho/reporting/engine/classic/demo/opensource/opensource.xml", StraightToEverything.class);
    final MasterReport report = parseReport(in);
    final TableModel data = new OpenSourceProjects();
    report.setDataFactory(new TableDataFactory
        ("default", data));
    try
    {
      createPDF(report, filename + ".pdf");
View Full Code Here

      throws ParseException
  {
    final URL in = ObjectUtilities.getResource
        ("org/pentaho/reporting/engine/classic/demo/opensource/opensource.xml", StraightToXML.class);
    final MasterReport report = parseReport(in);
    final TableModel data = new OpenSourceProjects();
    report.setDataFactory(new TableDataFactory
        ("default", data));
    saveXML(report, filename);
  }
View Full Code Here

      throws ParseException
  {
    final URL in = ObjectUtilities.getResource
        ("org/pentaho/reporting/engine/classic/demo/opensource/opensource.xml", StraightToPNG.class);
    final MasterReport report = parseReport(in);
    final TableModel data = new OpenSourceProjects();
    report.setDataFactory(new TableDataFactory
        ("default", data));
    final long startTime = System.currentTimeMillis();
    savePNG(report, filename);
  }
View Full Code Here

      throws ParseException
  {
    final URL in = ObjectUtilities.getResource
        ("org/pentaho/reporting/engine/classic/demo/opensource/opensource.xml", StraightToPDF.class);
    final MasterReport report = parseReport(in);
    final TableModel data = new OpenSourceProjects();
    report.setDataFactory(new TableDataFactory("default", data));
    final long startTime = System.currentTimeMillis();
    savePDF(report, filename);
  }
View Full Code Here

TOP

Related Classes of javax.swing.table.TableModel

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.