public class

PdfViewCtrlTabsManager

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.utils.PdfViewCtrlTabsManager

Class Overview

Manager class for PDFView control tabs

Summary

Constants
int MAX_NUM_TABS_PHONE The maximum number of tabs allowed to be opened at the same time in phone devices
int MAX_NUM_TABS_TABLET The maximum number of tabs allowed to be opened at the same time in tablet devices
Public Methods
synchronized void addDocument(Context context, String filepath)
Adds a file path to the list of opened documents.
synchronized void addPdfViewCtrlTabInfo(Context context, String filepath, PdfViewCtrlTabInfo info)
Adds the PDFView control tab linked to the specified file path
void cleanup()
Cleans up resources.
synchronized void clearAllPdfViewCtrlTabInfo(Context context)
Removes all PDFView control tabs from the repository.
synchronized ArrayList<String> getDocuments(Context context)
Returns the path of all opened documents.
static PdfViewCtrlTabsManager getInstance()
String getLatestViewedTabTag(Context context)
Returns the file path of the PDFView control tab that was viewed most recently.
String getNewPath(String filepath)
Returns the most updated file path.
synchronized PdfViewCtrlTabInfo getPdfFViewCtrlTabInfo(Context context, String filepath)
Returns the PDFView control tab for the specified file path
synchronized void removeDocument(Context context, String filepath)
Removes a file path from the list of opened documents.
String removeOldestViewedTab(Context context)
Removes the PDFView control tab that was viewed least recently.
synchronized void removePdfViewCtrlTabInfo(Context context, String filepath)
Removes the PDFView control tab linked to the specified file path.
synchronized void updateDocumentOrder(Context context, List<String> fileTabs)
Updates the tab document ordering based on the given list of file tabs.
void updateLastViewedTabTimestamp(Context context, String filepath)
Updates when the PDFView control tab (linked to the specified file path) was viewed last time.
synchronized void updatePdfViewCtrlTabInfo(Context context, String oldFilepath, String newFilepath, String newFilename)
Updates a PDFView control tab.
void updateViewModeForTab(Context context, String filepath, PDFViewCtrl.PagePresentationMode mode)
Updates the view mode of the PDFView control tab linked to the specified file path.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int MAX_NUM_TABS_PHONE

The maximum number of tabs allowed to be opened at the same time in phone devices

Constant Value: 3 (0x00000003)

public static final int MAX_NUM_TABS_TABLET

The maximum number of tabs allowed to be opened at the same time in tablet devices

Constant Value: 5 (0x00000005)

Public Methods

public synchronized void addDocument (Context context, String filepath)

Adds a file path to the list of opened documents.

Parameters
context The context
filepath The file path

public synchronized void addPdfViewCtrlTabInfo (Context context, String filepath, PdfViewCtrlTabInfo info)

Adds the PDFView control tab linked to the specified file path

Parameters
context The context
filepath The file path
info The PdfViewCtrlTabInfo

public void cleanup ()

Cleans up resources.

public synchronized void clearAllPdfViewCtrlTabInfo (Context context)

Removes all PDFView control tabs from the repository.

Parameters
context The context

public synchronized ArrayList<String> getDocuments (Context context)

Returns the path of all opened documents.

Parameters
context The context
Returns
  • A list of opened documents

public static PdfViewCtrlTabsManager getInstance ()

public String getLatestViewedTabTag (Context context)

Returns the file path of the PDFView control tab that was viewed most recently.

Parameters
context The context

public String getNewPath (String filepath)

Returns the most updated file path. The file path of a PDFView control tab can be changed through updatePdfViewCtrlTabInfo(Context, String, String, String).

Parameters
filepath The file path
Returns
  • The new file path

public synchronized PdfViewCtrlTabInfo getPdfFViewCtrlTabInfo (Context context, String filepath)

Returns the PDFView control tab for the specified file path

Parameters
context The context
filepath The file path
Returns

public synchronized void removeDocument (Context context, String filepath)

Removes a file path from the list of opened documents.

Parameters
context The context
filepath The file path

public String removeOldestViewedTab (Context context)

Removes the PDFView control tab that was viewed least recently.

Parameters
context The context

public synchronized void removePdfViewCtrlTabInfo (Context context, String filepath)

Removes the PDFView control tab linked to the specified file path.

Parameters
context The context
filepath The file path

public synchronized void updateDocumentOrder (Context context, List<String> fileTabs)

Updates the tab document ordering based on the given list of file tabs.

public void updateLastViewedTabTimestamp (Context context, String filepath)

Updates when the PDFView control tab (linked to the specified file path) was viewed last time.

Parameters
context The context
filepath The file path

public synchronized void updatePdfViewCtrlTabInfo (Context context, String oldFilepath, String newFilepath, String newFilename)

Updates a PDFView control tab.

Parameters
context The context
oldFilepath The file path linked to the desired PdfViewCtrlTabInfo
newFilepath The new file path that should be linked to the PdfViewCtrlTabInfo
newFilename The new file name for the PdfViewCtrlTabInfo

public void updateViewModeForTab (Context context, String filepath, PDFViewCtrl.PagePresentationMode mode)

Updates the view mode of the PDFView control tab linked to the specified file path.

Parameters
context The context
filepath The file path
mode The page presentation mode.