All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jpedal.examples.viewer.commands.NavigateDocuments Maven / Gradle / Ivy

There is a newer version: 7.15.25
Show newest version
/*
 * ===========================================
 * Java Pdf Extraction Decoding Access Library
 * ===========================================
 *
 * Project Info:  http://www.idrsolutions.com
 * Help section for developers at http://www.idrsolutions.com/support/
 *
 * (C) Copyright 1997-2017 IDRsolutions and Contributors.
 *
 * This file is part of JPedal/JPDF2HTML5
 *
 @LICENSE@
 *
 * ---------------
 * NavigateDocuments.java
 * ---------------
 */
package org.jpedal.examples.viewer.commands;

import org.jpedal.examples.viewer.Values;
import org.jpedal.gui.GUIFactory;
import org.jpedal.utils.Messages;

/**
 * This class Opens up a previously opened document, you can open either a
 * previous document or the next document in the Viewer.
 */
public class NavigateDocuments {

    public static void executePrevDoc(final Object[] args, final GUIFactory currentGUI) {
        if (args == null) {
            if (org.jpedal.examples.viewer.utils.PrintStatus.isPrinting()) {
                currentGUI.showMessageDialog(Messages.getMessage("PdfViewerPrintWait.message"));
            } else if (Values.isProcessing()) {
                currentGUI.showMessageDialog(Messages.getMessage("PdfViewerDecodeWait.message"));
            } else {
                final String fileToOpen = currentGUI.getRecentDocument().getPreviousDocument();
                currentGUI.openFile(fileToOpen);
            }
        }
    }

    public static void executeNextDoc(final Object[] args, final GUIFactory currentGUI) {
        if (args == null) {

            if (org.jpedal.examples.viewer.utils.PrintStatus.isPrinting()) {
                currentGUI.showMessageDialog(Messages.getMessage("PdfViewerPrintWait.message"));
            } else if (Values.isProcessing()) {
                currentGUI.showMessageDialog(Messages.getMessage("PdfViewerDecodeWait.message"));
            } else {
                final String fileToOpen = currentGUI.getRecentDocument().getNextDocument();
                currentGUI.openFile(fileToOpen);
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy