01: /*
02: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
03: *
04: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
05: *
06: * The contents of this file are subject to the terms of either the GNU
07: * General Public License Version 2 only ("GPL") or the Common
08: * Development and Distribution License("CDDL") (collectively, the
09: * "License"). You may not use this file except in compliance with the
10: * License. You can obtain a copy of the License at
11: * http://www.netbeans.org/cddl-gplv2.html
12: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13: * specific language governing permissions and limitations under the
14: * License. When distributing the software, include this License Header
15: * Notice in each file and include the License file at
16: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
17: * particular file as subject to the "Classpath" exception as provided
18: * by Sun in the GPL Version 2 section of the License file that
19: * accompanied this code. If applicable, add the following below the
20: * License Header, with the fields enclosed by brackets [] replaced by
21: * your own identifying information:
22: * "Portions Copyrighted [year] [name of copyright owner]"
23: *
24: * Contributor(s):
25: *
26: * Portions Copyrighted 2007 Sun Microsystems, Inc.
27: */
28: package org.netbeans.modules.javascript.hints.spi;
29:
30: import java.util.prefs.Preferences;
31: import javax.swing.JComponent;
32:
33: /**
34: * A rule which is configurable (enabled, properties, etc) by the user.
35: *
36: * @author Tor Norbye
37: */
38: public interface UserConfigurableRule extends Rule {
39:
40: /** Gets unique ID of the rule
41: */
42: public String getId();
43:
44: /** Gets longer description of the rule
45: */
46: public String getDescription();
47:
48: /** Finds out whether the rule is currently enabled.
49: * @return true if enabled false otherwise.
50: */
51: public boolean getDefaultEnabled();
52:
53: // XXX Add Others
54: // public JPanel getCustomizer() or Hash map getParameters()
55: // /** Gets the UI description for this rule. It is fine to return null
56: // * to get the default behavior. Notice that the Preferences node is a copy
57: // * of the node returned from {link:getPreferences()}. This is in oder to permit
58: // * canceling changes done in the options dialog.<BR>
59: // * Default implementation return null, which results in no customizer.
60: // * It is fine to return null (as default implementation does)
61: // * @param node Preferences node the customizer should work on.
62: // * @return Component which will be shown in the options dialog.
63: // */
64: public JComponent getCustomizer(Preferences node);
65: }
|