org.faceless.pdf2.viewer2.feature

## Class PageNumber

- java.lang.Object
- - org.faceless.pdf2.viewer2.ViewerFeature
  - - org.faceless.pdf2.viewer2.ViewerWidget
    - - org.faceless.pdf2.viewer2.feature.NavigationWidget
      - - org.faceless.pdf2.viewer2.feature.PageNumber

- All Implemented Interfaces:
    PropertyChangeListener, EventListener, DocumentPanelListener

      public class PageNumber
      extends NavigationWidget

  Create a widget that displays the current page number, and allows the user to enter a new pagenumber for display.
  The following initialization parameters can be specified to configure this feature.

  usePageLabels | If true (the default), display the `page label` for the selected page if specified. If false, display the physical page number (the default behaviour prior to 2.11.19).
  alignment | Can be set to "right", "center" or "left" (the default) to position the page number in the box

  The name of this feature is PageNumber

  This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.

  Since:
    2.8

- - ### Field Summary

    - ### Fields inherited from class org.faceless.pdf2.viewer2.feature.NavigationWidget

      `docpanel, pdf`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PageNumber()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `documentUpdated(DocumentPanelEvent event)` Called when an `DocumentPanelEvent` is raised
    `void` | `initialize(PDFViewer viewer)` Called when the feature is first added to a viewer
    `protected void` | `pageChanged()`
    `void` | `propertyChange(PropertyChangeEvent event)`
    `void` | `setUsePageLabels(boolean uselabels)` Set whether to display the "page labels" if defined on this PDF, or whether to always display the physical page number.

    - ### Methods inherited from class org.faceless.pdf2.viewer2.ViewerWidget

      `action, createActionListener, getComponent, getIcon, getViewer, isButtonEnabledByDefault, isDocumentRequired, isMenuEnabledByDefault, setButton, setComponent, setDocumentRequired, setMenu, setMenu, setToolBarEnabled, setToolBarEnabledAlways, setToolBarFloatable, setToolBarFloating, toString`

    - ### Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature

      `getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PageNumber

          public PageNumber()

  - ### Method Detail

    - #### initialize

          public void initialize(PDFViewer viewer)

      Description copied from class: `ViewerFeature`
      Called when the feature is first added to a viewer
      Overrides:
        `initialize` in class `NavigationWidget`

    - #### setUsePageLabels

          public void setUsePageLabels(boolean uselabels)

      Set whether to display the "page labels" if defined on this PDF, or whether to always display the physical page number.
      Parameters:
        `uselabels` - if true, use the page labels if defined, otherwise use the physical page number
      Since:
        2.11.19
      See Also:
        `PDF.getPageLabel(int)`, `ThumbnailPanel.setUsePageLabels(boolean)`

    - #### documentUpdated

          public void documentUpdated(DocumentPanelEvent event)

      Description copied from interface: `DocumentPanelListener`
      Called when an `DocumentPanelEvent` is raised
      Specified by:
        `documentUpdated` in interface `DocumentPanelListener`
      Overrides:
        `documentUpdated` in class `NavigationWidget`

    - #### propertyChange

          public void propertyChange(PropertyChangeEvent event)

      Specified by:
        `propertyChange` in interface `PropertyChangeListener`
      Overrides:
        `propertyChange` in class `NavigationWidget`

    - #### pageChanged

          protected void pageChanged()

      Specified by:
        `pageChanged` in class `NavigationWidget`

Copyright © 2001-2015 Big Faceless Organization