Source code: org/aspectj/tools/ajde/netbeans/AJOptionsAction.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 import org.aspectj.ajde.ui.swing.AjdeUIManager;
34
35 /** Action that can always be invoked and work procedurally.
36 *
37 * @author Phil Sager
38 */
39 public class AJOptionsAction extends CallableSystemAction {
40
41 public static boolean PROP_ENABLED = false;
42
43 public void performAction() {
44 AjdeUIManager.getDefault().showOptionsFrame();
45 }
46
47 public String getName() {
48 return NbBundle.getMessage(AJOptionsAction.class, "LBL_OptionsAction");
49 }
50
51 protected String iconResource() {
52 return "/org/aspectj/ajde/resources/actions/browseroptions.gif";
53 }
54
55 public boolean isEnabled(){
56 return PROP_ENABLED;
57 }
58
59 public void setEnabled(boolean enable){
60 PROP_ENABLED = enable;
61 super.setEnabled(enable);
62 }
63
64 public HelpCtx getHelpCtx() {
65 return HelpCtx.DEFAULT_HELP;
66 // If you will provide context help then use:
67 // return new HelpCtx (OptionsAction.class);
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 }