KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > explorer > propertysheet > PropertyDisplayer_Inline


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-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /*
20  * PropertyDisplayer_Inline.java
21  * Refactored from PropertyDisplayer.Inline to avoid making the class public
22  * Created on December 13, 2003, 7:22 PM
23  */

24 package org.openide.explorer.propertysheet;
25
26
27 /** Basic interface for a property displayer which displays an inline
28  * editor component, including methods for the various UI options
29  * appropriate to such a component
30  * @author Tim Boudreau
31  */

32 interface PropertyDisplayer_Inline extends PropertyDisplayer {
33     /** Set whether the instance should the custom editor button if
34      * the property's property editor supports a custom editor */

35     public void setShowCustomEditorButton(boolean val);
36
37     /** Determine if the custom editor button should be shown for properties
38      * whose editors support custom editors. The default should be true */

39     public boolean isShowCustomEditorButton();
40
41     /** Set whether components should have borders as is typical for use
42      * in a panel, or should show no borders, as is appropriate for uses
43      * in tables and trees. This may also affect behavior on focus -
44      * components with popup windows should show their popup immediately
45      * on receiving focus if table ui has been set to true */

46     public void setTableUI(boolean val);
47
48     /** Determine if the instance will show borders. The default should
49      * be false */

50     public boolean isTableUI();
51
52     /** Set a threshold for editors which would normally be rendered as
53      * a combo box - below the threshold number of possible values, a
54      * panel containing radio buttons should be used; above it a combo
55      * box should be used */

56     public void setRadioButtonMax(int max);
57
58     /** Get the threshold number of components above which a combo box
59      * should be used, and below which a panel containing radio buttons
60      * should be used. Default should be 0. */

61     public int getRadioButtonMax();
62
63     /** Sets the policy for using labels. Certain types of inline editors,
64      * notably checkboxes and radio button panels, are most usable if they
65      * show the title of the property (in the case of radio buttons, using
66      * TitledBorder, and in the case of checkboxes, as the checkbox
67      * caption (which also serves to indicate keyboard focus in many look
68      * and feels. If this value is true, the component supplied will
69      * display the title of a component if the component is one that can
70      * benefit from this. Setting this property to true does not guarantee
71      * that a title will be displayed - that depends on the type of editor
72      * used - for cases like combo boxes, proper alignment of labels with
73      * combo boxes cannot be done automatically (taking into account the
74      * other components on the form), but for cases like checkboxes and
75      * radio buttons it is useful. If the component is indeed displaying
76      * a lable, isTitleDisplayed() will return true. */

77     public void setUseLabels(boolean val);
78
79     /** Determine if, in appropriate cases, the component should show the
80      * title of the property being edited. The default is false. */

81     public boolean isUseLabels();
82
83     /** Returns true if isUseLabels() is true and the displayed component
84      * does indeed show the title */

85     public boolean isTitleDisplayed();
86
87     /** Returns true if the displayer is set to use radio buttons for
88      * boolean properties instead of a checkbox */

89     public boolean isRadioBoolean();
90
91     /** Set whether boolean properties should be represented by a checkbox
92      * or a pair of radio buttons */

93     public void setRadioBoolean(boolean b);
94
95     /**
96      * If this ever becomes API, delete this method and find another way.
97      * @return The ReusablePropertyEnv instance this displayer reconfigures on
98      * the fly to display different properties
99      */

100     public ReusablePropertyEnv getReusablePropertyEnv();
101 }
102
Popular Tags