2
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
7
The contents of this file are subject to the terms of either the GNU
8
General Public License Version 2 only ("GPL") or the Common
9
Development and Distribution License("CDDL") (collectively, the
10
"License"). You may not use this file except in compliance with the
11
License. You can obtain a copy of the License at
12
http://www.netbeans.org/cddl-gplv2.html
13
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
14
specific language governing permissions and limitations under the
15
License. When distributing the software, include this License Header
16
Notice in each file and include the License file at
17
nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
18
particular file as subject to the "Classpath" exception as provided
19
by Sun in the GPL Version 2 section of the License file that
20
accompanied this code. If applicable, add the following below the
21
License Header, with the fields enclosed by brackets [] replaced by
22
your own identifying information:
23
"Portions Copyrighted [year] [name of copyright owner]"
27
The Original Software is NetBeans. The Initial Developer of the Original
28
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
29
Microsystems, Inc. All Rights Reserved.
31
If you wish your version of this file to be governed by only the CDDL
32
or only the GPL Version 2, indicate your decision by adding
33
"[Contributor] elects to include this software in this distribution
34
under the [CDDL or GPL Version 2] license." If you do not indicate a
35
single choice of license, a recipient has the option to distribute
36
your version of this file under either the CDDL, the GPL Version 2 or
37
to extend the choice of license to its licensees as provided above.
38
However, if you add GPL Version 2 code and therefore, elected the GPL
39
Version 2 license, then the option applies only if the new code is
40
made subject to such option by the copyright holder.
42
<html><head><title>The NetBeans look and feel customization library</title></head><body>
44
This library installs custom values into UIDefaults, such as colors, borders and UI class names, which
45
various components in NetBeans use to provide a customized or native appearance.
47
NetBeans provides a number of custom components, such as the tabbed containers in its main window;
48
other components may look for custom colors - for example, the property sheet will look for a custom color
49
in UIDefaults to use for its margin and the background color of property set entries, in order that it may
50
be customized to match the UI specification for different platforms/look and feels.
52
This library centralizes the installation and setup of such custom values. It also:
54
<li>Handles the setup of custom font sizes for look and feels (other than GTK, which
55
gets its font sizes from the operating system theme), by replacing the font entries in UIDefaults with those
56
of the requested font size</li>
57
<li>Allows UIDefaults values to be guaranteed to be present for look and feels (GTK) which do not
58
provide them, to enable older code that depends on such values being there (as they were for all look
59
and feels until JDK 1.4) to work without modification</li>
60
<li>Handles loading of a theme file for those look and feels (Metal) that support MetalTheme</li>
61
<li>Installs per-look-and-feel customizations needed to ensure a harmonious, native appearance on a
62
given look and feel</li>
63
<li>Contains custom implementations of things like ToolbarUI for some platforms on which
64
NetBeans does not use the standard JDK implementation (GTK and Aqua).</li>
68
An application using NetBeans tab control, window system, property sheet or some other component
69
of NetBeans, which wants to guarantee that the same colors and styles are used in their application as in
70
NetBeans, needs simply to call <code>org.netbeans.swing.plaf.Startup.run()</code> early in its startup
71
sequence, as <code>org.netbeans.core.Main</code> does.
73
A look and feel or application author who wishes to provide custom values for some thing can provide
74
an implementation of <code>org.netbeans.swing.plaf.LFCustoms</code>, and place it in UIManager under
75
a key which contains the unique ID of the look and feel. See the documentation for LFCustoms for further
76
details of how to do this.
78
Another option is simply to provide values for the (quite self-explanatory) keys defined as static fields
79
of the LFCustoms class. The advantage to providing an implementation of LFCustoms is simply that those
80
values would not be loaded unless requested; either approach is equivalent.
82
Also, if a look and feel is designed to be an improvement on an existing platform-specific look and
83
feel (such as JGoodies for Windows or QuaQua for Apple), it may simply provide the appropriate existing
84
LFCustoms subclass name in UIDefaults, in accordance with the following:
88
<th>Look and feel</th>
89
<th>UIManager key</th>
95
<td>Metal look and feel</td>
96
<td>Nb.MetalLFCustoms</td>
97
<td>org.netbeans.swing.plaf.metal.MetalLFCustoms</td>
101
<td>Windows classic look and feel</td>
102
<td>Nb.WindowsLFCustoms</td>
103
<td>org.netbeans.swing.plaf.winclassic.WindowsLFCustoms</td>
107
<td>Windows XP look and feel</td>
108
<td>Nb.WindowsXPLFCustoms</td>
109
<td>org.netbeans.swing.plaf.winxp.XPLFCustoms</td>
113
<td>Aqua look and feel (Mac)</td>
114
<td>Nb.AquaLFCustoms</td>
115
<td>org.netbeans.swing.plaf.aqua.AquaLFCustoms</td>
119
<td>GTK Look and Feel (Linux & Solaris) - JDK 1.5 and up</td>
120
<td>Nb.GTKLFCustoms</td>
121
<td>org.netbeans.swing.plaf.gtk.GtkLFCustoms</td>
125
For details on the specific requirements and design of this library, see its
126
<a href="architecture-summary.html">arch questions and answers</a>.