Class ToggleViewerWidget

    • Constructor Detail

      • ToggleViewerWidget

        protected ToggleViewerWidget​(String name,
                                     String groupname)
        Create a new ToggleViewerWidget
        Parameters:
        name - the name of the Widget
        groupname - the group this widget is part of, or null for no group
    • Method Detail

      • teardown

        public void teardown()
        Description copied from class: ViewerFeature
        Called when the PDFViewer containing this feature is closed
        Overrides:
        teardown in class ViewerFeature
      • getGroupName

        public final String getGroupName()
        Return the name of the group this widget is part of, or null if no group was specified
      • setGroupOwner

        public final void setGroupOwner​(JComponent comp)
        Set the "owner" for this Widget's group. This is typically the PDFViewer and set automatically - the only time this method needs to be called manually is when no PDFViewer is in use and these widgets are being applied directly to a DocumentPanel.
        Parameters:
        comp - the JComponent that owns the group this widget is part of
      • getGroupOwner

        public final JComponent getGroupOwner()
        Return the "owner" of this Widget's group.
      • setSelected

        public void setSelected​(boolean selected)
        Set whether this Widget is selected. If active is true, this method will automatically call setSelected(false) on all the other widgets in this group. Subclasses should override this method to do whatever they need to do when their active status is changed.
        Parameters:
        selected - whether this Widget is active or not
      • isSelected

        public boolean isSelected()
        Return whether this ViewerWidget is selected
      • getGroupSelection

        public ToggleViewerWidget getGroupSelection​(String groupname)
        Return the selected item in the specified group, or null if none of the items in that group are selected or no such group exists. To get the selected item in this item's group, pass in the value of getGroupName()
        Parameters:
        groupname - the name of the group