ICEpdf
  1. ICEpdf
  2. PDF-382

ViewerComponentExample Broken in Version 4.3

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.3
    • Fix Version/s: 4.3.1
    • Component/s: Core/Parsing, Viewer RI
    • Labels:
      None
    • Environment:
      jdk 1.6
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
          // workaround //
          ResourceBundle. res = ResourceBundle.getBundle( PropertiesManager.DEFAULT_MESSAGE_BUNDLE );
          PropertiesManager pm = new PropertiesManager( System.getProperties(), res );
          // build a component controller
          SwingController controller = new SwingController();
          SwingViewBuilder factory = new SwingViewBuilder(controller, pm);
          JPanel viewerComponentPanel = factory.buildViewerPanel();
      Show
          // workaround //     ResourceBundle. res = ResourceBundle.getBundle( PropertiesManager.DEFAULT_MESSAGE_BUNDLE );     PropertiesManager pm = new PropertiesManager( System.getProperties(), res );     // build a component controller     SwingController controller = new SwingController();     SwingViewBuilder factory = new SwingViewBuilder(controller, pm);     JPanel viewerComponentPanel = factory.buildViewerPanel();

      Description

      In main(String[]) the following example code is given:

          // build a component controller
          SwingController controller = new SwingController();
          SwingViewBuilder factory = new SwingViewBuilder(controller);
          JPanel viewerComponentPanel = factory.buildViewerPanel();

      However calling "factory.buildViewerPanel()" throws a NullPointerException:

          Exception in thread "main" java.lang.NullPointerException
              at org.icepdf.ri.common.ThumbnailsPanel.<init>(ThumbnailsPanel.java:60)
              at org.icepdf.ri.common.SwingViewBuilder.buildThumbsPanel(SwingViewBuilder.java:1565)
              at org.icepdf.ri.common.SwingViewBuilder.buildUtilityTabbedPane(SwingViewBuilder.java:1533)
              at org.icepdf.ri.common.SwingViewBuilder.buildUtilityAndDocumentSplitPane(SwingViewBuilder.java:1483)
              at org.icepdf.ri.common.SwingViewBuilder.buildContents(SwingViewBuilder.java:481)
              at org.icepdf.ri.common.SwingViewBuilder.buildViewerPanel(SwingViewBuilder.java:464)
              at ViewerComponentExample.main(ViewerComponentExample.java:41)

        Activity

        Nathan Ciliberto created issue -
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #27401 Thu Jan 26 06:28:33 MST 2012 patrick.corless PDF-382 addition of null pointer check for properties manager when trying to get the default thumbnail zoom. Default zoom is 0.1f if properties manager doesn't exist.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/common/ThumbnailsPanel.java
        Hide
        Patrick Corless added a comment -

        Thanks for posting the work around as reports are starting to come in via the forms.

        Show
        Patrick Corless added a comment - Thanks for posting the work around as reports are starting to come in via the forms.
        Patrick Corless made changes -
        Field Original Value New Value
        Salesforce Case []
        Fix Version/s 5.0 [ 10314 ]
        Hide
        Patrick Corless added a comment -

        Update the ThumbnailsPanel to default to a thumbnail zoom size of 0.1f when the propertiesManager has not been set which is the case for the component and applet usage scenarios.

        Show
        Patrick Corless added a comment - Update the ThumbnailsPanel to default to a thumbnail zoom size of 0.1f when the propertiesManager has not been set which is the case for the component and applet usage scenarios.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Patrick Corless made changes -
        Salesforce Case []
        Fix Version/s 4.3.1 [ 10316 ]
        Fix Version/s 5.0 [ 10314 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Nathan Ciliberto
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: