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.php.project.options;
29:
30: import javax.swing.Icon;
31: import javax.swing.ImageIcon;
32: import org.netbeans.api.options.OptionsDisplayer;
33: import org.netbeans.modules.php.project.ResourceMarker;
34: import org.netbeans.spi.options.OptionsCategory;
35: import org.netbeans.spi.options.OptionsPanelController;
36: import org.openide.util.NbBundle;
37: import org.openide.util.Utilities;
38:
39: /**
40: * Defines a new options category in the IDE's options dialog.
41: *
42: * @author avk
43: */
44: public final class PhpOptionsCategory extends OptionsCategory {
45:
46: /**
47: * php options category specified in
48: * org.netbeans.modules.php.project.resources.layer.xml
49: * as 'OptionsDialog/PhpOptions.instance'
50: */
51: //private static final String PHP_OPTIONS_CATEGORY = "PhpOptions";
52: /**
53: * php options are moved to misclleaneous category now.
54: */
55: private static final String PHP_OPTIONS_CATEGORY = "Advanced";
56: private static String LBL_OPTIONS_CATEGORY_NAME = "OptionsCategory_Name";
57: private static String LBL_OPTIONS_CATEGORY_TITLE = "OptionsCategory_Title";
58:
59: public String getCategoryName() {
60: return NbBundle.getMessage(PhpOptionsCategory.class,
61: LBL_OPTIONS_CATEGORY_NAME);
62: }
63:
64: public String getTitle() {
65: return NbBundle.getMessage(PhpOptionsCategory.class,
66: LBL_OPTIONS_CATEGORY_TITLE);
67: }
68:
69: public OptionsPanelController create() {
70: return new PhpOptionsPanelController();
71: }
72:
73: public Icon getIcon() {
74: return new ImageIcon(Utilities.loadImage(ResourceMarker
75: .getLocation()
76: + ResourceMarker.OPTIONS_ICON));
77:
78: }
79:
80: public static void displayPhpOptions() {
81: OptionsDisplayer.getDefault().open(PHP_OPTIONS_CATEGORY);
82: }
83: }
|