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  /**
27  *
28  * The <code>IAction</code> interface represents all menu items and tool bar
29  * button instances in Insight. It contains specific behavior for enabling
30  * and disabling and data related call-back from the Controller
31  * 
32  * @see com.mindtree.techworks.insight.Controller
33  * @see com.mindtree.techworks.insight.gui.Presentation
34  *
35  * @author  Regunath B
36  * @version 1.0, 05/03/11
37  */
38  public interface IAction {
39  
40  	/**
41  	 * Useful constants to identify the broad types of actions
42  	 */
43  	public static final int NONE = 1;
44  	public static final int NO_CONSTRAINTS = 2;
45  	public static final int MUTATION = 4 | NO_CONSTRAINTS;
46  	public static final int TAIL = 8 | MUTATION;
47  	public static final int VIEW = 16 | MUTATION;
48  	public static final int STARTUP = 32 | MUTATION;
49  	public static final int ALL = 64 | STARTUP;
50  	
51  	/**
52  	 * Useful array of mutual exclusion type
53  	 */
54  	public static final int[][] MUTUAL_EXCLUSION_TYPES = {
55  			{MUTATION, MUTATION},
56  			{STARTUP, MUTATION},
57  			{TAIL, NO_CONSTRAINTS},
58  	};
59  	
60  	/**
61  	 * Returns the type of this IAction 
62  	 * @return valid type defined in this interface
63  	 */
64  	public int getType();
65  	
66  	/**
67  	 * Sets the enabled state of this action
68  	 */
69  	public void setEnabled (boolean enable);
70  	
71  }