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

package it.businesslogic.ireport.plugin.checkupdate;

/**
 *
 * @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"))
         {
             
        
            try {
                javax.swing.SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        UpgradeSearch us = new UpgradeSearch();
                        Thread t = new Thread(us);
                        t.run();
                    }
                } );
            } catch (Exception ex) {}
         }
         firstTime = false;
    }
    
    public void configure() {
        CheckUpdateDialog cup = new CheckUpdateDialog(getMainFrame(), true);
        cup.setVisible(true);
        
    }
    
}
