View Javadoc

1   package com.explosion.expf.menusandtools.menu;
2   
3   /* =============================================================================
4    *       
5    *     Copyright 2004 Stephen Cowx
6    *
7    *     Licensed under the Apache License, Version 2.0 (the "License");
8    *     you may not use this file except in compliance with the License.
9    *     You may obtain a copy of the License at
10   *
11   *     http://www.apache.org/licenses/LICENSE-2.0
12   *
13   *     Unless required by applicable law or agreed to in writing, software
14   *     distributed under the License is distributed on an "AS IS" BASIS,
15   *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   *     See the License for the specific language governing permissions and
17   *     limitations under the License.
18   * 
19   * =============================================================================
20   */
21  
22  import java.util.Map;
23  
24  import javax.swing.JCheckBoxMenuItem;
25  
26  import com.explosion.expf.menusandtools.CookieChecker;
27  
28  /***
29   * @author Stephen Cowx
30   */
31  
32  public class ExpCheckBoxMenuItem extends JCheckBoxMenuItem
33  {
34  
35    private CookieChecker cookieChecker;
36  
37    public ExpCheckBoxMenuItem(String name, String cookieName, int enabledThreshold)
38    {
39      super(name);
40      this.cookieChecker = new CookieChecker(cookieName, enabledThreshold);
41    }
42  
43    /***
44     * This method checks for an object of type Integer
45     */
46    public void checkEnabled(Map componentCookies, Map localCookies,Map globalCookies) throws Exception
47    {
48      cookieChecker.checkEnabled(componentCookies, localCookies, globalCookies, this);
49    }
50  }