1
2
3
4
5
6
7
8
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 }