Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/aspectj/tools/ajde/netbeans/AJRunAction.java


1   
2   
3   /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
4    *
5    * This file is part of the IDE support for the AspectJ(tm)
6    * programming language; see http://aspectj.org
7    *
8    * The contents of this file are subject to the Mozilla Public License
9    * Version 1.1 (the "License"); you may not use this file except in
10   * compliance with the License. You may obtain a copy of the License at
11   * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
12   *
13   * Software distributed under the License is distributed on an "AS IS" basis,
14   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
15   * for the specific language governing rights and limitations under the
16   * License.
17   *
18   * The Original Code is AspectJ.
19   *
20   * The Initial Developer of the Original Code is Xerox Corporation. Portions
21   * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
22   * All Rights Reserved.
23   *
24   * Contributor(s): Phil Sager (psager@mb.sympatico.ca)
25   */
26  
27  package org.aspectj.tools.ajde.netbeans;
28  
29  import org.openide.util.HelpCtx;
30  import org.openide.util.NbBundle;
31  import org.openide.util.actions.CallableSystemAction;
32  
33  /** Action that can always be invoked and work procedurally.
34   *
35   * @author  Phil Sager
36   */
37  public class AJRunAction extends CallableSystemAction {
38      
39      public static boolean PROP_ENABLED = false;
40      
41      public void performAction() {
42          NbManager.INSTANCE.run();
43         
44      }
45      
46      public String getName() {
47          return NbBundle.getMessage(AJRunAction.class, "LBL_RunAction");
48      }
49      
50      protected String iconResource() {
51          return "/org/aspectj/ajde/resources/actions/execute.gif";
52      }
53      
54  
55      public HelpCtx getHelpCtx() {
56          return HelpCtx.DEFAULT_HELP;
57          // If you will provide context help then use:
58          // return new HelpCtx (RunAction.class);
59      }
60      
61      public boolean isEnabled(){
62          return PROP_ENABLED;
63      }
64      
65      public void setEnabled(boolean enable){
66          PROP_ENABLED = enable;
67          super.setEnabled(enable);
68      }
69      
70      /** Perform extra initialization of this action's singleton. 
71       * PLEASE do not use constructors for this purpose! */
72        protected void initialize () {
73              super.setEnabled(false);
74        }
75      
76  }