Package net.sf.jabref.external

Source Code of net.sf.jabref.external.UpgradeExternalLinks

package net.sf.jabref.external;

import javax.swing.JOptionPane;

import net.sf.jabref.*;
import net.sf.jabref.undo.NamedCompound;

/**
* Action for upgrading old-style (pre 2.3) PS/PDF links to the new "file" field.
*/
public class UpgradeExternalLinks extends BaseAction {

    private BasePanel panel;

    public UpgradeExternalLinks(BasePanel panel) {

        this.panel = panel;
    }

    public void action() throws Throwable {

        int answer = JOptionPane.showConfirmDialog(panel.frame(),
                Globals.lang("This will move all external links from the 'pdf' and 'ps' fields "
                    +"into the '%0' field. Proceed?", GUIGlobals.FILE_FIELD), Globals.lang("Upgrade external links"),
                JOptionPane.YES_NO_OPTION);
        if (answer !=  JOptionPane.YES_OPTION)
            return;
        NamedCompound ce = Util.upgradePdfPsToFile(panel.database(), new String[] {"pdf", "ps"});
        panel.undoManager.addEdit(ce);
        panel.markBaseChanged();
        panel.output(Globals.lang("Upgraded links."));
    }
}
TOP

Related Classes of net.sf.jabref.external.UpgradeExternalLinks

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.