/*
 * Copyright 
 *   2008 axYus - www.axyus.com
 *   2008 L.Meckert - laurent.meckert@axyus.com
 * 
 * This file is part of XEMELIOS.
 * 
 * XEMELIOS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * XEMELIOS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with XEMELIOS; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package fr.gouv.finances.cp.xemelios.plugin.signature;

import fr.gouv.finances.cp.xemelios.tools.AbstractTool;
import fr.gouv.finances.cp.xemelios.tools.MenuTitle;
import javax.swing.JFrame;

import org.apache.log4j.Logger;

/**
 * Cette classe sert a impleenter la verification de signature PES comme un plugin Xemelios
 * @author laurent.meckert
 */
@MenuTitle(value = "Vérification de Signatures PES")
public class GlobalSignaturePlugin extends AbstractTool {

    private JFrame parentWindow = null;
    static Logger logger = Logger.getLogger(GlobalSignaturePlugin.class);

    /** Creates a new instance of GlobalSignaturePlugin */
    public GlobalSignaturePlugin() {
        super();
    }

    /**
     * Donne le parent au plugin
     * @param parentWindow
     */
    public void setParentWindow(JFrame parentWindow) {
        this.parentWindow = parentWindow;
    }

    /**
     * cree un objet DlglSignatureFull et appelle sa methode run
     */
    public void run() {
        if ( ! isInXemelios()) {
            DlglSignatureFull dlg = new DlglSignatureFull(parentWindow, true);
            dlg.run();
        } else {
            DlgSignatureLight dlg = new DlgSignatureLight(parentWindow, true);
            dlg.run();
        }
    }

    /**
     * 
     * @param args ligne de commande
     */
    public static void main(String args[]) {
        // System.out.println("GlobalSignaturePlugin: main: call GlobalSignaturePlugin");
        GlobalSignaturePlugin gsp = new GlobalSignaturePlugin();
        // System.out.println("GlobalSignaturePlugin: main: call GlobalSignaturePlugin.run");
        gsp.run();
    }
}
