01: /*
02: * PageBookMarks.java - BookMarks Manager for HelpGUI
03: * Copyright (C) 2003 Alexandre THOMAS
04: * alexthomas@free.fr
05: * http://helpgui.sourceforge.net
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License
09: * as published by the Free Software Foundation; either version 2
10: * of the License, or any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20: */
21:
22: package salomeTMF_plug.helpgui.page;
23:
24: import java.util.Hashtable;
25: import javax.swing.JMenuItem;
26:
27: /**
28: * BookMarks Manager
29: */
30: public class PageBookMarks {
31:
32: /** Instance of the class */
33: private static PageBookMarks bookmarks = null;
34:
35: /** HashTable for bookmaks manager */
36: private Hashtable table = null;
37:
38: public static PageBookMarks getInstance() {
39: if (bookmarks == null) {
40: bookmarks = new PageBookMarks();
41: }
42: return bookmarks;
43: }
44:
45: /** Constructor */
46: public PageBookMarks() {
47: table = new Hashtable();
48: }
49:
50: /** Insert a new bookmark */
51: public void addBookMark(JMenuItem menuItem, Page page) {
52: table.put(menuItem, page);
53: }
54:
55: /** Get a bookmarks */
56: public Page getBookMark(JMenuItem menuItem) {
57: return (Page) table.get(menuItem);
58: }
59:
60: }
|