View Javadoc

1   /*
2    * $HeadURL: $
3    * $Date: $
4    * $Revision: $
5    * $Author: $
6    * 
7    * Copyright (c) 2005 MindTree Consulting Ltd. 
8    * 
9    * This file is part of Insight.
10   * 
11   * Insight is free software: you can redistribute it and/or modify it under the 
12   * terms of the GNU General Public License as published by the Free Software 
13   * Foundation, either version 3 of the License, or (at your option) any later 
14   * version.
15   * 
16   * Insight is distributed in the hope that it will be useful, but 
17   * WITHOUT ANY WARRANTY; without even the implied warranty of 
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General 
19   * Public License for more details.
20   * 
21   * You should have received a copy of the GNU General Public License along with 
22   * Insight.  If not, see <http://www.gnu.org/licenses/>.
23   */
24  package com.mindtree.techworks.insight.gui.action;
25  
26  import java.awt.event.ActionEvent;
27  import javax.swing.AbstractAction;
28  
29  import com.mindtree.techworks.insight.gui.Insight;
30  import com.mindtree.techworks.insight.gui.preferences.PreferencesFrame;
31  
32  /**
33  *
34  * The <code>MaintainPreferencesAction</code> class is an AbstractAction derivative that
35  * brings up the display to maintain application preferences
36  *
37  * @author  Regunath B
38  * @version 1.0, 04/12/30
39  * @see     com.mindtree.techworks.insight.gui.PreferencesFrame
40  */
41  
42  public class MaintainPreferencesAction extends AbstractAction {
43  	
44  	/**
45  	 * Used for object serialization
46  	 */
47  	private static final long serialVersionUID = -3318156412555969702L;
48  
49  	/**
50  	 * The PreferencesFrame GUI instance for maintaining preferences
51  	 */
52  	private PreferencesFrame preferencesFrame;
53  	
54  	/**
55  	 * The Insight instance that created this Action instance
56  	 */
57  	private Insight insight;
58  	
59  	/**
60  	 * Constructor for this class
61  	 * @param insight the Insight that created an instance of this class
62  	 */
63  	public MaintainPreferencesAction(Insight insight) {
64  		this.insight = insight;
65  	}
66  	
67  	/**
68  	 * Overriden super class method. Resets the display widgets.
69  	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
70  	 */
71  	public void actionPerformed(ActionEvent e) {
72  		if (this.preferencesFrame == null) {
73  			this.preferencesFrame = new PreferencesFrame(this.insight);
74  		}
75  		this.preferencesFrame.showPreferences();
76  	}
77  	
78  }