Rewriting the initialization to be more meaningful for clueless reader that does not need to understand every detail
2 * Sun Public License Notice
4 * The contents of this file are subject to the Sun Public License
5 * Version 1.0 (the "License"). You may not use this file except in
6 * compliance with the License. A copy of the License is available at
9 * The Original Code is NetBeans. The Initial Developer of the Original
10 * Code is Jaroslav Tulach. Portions Copyright 2007 Jaroslav Tulach.
11 * All Rights Reserved.
17 import javax.swing.event.ChangeListener;
21 * @author Jaroslav Tulach
23 // BEGIN: design.less.friend.Accessor
24 public abstract class Accessor {
25 private static volatile Accessor DEFAULT;
26 public static Accessor getDefault() {
29 throw new IllegalStateException("Something is wrong: " + a);
34 public static void setDefault(Accessor accessor) {
35 if (DEFAULT != null) {
36 throw new IllegalStateException();
44 protected abstract Item newItem();
45 protected abstract void addChangeListener(Item item, ChangeListener l);
46 // FINISH: design.less.friend.Accessor
48 // BEGIN: design.less.friend.InitAPI
49 private static final Class<?> INIT_API_CLASS = loadClass(Item.class.getName());
50 private static Class<?> loadClass(String name) {
53 name, true, Accessor.class.getClassLoader()
55 } catch (Exception ex) {
56 throw new RuntimeException(ex);
59 // END: design.less.friend.InitAPI