Class AbstractDemoFrame

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.pentaho.reporting.engine.classic.demo.util.AbstractDemoFrame
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, DemoController
Direct Known Subclasses:
CompoundDemoFrame, InternalFrameDemoFrame, SimpleDemoFrame

public abstract class AbstractDemoFrame extends JFrame implements DemoController
The AbstractDemoFrame provides some basic functionality shared among all demos. It provides default handlers for preview and the window-closing event as well as helper function to display error messages.
Author:
Thomas Morgner
See Also:
  • Field Details

  • Constructor Details

    • AbstractDemoFrame

      public AbstractDemoFrame()
      Constructs a new frame that is initially invisible.

      This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale.

  • Method Details

    • isIgnoreEmbeddedConfig

      public boolean isIgnoreEmbeddedConfig()
    • setIgnoreEmbeddedConfig

      public void setIgnoreEmbeddedConfig(boolean ignoreEmbeddedConfig)
    • getResources

      public org.pentaho.reporting.libraries.base.util.ResourceBundleSupport getResources()
      Returns the resource bundle for this demo frame.
      Returns:
      the resource bundle for the localization.
    • getCloseAction

      public Action getCloseAction()
      Returns the close action implementation to handle the closing of the frame.
      Returns:
      the close action.
    • getPreviewAction

      public Action getPreviewAction()
      Returns the preview action implementation to handle the preview action event.
      Returns:
      the preview action.
    • getAboutAction

      public org.pentaho.reporting.engine.classic.demo.util.AbstractDemoFrame.AboutAction getAboutAction()
    • attemptExit

      protected boolean attemptExit()
      Exits the application, but only if the user agrees.
      Returns:
      false if the user decides not to exit the application.
    • attemptPreview

      protected abstract void attemptPreview()
      Handler method called by the preview action. This method should perform all operations to preview the report.
    • createJMenu

      protected JMenu createJMenu(String base)
      Creates a JMenu which gets initialized from the current resource bundle.
      Parameters:
      base - the resource prefix.
      Returns:
      the menu.
    • showExceptionDialog

      public static void showExceptionDialog(Component parent, String localisationBase, Exception e)
      Shows the exception dialog by using localized messages. The message base is used to construct the localisation key by appending ".title" and ".message" to the base name.
      Parameters:
      localisationBase - the resource prefix.
      e - the exception.
    • createDefaultTable

      protected JComponent createDefaultTable(TableModel data)
    • displayAbout

      public void displayAbout()
      Displays information about the application.
    • createMenuBar

      protected JMenuBar createMenuBar()
      Creates a menu bar.
      Returns:
      the menu bar.
    • getExportAction

      public Action getExportAction()
      Specified by:
      getExportAction in interface DemoController
    • getStatusBar

      public org.pentaho.reporting.engine.classic.core.modules.gui.commonswing.JStatusBar getStatusBar()
      Specified by:
      getStatusBar in interface DemoController