/*
 * HelloWorld.java
 *
 * Created on 21 maggio 2004, 7.36
 */

package it.businesslogic.ireport.plugin.checkupdate;

import javax.swing.SwingUtilities;

/**
 *
 * @author  Administrator
 */
public class CheckUpdate extends it.businesslogic.ireport.plugin.IReportPlugin {
    
    boolean firstTime = true;
    
    
    
    /** Creates a new instance of HelloWorld */
    public CheckUpdate() {
        
    }
    
    public void call() {
        
        if (!firstTime || it.businesslogic.ireport.gui.MainFrame.getMainInstance().getProperties().getProperty("updateOnStartup", "true").equals("true"))
        {
            SwingUtilities.invokeLater( new Runnable()
            {
            
                public void run()
                {
                    try {
                            UpgradeSearch us = new UpgradeSearch();
                            Thread t = new Thread(us);
                            t.run();
                        } catch (Throwable ex) {
                            ex.printStackTrace();	
                        }
                }
            });
       }
       firstTime = false;
       
    }
    
    public void configure() {
        CheckUpdateDialog cup = new CheckUpdateDialog(getMainFrame(), true);
        cup.setVisible(true);
        
    }
    
}
