Package org.pentaho.reporting.libraries.designtime.swing

Examples of org.pentaho.reporting.libraries.designtime.swing.FormattingTableCellRenderer


    setDefaultRenderer(Object.class, new GenericCellRenderer());
    setDefaultRenderer(String.class, new GenericCellRenderer());

    final SimpleDateFormat isoDateFormat =
        new SimpleDateFormat(DATETIME_FORMAT_DEFAULT, Locale.ENGLISH);
    setDefaultRenderer(Date.class, new FormattingTableCellRenderer(isoDateFormat));
    setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer
        (new SimpleDateFormat(DATE_FORMAT_DEFAULT, Locale.ENGLISH)));
    setDefaultRenderer(Time.class, new FormattingTableCellRenderer
        (new SimpleDateFormat(TIME_FORMAT_DEFAULT, Locale.ENGLISH)));
    setDefaultRenderer(Timestamp.class, new FormattingTableCellRenderer(isoDateFormat));
  }
View Full Code Here


  {
    final SimpleDateFormat isoDateFormat = createSafely(localeSettings.getDatetimeFormatPattern(),
        DATETIME_FORMAT_DEFAULT, localeSettings.getLocale());
    final TimeZone timeZone = localeSettings.getTimeZone();
    isoDateFormat.setTimeZone(timeZone);
    setDefaultRenderer(Date.class, new FormattingTableCellRenderer(isoDateFormat));
    setDefaultRenderer(Timestamp.class, new FormattingTableCellRenderer(isoDateFormat));

    final DateCellEditor dateCellEditor = new DateCellEditor(Date.class);
    dateCellEditor.setDateFormat(isoDateFormat);
    setDefaultEditor(Date.class, dateCellEditor);

    final DateCellEditor timestampEditor = new DateCellEditor(Timestamp.class);
    timestampEditor.setDateFormat(isoDateFormat);
    setDefaultEditor(Timestamp.class, timestampEditor);

    final SimpleDateFormat dateFormat = createSafely(localeSettings.getDateFormatPattern(),
        DATE_FORMAT_DEFAULT, localeSettings.getLocale());
    dateFormat.setTimeZone(timeZone);
    setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer(dateFormat));

    final DateCellEditor sqlDateCellEditor = new DateCellEditor(java.sql.Date.class);
    sqlDateCellEditor.setDateFormat(dateFormat);
    setDefaultEditor(java.sql.Date.class, sqlDateCellEditor);

    final SimpleDateFormat timeFormat = createSafely(localeSettings.getTimeFormatPattern(),
        TIME_FORMAT_DEFAULT, localeSettings.getLocale());
    timeFormat.setTimeZone(timeZone);
    setDefaultRenderer(Time.class, new FormattingTableCellRenderer(timeFormat));

    final TimeCellEditor timeCellEditor = new TimeCellEditor(Time.class);
    timeCellEditor.setDateFormat(timeFormat);
    setDefaultEditor(Time.class, timeCellEditor);
  }
View Full Code Here

    setDefaultRenderer(String.class, new GenericCellRenderer());
    setDefaultRenderer(ReportPreProcessor.class, reportPreProcessorCellRenderer);

    final SimpleDateFormat isoDateFormat =
        new SimpleDateFormat(WorkspaceSettings.DATETIME_FORMAT_DEFAULT, Locale.ENGLISH);
    setDefaultRenderer(Date.class, new FormattingTableCellRenderer(isoDateFormat));
    setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer
        (new SimpleDateFormat(WorkspaceSettings.DATE_FORMAT_DEFAULT, Locale.ENGLISH)));
    setDefaultRenderer(Time.class, new FormattingTableCellRenderer
        (new SimpleDateFormat(WorkspaceSettings.TIME_FORMAT_DEFAULT, Locale.ENGLISH)));
    setDefaultRenderer(Timestamp.class, new FormattingTableCellRenderer(isoDateFormat));

    WorkspaceSettings.getInstance().addSettingsListener(new LocaleSettingsListener());
    applyLocaleSettings(WorkspaceSettings.getInstance());
  }
View Full Code Here

  {
    final SimpleDateFormat isoDateFormat = createSafely(localeSettings.getDatetimeFormatPattern(),
        WorkspaceSettings.DATETIME_FORMAT_DEFAULT, localeSettings.getLocale());
    final TimeZone timeZone = localeSettings.getTimeZone();
    isoDateFormat.setTimeZone(timeZone);
    setDefaultRenderer(Date.class, new FormattingTableCellRenderer(isoDateFormat));
    setDefaultRenderer(Timestamp.class, new FormattingTableCellRenderer(isoDateFormat));

    final DateCellEditor dateCellEditor = new DateCellEditor(Date.class);
    dateCellEditor.setDateFormat(isoDateFormat);
    setDefaultEditor(Date.class, dateCellEditor);

    final DateCellEditor timestampEditor = new DateCellEditor(Timestamp.class);
    timestampEditor.setDateFormat(isoDateFormat);
    setDefaultEditor(Timestamp.class, timestampEditor);

    final SimpleDateFormat dateFormat = createSafely(localeSettings.getDateFormatPattern(),
        WorkspaceSettings.DATE_FORMAT_DEFAULT, localeSettings.getLocale());
    dateFormat.setTimeZone(timeZone);
    setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer(dateFormat));

    final DateCellEditor sqlDateCellEditor = new DateCellEditor(java.sql.Date.class);
    sqlDateCellEditor.setDateFormat(dateFormat);
    setDefaultEditor(java.sql.Date.class, sqlDateCellEditor);

    final SimpleDateFormat timeFormat = createSafely(localeSettings.getTimeFormatPattern(),
        WorkspaceSettings.TIME_FORMAT_DEFAULT, localeSettings.getLocale());
    timeFormat.setTimeZone(timeZone);
    setDefaultRenderer(Time.class, new FormattingTableCellRenderer(timeFormat));

    final TimeCellEditor timeCellEditor = new TimeCellEditor(Time.class);
    timeCellEditor.setDateFormat(timeFormat);
    setDefaultEditor(Time.class, timeCellEditor);
  }
View Full Code Here

    setTableHeader(tableHeader);
    setModel(tableModel);
    setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

    final SimpleDateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
    setDefaultRenderer(Date.class, new FormattingTableCellRenderer(isoDateFormat));
    setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer(new SimpleDateFormat("yyyy-MM-dd")));
    setDefaultRenderer(Time.class, new FormattingTableCellRenderer(new SimpleDateFormat("HH:mm:ss.SSS")));
    setDefaultRenderer(Timestamp.class, new FormattingTableCellRenderer(isoDateFormat));
    setDefaultRenderer(String.class, new GenericCellRenderer());
    setDefaultRenderer(Object.class, new GenericCellRenderer());

    setDefaultEditor(Number.class, new GenericCellEditor(BigDecimal.class));
    setDefaultEditor(Integer.class, new GenericCellEditor(Integer.class));
View Full Code Here

    try
    {
      final SimpleDateFormat isoDateFormat =
          new SimpleDateFormat(localeSettings.getDatetimeFormatPattern(), localeSettings.getLocale());
      isoDateFormat.setTimeZone(localeSettings.getTimeZone());
      setDefaultRenderer(Date.class, new FormattingTableCellRenderer(isoDateFormat));
      setDefaultRenderer(Timestamp.class, new FormattingTableCellRenderer(isoDateFormat));

      final DateCellEditor dateCellEditor = new DateCellEditor(Date.class);
      dateCellEditor.setDateFormat(isoDateFormat);
      setDefaultEditor(Date.class, dateCellEditor);

      final DateCellEditor timestampEditor = new DateCellEditor(Timestamp.class);
      timestampEditor.setDateFormat(isoDateFormat);
      setDefaultEditor(Timestamp.class, timestampEditor);

    }
    catch (Exception e)
    {
      logger.warn("Invalid format string found in locale settings", e);
    }
    try
    {
      final SimpleDateFormat dateFormat =
          new SimpleDateFormat(localeSettings.getDateFormatPattern(), localeSettings.getLocale());
      dateFormat.setTimeZone(localeSettings.getTimeZone());
      setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer(dateFormat));

      final DateCellEditor dateCellEditor = new DateCellEditor(java.sql.Date.class);
      dateCellEditor.setDateFormat(dateFormat);
      setDefaultEditor(java.sql.Date.class, dateCellEditor);
    }
    catch (Exception e)
    {
      logger.warn("Invalid format string found in locale settings", e);
    }
    try
    {
      final SimpleDateFormat timeFormat =
          new SimpleDateFormat(localeSettings.getTimeFormatPattern(), localeSettings.getLocale());
      timeFormat.setTimeZone(localeSettings.getTimeZone());
      setDefaultRenderer(Time.class, new FormattingTableCellRenderer(timeFormat));

      final TimeCellEditor timeCellEditor = new TimeCellEditor(Time.class);
      timeCellEditor.setDateFormat(timeFormat);
      setDefaultEditor(Time.class, timeCellEditor);
    }
View Full Code Here

    final TableColumnModel columnModel = getColumnModel();
    tableHeader = new EditableHeader(columnModel, tableModel);
    setTableHeader(tableHeader);

    final SimpleDateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
    setDefaultRenderer(Date.class, new FormattingTableCellRenderer(isoDateFormat));
    setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer(new SimpleDateFormat("yyyy-MM-dd")));
    setDefaultRenderer(Time.class, new FormattingTableCellRenderer(new SimpleDateFormat("HH:mm:ss.SSS")));
    setDefaultRenderer(Timestamp.class, new FormattingTableCellRenderer(isoDateFormat));
    setDefaultRenderer(String.class, new GenericCellRenderer());
    setDefaultRenderer(Object.class, new GenericCellRenderer());

    setDefaultEditor(Number.class, new GenericCellEditor(BigDecimal.class));
    setDefaultEditor(Integer.class, new GenericCellEditor(Integer.class));
View Full Code Here

    try
    {
      final SimpleDateFormat isoDateFormat =
          new SimpleDateFormat(localeSettings.getDatetimeFormatPattern(),localeSettings.getLocale());
      isoDateFormat.setTimeZone(localeSettings.getTimeZone());
      setDefaultRenderer(Date.class, new FormattingTableCellRenderer(isoDateFormat));
      setDefaultRenderer(Timestamp.class, new FormattingTableCellRenderer(isoDateFormat));

      final DateCellEditor dateCellEditor = new DateCellEditor(Date.class);
      dateCellEditor.setDateFormat(isoDateFormat);
      setDefaultEditor(Date.class, dateCellEditor);

      final DateCellEditor timestampEditor = new DateCellEditor(Timestamp.class);
      timestampEditor.setDateFormat(isoDateFormat);
      setDefaultEditor(Timestamp.class, timestampEditor);

    }
    catch (Exception e)
    {
      logger.warn("Invalid format string found in locale settings", e);
    }
    try
    {
      final SimpleDateFormat dateFormat =
          new SimpleDateFormat(localeSettings.getDateFormatPattern(),localeSettings.getLocale());
      dateFormat.setTimeZone(localeSettings.getTimeZone());
      setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer(dateFormat));

      final DateCellEditor dateCellEditor = new DateCellEditor(java.sql.Date.class);
      dateCellEditor.setDateFormat(dateFormat);
      setDefaultEditor(java.sql.Date.class, dateCellEditor);
    }
    catch (Exception e)
    {
      logger.warn("Invalid format string found in locale settings", e);
    }
    try
    {
      final SimpleDateFormat timeFormat =
          new SimpleDateFormat(localeSettings.getTimeFormatPattern(),localeSettings.getLocale());
      timeFormat.setTimeZone(localeSettings.getTimeZone());
      setDefaultRenderer(Time.class, new FormattingTableCellRenderer(timeFormat));
     
      final TimeCellEditor timeCellEditor = new TimeCellEditor(Time.class);
      timeCellEditor.setDateFormat(timeFormat);
      setDefaultEditor(Time.class, timeCellEditor);
    }
View Full Code Here

    setDefaultRenderer(String.class, new GenericCellRenderer());
    setDefaultRenderer(ReportPreProcessor.class, reportPreProcessorCellRenderer);

    final SimpleDateFormat isoDateFormat =
        new SimpleDateFormat(WorkspaceSettings.DATETIME_FORMAT_DEFAULT, Locale.ENGLISH);
    setDefaultRenderer(Date.class, new FormattingTableCellRenderer(isoDateFormat));
    setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer
        (new SimpleDateFormat(WorkspaceSettings.DATE_FORMAT_DEFAULT, Locale.ENGLISH)));
    setDefaultRenderer(Time.class, new FormattingTableCellRenderer
        (new SimpleDateFormat(WorkspaceSettings.TIME_FORMAT_DEFAULT, Locale.ENGLISH)));
    setDefaultRenderer(Timestamp.class, new FormattingTableCellRenderer(isoDateFormat));

    WorkspaceSettings.getInstance().addSettingsListener(new LocaleSettingsListener());
    applyLocaleSettings(WorkspaceSettings.getInstance());
  }
View Full Code Here

  public void applyLocaleSettings(final LocaleSettings localeSettings)
  {
    final SimpleDateFormat isoDateFormat = createSafely(localeSettings.getDatetimeFormatPattern(),
        WorkspaceSettings.DATETIME_FORMAT_DEFAULT, localeSettings.getLocale());
    isoDateFormat.setTimeZone(localeSettings.getTimeZone());
    setDefaultRenderer(Date.class, new FormattingTableCellRenderer(isoDateFormat));
    setDefaultRenderer(Timestamp.class, new FormattingTableCellRenderer(isoDateFormat));

    final DateCellEditor dateCellEditor = new DateCellEditor(Date.class);
    dateCellEditor.setDateFormat(isoDateFormat);
    setDefaultEditor(Date.class, dateCellEditor);

    final DateCellEditor timestampEditor = new DateCellEditor(Timestamp.class);
    timestampEditor.setDateFormat(isoDateFormat);
    setDefaultEditor(Timestamp.class, timestampEditor);

    final SimpleDateFormat dateFormat = createSafely(localeSettings.getDateFormatPattern(),
        WorkspaceSettings.DATE_FORMAT_DEFAULT, localeSettings.getLocale());
    dateFormat.setTimeZone(localeSettings.getTimeZone());
    setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer(dateFormat));

    final DateCellEditor sqlDateCellEditor = new DateCellEditor(java.sql.Date.class);
    sqlDateCellEditor.setDateFormat(dateFormat);
    setDefaultEditor(java.sql.Date.class, sqlDateCellEditor);

    final SimpleDateFormat timeFormat = createSafely(localeSettings.getTimeFormatPattern(),
        WorkspaceSettings.TIME_FORMAT_DEFAULT, localeSettings.getLocale());
    timeFormat.setTimeZone(localeSettings.getTimeZone());
    setDefaultRenderer(Time.class, new FormattingTableCellRenderer(timeFormat));

    final TimeCellEditor timeCellEditor = new TimeCellEditor(Time.class);
    timeCellEditor.setDateFormat(timeFormat);
    setDefaultEditor(Time.class, timeCellEditor);
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.designtime.swing.FormattingTableCellRenderer

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.