View Javadoc

1   /*
2    * @(#) RecentAction.java Nov 17, 2004
3    * 
4    * Copyright (c) 2004 Delft University of Technology Jaffalaan 5, 2628 BX Delft,
5    * the Netherlands. All rights reserved.
6    * 
7    * This software is proprietary information of Delft University of Technology
8    * The code is published under the Lesser General Public License
9    */
10  package nl.tudelft.simulation.dsol.gui.menu.actions;
11  
12  import javax.swing.JMenu;
13  import javax.swing.JMenuItem;
14  
15  import nl.tudelft.simulation.dsol.gui.DSOLApplicationInterface;
16  
17  /***
18   * The histogram specifies a histogram chart for the DSOL framework.
19   * <p>
20   * (c) copyright 2004 <a href="http://www.simulation.tudelft.nl/dsol/">Delft
21   * University of Technology </a>, the Netherlands. <br>
22   * See for project information <a href="http://www.simulation.tudelft.nl/dsol/">
23   * www.simulation.tudelft.nl/dsol </a> <br>
24   * License of use: <a href="http://www.gnu.org/copyleft/lesser.html">Lesser
25   * General Public License (LGPL) </a>, no warranty.
26   * 
27   * @author <a href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm"> Peter
28   *         Jacobs </a>
29   * @version $Revision$ $Date$
30   * @since 1.2
31   */
32  public class RecentAction extends JMenu
33  {
34  	/***
35  	 * constructs a new RecentAction
36  	 * 
37  	 * @param application the application
38  	 */
39  	public RecentAction(final DSOLApplicationInterface application)
40  	{
41  		super("Open Recent");
42  		for (int i = 0; i < 3; i++)
43  		{
44  			String label = application.getProperties().getProperty(
45  					"recent[" + i + "]");
46  			if (label != null && label.length() > 0)
47  			{
48  				JMenuItem recentItem = new JMenuItem(new OpenRecentAction(
49  						application, label.split("!#!")[0]));
50  				this.add(recentItem);
51  			}
52  		}
53  	}
54  }