KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > actions > UiOptions


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.java.actions;
21
22 import java.util.prefs.Preferences JavaDoc;
23 import org.openide.util.NbPreferences;
24
25 /** Holds all the UI options, names etc, Uses innerclasses plainly as namespaces.
26  *
27  * @author phrebejk
28  */

29 final class UiOptions {
30             
31     /** Creates a new instance of UiOptions */
32     private UiOptions() {}
33     
34     final static class GoToTypeDialog {
35     
36         private static final String JavaDoc GO_TO_TYPE_DIALOG = "GoToTypeDialog"; // NOI18N
37

38         private static final String JavaDoc CASE_SENSITIVE = "caseSensitive"; // NOI18N
39
private static final String JavaDoc WIDTH = "width"; // NOI18N
40
private static final String JavaDoc HEIGHT = "height"; // NOI18N
41

42         private static Preferences JavaDoc node;
43         
44         public static boolean getCaseSensitive() {
45             return getNode().getBoolean(CASE_SENSITIVE, false);
46         }
47         
48         public static void setCaseSensitive( boolean caseSensitive) {
49             getNode().putBoolean(CASE_SENSITIVE, caseSensitive);
50         }
51         
52         public static int getHeight() {
53             return getNode().getInt(HEIGHT, 460);
54         }
55         
56         public static void setHeight( int height ) {
57             getNode().putInt(HEIGHT, height);
58         }
59         
60         public static int getWidth() {
61             return getNode().getInt(WIDTH, 680);
62         }
63          
64         public static void setWidth( int width ) {
65             getNode().putInt(WIDTH, width);
66         }
67         
68         private static synchronized Preferences JavaDoc getNode() {
69             if ( node == null ) {
70                 Preferences JavaDoc p = NbPreferences.forModule(UiOptions.class);
71                 node = p.node(GO_TO_TYPE_DIALOG);
72             }
73             return node;
74         }
75     }
76     
77 }
78
Popular Tags